在创建自定义的iOS表格视图单元时,我创建了一个新的.xib文件,在界面构建器中拖放了一些UI元素,我的.h文件如下所示...
#import <UIKit/UIKit.h>
@interface MasterTableViewCell : UITableViewCell
{
IBOutlet UILabel *cellLabel;
IBOutlet UIImage *cellImage;
}
@property (nonatomic, retain) IBOutlet UILabel *cellLabel;
@property (nonatomic, retain) IBOutlet UIImage *cellImage;
@end
在一些博客中,我看到实例变量丢失了。何时需要声明实例变量?对于特定的UI对象,实例变量和@property声明都不需要吗? 另外,我正在使用自动引用计数来创建应用程序,因此也不需要垃圾收集。这对实例变量和属性的使用有什么区别?