2014-10-02 62 views
1

試圖讓UIPopoverController顯示我的iPadUIPopoverController(SWIFT)

一個uipickerviewcontroller
let popOver = UIPopoverController() 
    popOver.delegate = self 
    popOver.setContentViewController(imagePicker, animated: true) 

錯誤:

*** Terminating app due to uncaught exception 'NSGenericException', reason: '-[UIPopoverController init] is not a valid initializer. You must call -[UIPopoverController initWithContentViewController:].' 
+0

所以你有什麼問題嗎? – ytbryan 2014-10-02 12:50:51

+0

我如何使它工作?我不能快速地創建init medtode。而谷歌只顯示obj-c medthodes – KennyVB 2014-10-02 12:54:30

回答

0

使用

let popOver = UIPopoverController(contentViewController:imagePicker)