2011-08-10 38 views

回答

51

當您嘗試在類的實現範圍之外合成屬性時,可能會發生這種情況。

錯誤:

@synthesize yourProperty; 
@implementation YourClass 
@end 

正確:

@implementation YourClass 
@synthesize yourProperty; 
@end 
+0

我在@implementation YourClass – JulianB

+0

#import命令之後使用#import命令在@implementation觸發了我之後也發生了這種情況。謝謝JulianB – nolimitsdude

+0

你可能會檢查這個答案作爲接受的! –

0

當您使用#import它經常發生,並且不會對文件的頂部。