2012-06-22 118 views
0

我做了一個.xib文件並添加了我的按鈕和標籤。然後,我創建了UIViewController文件,並將其作爲自定義類添加到文件的Owner類,然後將其視圖與ViewController連接起來。UIViewController的視圖不會出現在UIPopoverController

然後我去了我的UIView有按鈕,當我按下它,並創建了按鈕動作,然後我在這個行動

OpenFileViewController *openfileview = [[OpenFileViewController alloc] init]; 
    //int subcount = openfileview.view.subviews.count; 
    UIPopoverController *openfilediaglog = [[UIPopoverController alloc] initWithContentViewController:openfileview]; 
    openpopoverController = openfilediaglog; 
    [openpopoverController setPopoverContentSize:CGSizeMake(320, 460)]; 
    [openpopoverController presentPopoverFromRect:CGRectMake(0, 0,400, 500) inView:self permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; 

當我按下按鈕UIPopoverController出現,但空我寫來顯示UIPopoverController找不到問題!!!?它在哪裏 ?

回答

1

如果您OpenFileViewController有廈門國際銀行,而不是程序化的界面,你不能使用init

// OpenFileViewController *openfileview = [[OpenFileViewController alloc] init]; 

OpenFileViewController *openfileview = [[OpenFileViewController alloc] initWithNibName:NIBNAME bundle:NSBUNDLE]; 
2

使用這個代替OpenFileViewController初始化。

OpenFileViewController *openfileview = [[OpenFileViewController alloc] initWithNibName:@"OpenFileViewController" bundle:nil]; 
相關問題