注意:我只在這裏談論.m文件。實例變量只在類內部可見
我對這兩件事情混爲一談,都被說成是順便宣佈內部實例變量:
方法1:
@interface MyClass()
// Declare instance variable which is only visible in this class
@end
@implementation MyClass
...
@end
方式2:
@implementation MyClass {
// Declare instance variable which is only visible in this class
}
...
@end
這兩種聲明實例變量的方式有什麼區別?