gpt4 book ai didi

ios - 扩展 UILocalNotification

转载 作者:可可西里 更新时间:2023-11-01 05:30:09 24 4
gpt4 key购买 nike

我是 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com