私は客観的な C 言語を学んでおり、それを行うときに簡単な質問をします。
// ParentClass.h
@interface ParentClass : NSObject
@property (read, strong) NSString *parentPublicStr;
@end
// ParentClass.m
@interface ParentClass ()
@property (readwrite, strong) NSString *parentPrivateStr;
@end
@implementation ParentClass
@synthesize parentPublicStr;
@synthesize parentPrivateStr;
@end
// Subclass SubClass.h
@interface SubClass : ParentClass
- (void) test;
@end
@implementation SubClass
- (void) test
{
// Its not possible to do that : [self setParentPrivateStr:@"myStrin"]
// And for parentPublicStr, it is public property so not protected, because i can change the value
// in main.c, and it's so bad..
}
@end
保護されたプロパティを作成したい :x
ありがとうございます。(私の英語でごめんなさい)