2011-10-07 2 views
0

나는 목표 C를 처음 사용합니다. 버튼 클릭으로 팝업보기를 호출하고 싶습니다.오류 : 예외 'NSInvalidArgumentException'Pad'

: 나는 (self.SharePopoverView == 전무) 나는 오류를 얻고있다 {

self.SharePopoverView = [[shareView alloc] autorelease ]; 
    *****************this line code creating some problem********* 
    self.SharepopOverController = [[[UIPopoverController alloc] initWithContentViewController:SharePopoverView] autorelease]; 

} 


[SharepopOverController presentPopoverFromBarButtonItem:self permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES]; 

경우 다음 코드

를 사용하여 내 응용 프로그램을 실행하고 때 는이 오류를 얻고있다

캐치되지 않은 예외 'NSInvalidArgumentException'으로 인해 앱 종료 중, 이유 : '- [UIPopoverController initWithContentViewController :] 실행하지 않을 때 호출 됨 UIUserInterfaceIdiomPad 아래에 있습니다. '

답변

3

iPhone에서이 프로그램을 실행하는 경우 UIPopoverController은 iPad 용으로 제작되었으므로 작동하지 않습니다. 하지만 this question을 참조하면 iPhone에서 작동하도록 할 수 있습니다.