views:

56

answers:

1

I am getting this warning on the following line:

@synthesize labels;

Now, the rest of my declaration (in the .h file) is as follows:

@interface Menus:SuperClass<Protocols>
{
    ...    
    UILabel **labels;
}
@property (nonatomic, retain) UILabel             **labels;

Does anyone know why this is happening?

+3  A: 

A retain property only works with class-type objects (i.e. pointers to objc_object). The generated setters would e.g. attempt to call -retain on the argument it gets, which obviously doesn't work on a pointer-to-pointer.

You could preferably use a container like NSArray instead. If you want to go with the quite atypical dynamic C-style array for some reason you could use an assign property.

Georg Fritzsche
I'd go further and say that `UILabels **` is an extremely atypical pattern. Why not an `NSArray` or `NSMutableArray`?
bbum
@bbum: Right, i reworded that somewhat to not give the wrong impression.
Georg Fritzsche