我如何自定义UILocalNotification
所以它可以采用两个整数变量。我试图将UILocalNotificaion
继承到一个类,但是当我访问我添加的两个整数之一时它崩溃了。
@interface AHNotification : UILocalNotification {
@public
int AllIndex;
int Index;
}
@property int AllIndex;
@property int Index;
@end
@implementation AHNotification
@synthesize AllIndex,Index;
-(AHNotification*) init{
[super init];
return self;
}
@end
答案 0 :(得分:1)
使用UILocalNotification的内置userInfo属性。
例如,您可以在其中存储键值对的NSDictionary。使用NSNumber对象来表示您的整数。