我正在嘗試學習Objective-C。所以我剛剛實施了ProfileViewController這裏是我的頭文件:「強」屬性問題
#import <UIKit/UIKit.h>
@interface ProfileViewController : UIViewController
@property (strong, nonatomic) UIScrollView *scrollView;//strong is not colored by XCode
@end
但我與@property
線下面的錯誤,我完全堅持了下來:
No 'assign', 'retain' or 'copy' attribute is specified - 'assign' is assumed
Default property 'assign' not appropriate for non-gc object
而且在我ProfileViewController.m
我有以下警告:Property 'scrollView' needs
setScrollView need to be defined
Developer Information:
Version: 4.1 (4B110)
Location: /Developer
Applications:
Xcode: 4.1 (516)
Instruments: 4.1 (4138)
Dashcode: 3.0.2 (336)
SDKs:
Mac OS X:
10,6: (10J567)
10,7: (11A511a)
iPhone OS:
4,3: (8H7)
iPhone Simulator:
4,3: (8H7)
可能你有一個隱形字符插入到你正在處理的文件。重新定義屬性。 – CodaFi 2013-04-22 04:09:45
更新您的Xcode版本。我不相信4.1支持引入strong關鍵字的ARC。 – 2013-04-22 04:19:18