0

UILocalNotification2 つの整数変数を使用できるようにカスタマイズするにはどうすればよいですか。をクラスに継承しようとしましUILocalNotificaionたが、追加した 2 つの整数のいずれかにアクセスするとクラッシュします。

@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
4

1 に答える 1

1

UILocalNotification の組み込みの userInfo プロパティを使用します。

たとえば、キーと値のペアの NSDictionary を格納できます。NSNumber オブジェクトを使用して int を表します。

于 2011-10-31T17:48:47.137 に答える