抱歉,如果我对这个太挑剔了,但我现在正在学习 iOS 编程,而且我似乎有些人这样声明IBOutlet
:
IBOutlet 附加到属性
#import <UIKit/UIKit.h>
#import "CustomCell.h"
@interface CustomTableViewController : UITableViewController {
CustomCell *customCell;
}
@property (nonatomic, retain) IBOutlet CustomCell *customCell;
@end
还有一些这样的声明:
IBOutlet 附加到接口内的声明
#import <UIKit/UIKit.h>
#import "CustomCell.h"
@interface CustomTableViewController : UITableViewController {
IBOutlet CustomCell *customCell;
}
@property (nonatomic, retain) CustomCell *customCell;
@end
哪一种是正确的声明方式?它们之间有什么区别吗?如果有人知道解释为什么他们把它放在不同的地方,那就太棒了。
非常感谢 :)