Board logo

標題: iOS 5.0 [打印本頁]

作者: pericles    時間: 2012-4-1 02:19     標題: iOS 5.0

iOS Programming
作者: pericles    時間: 2012-4-1 02:25     標題: Thread 1: Program received signal: "SIGABRT".

@autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }

Sol.:  TARGETS --> Summary --> Identifier  -->  xxx.yyyyyyyy.apps   (due to the Identifier)
作者: pericles    時間: 2012-4-8 02:07     標題: 'copy' attribute does not match ... from '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

Sol:  Change it to:

@property (nonatomic, copy) NSString *subtitle;
@property (nonatomic, copy) NSString *title;

The MKAnnotation protocol declares

@property (nonatomic, readonly, copy) NSString *title;
@property (nonatomic, readonly, copy) NSString *subtitle;

You shouldn't change the storage type of a property, the only change you can / should make is from readonly to readwrite if needed;




歡迎光臨 百怡富科技有限公司 (http://www.pericles.net/bbs/) Powered by Discuz! 5.0.0