开发者

How do you differentiate private member variable in objective-c?

开发者 https://www.devze.com 2023-04-08 23:45 出处:网络
for private methods, I could use @interface MyClass(PrivateMetho开发者_如何学Gods) - (void) _foo;

for private methods,

I could use

@interface MyClass(PrivateMetho开发者_如何学Gods)
- (void) _foo;
@end  

How do you declare a private member variable in objective c?


http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ObjectiveC/Chapters/ocDefiningClasses.html#//apple_ref/doc/uid/TP30001163-CH12-TPXREF127

@interface MyClass : Superclass {

@private
    NSString * privateString;
}

@end


You can declare it as follows..

@private //variable;

Check this question out. Question- private-instance-variable

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号