在Xcode的4.1沒有問題,但升級到的Xcode 4.2,我得到以下警告後:爲什麼升級到的Xcode 4.2並MKAnnotation顯示警告
Property 'title' 'copy' attribute does not match the property inherited from 'MKAnnotation'
Property 'subtitle' 'copy' attribute does not match the property inherited from 'MKAnnotation'
我的代碼:
@interface MyAnnotation : NSObject <MKAnnotation> {
CLLocationCoordinate2D coordinate;
NSString *subtitle;
NSString *title;
}
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
@property (nonatomic, retain) NSString *subtitle;
@property (nonatomic, retain) NSString *title;
-(id)initWithCoordinate:(CLLocationCoordinate2D) coordinate;
@end
這兩個屬性,是他們真的嗎?如果是這樣,爲什麼? – Phlibbo
如果以下答案中的任何一條提出瞭解決方案,請點擊答案旁邊的複選標記以接受答案。這將有助於未來用戶搜索相同問題的答案。謝謝。 – SnareChops