2012-02-02 9 views

答えて

2

はサブクラスそれをし、あなたはそれがアドレス帳のフレームワーククラスのために予約されます、クラスのプレフィックスとして `AB`を使用すべきではありませんshouldAutorotateToInterfaceOrientation:

// .h file 
@interface MMABPeoplePickerPortraitOnlyNavigationController : ABPeoplePickerNavigationController 
@end 

// .m file 
@implementation MMABPeoplePickerPortraitOnlyNavigationController 

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    return UIInterfaceOrientationIsPortrait(interfaceOrientation); 
} 

@end 
+0

をオーバーライドします。 – omz

+0

@omz編集されたコード。 – Guillaume

+0

または 'interfaceOrientation == UIInterfaceOrientationPortrait'です。 'UIInterfaceOrientationIsPortrait()'は、意図されていない可能性がある、PortraitUpsideDownでも同様です。 –