我使用下面的代码来通知菜单选择索引
NSDictionary *userInfo= [NSDictionary dictionaryWithObject:[NSString stringWithFormat:@"123"]
forKey:@"Index"];
[[NSNotificationCenter defaultCenter] postNotificationName: @"notifyToMenuSelectionNotification"
object: userInfo];
-(void)menuSelectionNotification:(NSNotification *)notification
{
NSLog(@"%@", notification.userInfo);
}
menuSelectionNotification 被正确触发,
但 NSLog 输出 notification.userInfo 仍然是 {null}
欢迎任何评论1