Monday, March 22, 2010

Property 'username' attribute in 'ConnectApi' class continuation does not match 'ConnectApi' class property

Want to declare external API as readonly, while internal has to be writable. Done this before, but right now something doesn't work.

Turned out that the reason is missmatch in unwritten default values. The property types must match in both external and internal declaration, including the non-written default values. This is the correct version:
@interface ConnectApi : NSObject
    NSString *username;
@property (nonatomic, copy, readonly) NSString *username;
@interface ConnectApi ()
@property (nonatomic, copy, readwrite) NSString *username;

No comments:

Post a Comment