0

假设我有一个类的自定义初始化程序:

- (id) initWithBlah:(NSString *)blah{
    // do random stuff with blah and return self
}

如何以另一种方法访问分配给“blah”的字符串?

- (void) getBlah {
    // get value of blah here from initializer
}

有任何想法吗?

4

1 回答 1

0

阅读属性:https ://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Chapters/ocProperties.html

于 2012-06-19T17:58:37.867 回答