0

NSNotification の userinfo ディクショナリに UIInterfaceOrientation オブジェクトを渡したいです。どうすればそれを達成できますか?

4

1 に答える 1

3

NSNumber内にラップします。

id orientationObject = [NSNumber numberWithInteger:UIInterfaceOrientationPortrait];
[userinfo setObject:orientationObject forKey:@"orientation"];

// pass around ...

UIInterfaceOrientation orientation = (UIInterfaceOrientation)[[userinfo objectForKey:@"orientation"] integerValue];
于 2012-05-17T08:21:01.897 に答える