Sunday 15 April 2012

objective c - Property Refuses to Synthesize -


I'm going through a screencast to learn how to write table-based iPhone applications, and this is very much Running smoothly so far Currently I am half way through the third episode, and it is starting to make a stop.

To remove temporary hard-coding for the top layer of the table, the tutorial will show a NSMutableDicitonary for all entries and their data, and then just display the headings in the table cells Creates an NSArray by using the forKeys statement to get an array with / P>

The problem is that the array refuses to synthesize the array.

The abusive property defined in the AppDelegate.h file is as follows:

  @property (read only) NSArray * Recipes;  

Then it is codified and applied in the AppDelegate.m file as follows:

  @ synthesis recipes; - (NSArray *) Recipes {Return [data of all]; }  

I questioned the author of the screencast and gave the following suggestion for AppDelegate.h :

  @class Foo : NSABEZE {NSERRE * _ Russian; } @protecti (nontomic, raten) nsarey * recipes; @end  

and for AppDelegate.m :

  @implementation Foo @ synthesize recipes = _recipes; @end  

I tried this method, but more errors were made than before. Does this variable definition differ from any other @ property, and how can I treat it?

@ synthesis generates a simple method to use the property Since your accessor method is more complex, it can not be generated from @ synthesis .

  - (NSArray *) recipes {back to [all of the data]; }  

No comments:

Post a Comment