1
我想修改NSUserNotifictation通過自定義變量:定製NSUserNotifictation對象
@interface MyUserNotification: NSUserNotification
@property (nonatomic) int theid;
@property (nonatomic) NSString* url;
@end
@implementation MyUserNotification
@end
然後在我的AppDelegate
對象啓動時:
MyUserNotification *notification = [[MyUserNotification alloc] init];
notification.theid = theid;
設置theid
引發錯誤:
-[_NSConcreteUserNotification setTheid:]: unrecognized selector sent to instance 0x100204840
爲什麼NSConcreteUserNotification
對象涉入?
乾杯:https://developer.apple.com/reference/foundation/nsusernotification/1415675-userinfo對自定義對象感到興奮 – maxisme
@Maximilian它以這種方式工作的原因永遠不會對我們凡人顯而易見,但它是通過類集羣實現的,通常我們永遠不需要知道「爲什麼」。 –