0
我想在NSNotification的userinfo字典中傳遞UIInterfaceOrientation對象。我怎麼能做到這一點?iOS:如何通過NSNotification發送UIInterfaceOrientation對象
我想在NSNotification的userinfo字典中傳遞UIInterfaceOrientation對象。我怎麼能做到這一點?iOS:如何通過NSNotification發送UIInterfaceOrientation對象
把它包一個NSNumber內:
id orientationObject = [NSNumber numberWithInteger:UIInterfaceOrientationPortrait];
[userinfo setObject:orientationObject forKey:@"orientation"];
// pass around ...
UIInterfaceOrientation orientation = (UIInterfaceOrientation)[[userinfo objectForKey:@"orientation"] integerValue];