4

我是iOS的初学者。我尝试扩展 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:]: unrecognized selector sent to instance 0x8144780。为什么?

FSCustomNatification* localNotification = [[FSCustomNatification alloc] init];
localNotification.typeNotificationT = FSCustomNatificationWrite;
4

1 回答 1

6

从您的错误消息的外观来看,UILocalNotification它是类集群的一部分。文档没有说(我可以很快看到),但您似乎不太可能将UILocalNotification.

相反,您应该使用userInfo提供的 byUILocalNotification添加您希望在通知触发时可用的任何额外信息。

于 2013-08-19T15:55:18.313 回答