可以通过子类可访问的属性自动创建ivar变量吗?

时间:2013-08-21 10:25:51

标签: objective-c

我是这么认为的。 _iVar受到保护。

然而,我必须将这些添加到子类:

@synthesize strFullName = _strFullName;
@synthesize strPictureURL = _strPictureURL;
@synthesize strID = _strID;
@synthesize strFirstName = _strFirstName;
@synthesize strLastName = _strLastName;

否则我的子类无权访问_strLastName等。为什么?

超级阶级的宣言如下:

@interface BGTwitterOrFacebookHandler : BGMotherOfAllHandler
-(void) vRequestPermission;
@property (nonatomic,readonly) NSString * strID;
@property (nonatomic, readonly) NSString * strFullName;
@property (nonatomic,readonly) NSString * strPictureURL;
@property (nonatomic,readonly) NSString * strFirstName;
@property (nonatomic,readonly) NSString * strLastName;
@property (nonatomic,readonly) NSString * strBirthday;
@property (nonatomic,readonly) NSString * strEmail;
@property (nonatomic,readonly) NSString * strGender;
@property (nonatomic) ACAccountStore * ACAstore;
@property (nonatomic) ACAccount * acAcount;
+(BGTwitterOrFacebookHandler *) singleton;
-(void)logout;
@end

0 个答案:

没有答案