2017-02-13 28 views
0

我想實例化一個新的ViewController與PushViewController一起使用並訂閱事件。但是,當我這樣做時,我得到一個錯誤,說我需要傳遞一個「IntPtr」參數。這是怎麼回事?實例化新的ViewController Xamarin iOS

enter image description here

更新:讀 「mystoryPage」 而不是 「storyController」。

回答

0

如果你的UIViewController從情節提要/廈門國際銀行的到來,加上默認構造函數您storyPageScroll類調​​用基initWithNibName:bundle:構造:

public storyPageScroll() : base("storyPageController", null) 
{ 
} 

用法:

var storyController = new storyPageScroll(); 

否則增加一個基地構造函數,它調用init構造函數:

public storyPageScroll() : base (NSObjectFlag.Empty) 
{ 
} 
+0

你的第一個解決方案給我兩個錯誤,1.該方法沒有返回類型,2.意外字符':'。 –

+0

我更新了它以匹配你的'storyPageScroll'類名 – SushiHangover

+0

對不起。我犯了一個錯誤。現在沒有錯誤。 –

相關問題