How to pass userInfo in NSNotification?

Я пытаюсь отправить некоторые данные с помощью NSNotification, но застреваю. Вот мой код:

// Posting Notification
NSDictionary *orientationData;
if(iFromInterfaceOrientation == UIInterfaceOrientationLandscapeRight) {
    orientationData = [NSDictionary dictionaryWithObject:@"Right"
                                                  forKey:@"Orientation"];
}

NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
[notificationCenter postNotificationName:@"Abhinav"
                                  object:nil
                                userInfo:orientationData];

// Adding observer
[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(orientationChanged)
                                             name:@"Abhinav"
                                           object:nil];

Теперь, как получить этот словарь userInfo в моем селекторе ОриентацияChanged ?

47
задан Georg Schölly 5 October 2010 в 07:23
поделиться