I have a question, here's the code:
@interface MyFoo : NSObject {
NSString *nameStr;
}
@end
@implementation MyFoo
- (id)init {
self = [super init];
if (self) {
self->nameStr = [@"some value of the string that is set right into the private ivar" copy];
}
return self;
}
@end
The question is: ignoring all the C++ rules, ignoring memory dump vulnerability, why exactly I shouldn't use such arrow operator syntax?
Is there somewhere in Apple documentation a rule which says that it's incorrect because in future class may be represented differently than a pointer to a struct in runtime etc. ?
Thanks in advance!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…