我是 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;
最佳答案
从错误消息的外观来看,UILocalNotification
是类集群的一部分。文档没有说(我可以很快看到)但您似乎不太可能将 UILocalNotification
子类化。
相反,您应该使用 UILocalNotification
提供的 userInfo
添加您希望在通知触发时可用的任何额外信息。
关于ios - 扩展 UILocalNotification,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18317860/