4
我在iOS的初學者。我嘗試擴展UILocalNotification。我的課程在下面。延伸UILocalNotification
@interface FSCustomNatification : UILocalNotification
typedef enum {
FSCustomNatificationPay,
FSCustomNatificationWrite,
FSCustomNatificationSend
} NotificationTypeT;
@property (nonatomic, assign) NotificationTypeT typeNotificationT;
@end
#import "FSCustomNatification.h"
@implementation FSCustomNatification
@end
當我設置typeNotificationT財產,我得到 - [UIConcreteLocalNotification setTypeNotificationT:]:無法識別的選擇發送到實例0x8144780。爲什麼?
FSCustomNatification* localNotification = [[FSCustomNatification alloc] init];
localNotification.typeNotificationT = FSCustomNatificationWrite;
你試過重寫'init'嗎?它看起來像是認爲'localNotification'是'UIConcreteLocalNotification'而不是'FSCustomNatification'。另外,你的班名中有一個a而不是o。 – thegrinner
是的,我嘗試了overrite初始化。 – fisher3421