现在在看别人的代码 发现他们都把h文件的内容写到m文件里
比如:
@interface MyTreeViewController ()
{
NSArray *tree;
}
@end
@implementation MyTreeViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
为什么要这么做?为什么不直接在头文件里写
@property(strong,nonatomic)NSArray *tree;
??