更新Xcode 7的舊項目,並且出現更新前未收到的錯誤。屬性上的XCode屬性與從'UIViewController'繼承的屬性不匹配
.h文件中:
@interface TableRowViewController : UITableViewController {
UIImage *rowImage;
NSString *nibName;
}
@property (nonatomic, strong) UIImage *rowImage;
@property (nonatomic, strong) NSString *nibName; // <-- error here
@end
拋出錯誤:
'copy' attribute on property 'nibName' does not match the property inherited from 'UIViewController'
.m文件:
#import "TableRowViewController.h"
@implementation TableRowViewController
@synthesize rowImage;
@synthesize nibName;
@end
就像頭一樣,刪除實例變量和合成名稱。回到當天,您必須手動執行此操作,現在實例變量與合成屬性一起生成。 – TheCodingArt
@TheCodingArt只是爲了確保我明白...我是否擺脫了\ @synthesize和\ @property行,NSString行呢? – AndyD273
@sythesize和括號中的實例變量 – TheCodingArt