Как передать объект с NSNotificationCenter

Я пытаюсь передать объект из моего делегата приложения получателю уведомлений в другом классе.

Я хочу передать целое числоmessageTotal, Прямо сейчас у меня есть:

В приемнике:

- (void) receiveTestNotification:(NSNotification *) notification
{
    if ([[notification name] isEqualToString:@"TestNotification"])
        NSLog (@"Successfully received the test notification!");
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dismissSheet) name:UIApplicationWillResignActiveNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveTestNotification:) name:@"eRXReceived" object:nil];

В классе, который делает уведомление:

[UIApplication sharedApplication].applicationIconBadgeNumber = messageTotal;
[[NSNotificationCenter defaultCenter] postNotificationName:@"eRXReceived" object:self];

Но я хочу передать объектmessageTotal в другой класс.

Ответы на вопрос(4)

Ваш ответ на вопрос