2017-02-21 7 views
2

私はXamarin iOSアプリケーションを持っていましたが、正常に動作していましたが、触れた内容がわからないので、ストーリーボードの別のビュー:このオブジェクトの既存の管理対象インスタンスが見つかりませんでした

System.Exception: Failed to marshal the Objective-C object 0x7ffa72c19570 (type: PropertyListViewController). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'Rental.iOS.PropertyListViewController' does not have a constructor that takes one IntPtr argument). 
    at at (wrapper managed-to-native) ObjCRuntime.Messaging:void_objc_msgSendSuper_bool_bool (intptr,intptr,bool,bool) 
    at UIKit.UIViewController.BeginAppearanceTransition (System.Boolean isAppearing, System.Boolean animated) [0x0002c] in /Users/builder/data/lanes/3969/7beaef43/source/xamarin-macios/src/build/ios/native/UIKit/UIViewController.g.cs:168 
    at XLPagerTabStrip.PagerTabStripViewController.UpdateContent() [0x001c3] in /Users/abd/Programming/Gits/Rental/Rental/Rental/Rental.iOS/XLPagerTabStrip/PagerTabStripViewController.cs:271 
    at XLPagerTabStrip.PagerTabStripViewController.Scrolled (UIKit.UIScrollView scrollView) [0x0000e] in /Users/abd/Programming/Gits/Rental/Rental/Rental/Rental.iOS/XLPagerTabStrip/PagerTabStripViewController.cs:339 
    at at (wrapper managed-to-native) ObjCRuntime.Messaging:void_objc_msgSend_CGPoint (intptr,intptr,CoreGraphics.CGPoint) 
    at UIKit.UIScrollView.set_ContentOffset (CoreGraphics.CGPoint value) [0x00010] in /Users/builder/data/lanes/3969/7beaef43/source/xamarin-macios/src/build/ios/native/UIKit/UIScrollView.g.cs:387 
    at XLPagerTabStrip.PagerTabStripViewController.UpdateContent() [0x00068] in /Users/abd/Programming/Gits/Rental/Rental/Rental/Rental.iOS/XLPagerTabStrip/PagerTabStripViewController.cs:247 
    at XLPagerTabStrip.PagerTabStripViewController.Scrolled (UIKit.UIScrollView scrollView) [0x0000e] in /Users/abd/Programming/Gits/Rental/Rental/Rental/Rental.iOS/XLPagerTabStrip/PagerTabStripViewController.cs:339 
    at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr) 
    at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/3969/7beaef43/source/xamarin-macios/src/UIKit/UIApplication.cs:79 
    at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/3969/7beaef43/source/xamarin-macios/src/UIKit/UIApplication.cs:63 
    at Rental.iOS.Application.Main (System.String[] args) [0x00008] in /Users/abd/Programming/Gits/Rental/Rental/Rental/Rental.iOS/Main.cs:17 

何が間違っていないことを確認するために私がチェックすることができますか?

私はthhisコンストラクタを追加しました:

public partial class PropertyListViewController : UIViewController 
{ 
    protected PropertyListViewController(IntPtr handle) : base(handle) 
    { 
     // Note: this .ctor should not contain any initialization logic. 
    } 
    ~~~~ 
} 

しかし、今、私はこのエラーが表示さ:

Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: -[UIViewController _loadViewFromNibNamed:bundle:] loaded the "PropertyListViewController" nib but the view outlet was not set. 
Native stack trace: 
    0 CoreFoundation      0x000000010c73ad4b __exceptionPreprocess + 171 
    1 libobjc.A.dylib      0x000000011713a21e objc_exception_throw + 48 
    2 CoreFoundation      0x000000010c7a42b5 +[NSException raise:format:] + 197 
    3 UIKit        0x00000001101b6aea -[UIViewController _loadViewFromNibNamed:bundle:] + 679 
    4 UIKit        0x00000001101b72e7 -[UIViewController loadView] + 177 
    5 UIKit        0x00000001101b761c -[UIViewController loadViewIfRequired] + 201 
    6 UIKit        0x00000001101be062 -[UIViewController __viewWillAppear:] + 118 
    7 Rental.iOS       0x000000010c0c6f9c xamarin_dyn_objc_msgSendSuper + 220 
    8 ???         0x0000000130fb7405 0x0 + 5116752901 

    at at (wrapper managed-to-native) ObjCRuntime.Messaging:void_objc_msgSendSuper_bool_bool (intptr,intptr,bool,bool) 
    at UIKit.UIViewController.BeginAppearanceTransition (System.Boolean isAppearing, System.Boolean animated) [0x0002c] in /Users/builder/data/lanes/3969/7beaef43/source/xamarin-macios/src/build/ios/native/UIKit/UIViewController.g.cs:168 
    at XLPagerTabStrip.PagerTabStripViewController.UpdateContent() [0x001c3] in /Users/abd/Programming/Gits/Rental/Rental/Rental/Rental.iOS/XLPagerTabStrip/PagerTabStripViewController.cs:271 
    at XLPagerTabStrip.PagerTabStripViewController.Scrolled (UIKit.UIScrollView scrollView) [0x0000e] in /Users/abd/Programming/Gits/Rental/Rental/Rental/Rental.iOS/XLPagerTabStrip/PagerTabStripViewController.cs:339 
    at at (wrapper managed-to-native) ObjCRuntime.Messaging:void_objc_msgSend_CGPoint (intptr,intptr,CoreGraphics.CGPoint) 
    at UIKit.UIScrollView.set_ContentOffset (CoreGraphics.CGPoint value) [0x00010] in /Users/builder/data/lanes/3969/7beaef43/source/xamarin-macios/src/build/ios/native/UIKit/UIScrollView.g.cs:387 
    at XLPagerTabStrip.PagerTabStripViewController.UpdateContent() [0x00068] in /Users/abd/Programming/Gits/Rental/Rental/Rental/Rental.iOS/XLPagerTabStrip/PagerTabStripViewController.cs:247 
    at XLPagerTabStrip.PagerTabStripViewController.Scrolled (UIKit.UIScrollView scrollView) [0x0000e] in /Users/abd/Programming/Gits/Rental/Rental/Rental/Rental.iOS/XLPagerTabStrip/PagerTabStripViewController.cs:339 
    at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr) 
    at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/3969/7beaef43/source/xamarin-macios/src/UIKit/UIApplication.cs:79 
    at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/3969/7beaef43/source/xamarin-macios/src/UIKit/UIApplication.cs:63 
    at Rental.iOS.Application.Main (System.String[] args) [0x00008] in /Users/abd/Programming/Gits/Rental/Rental/Rental/Rental.iOS/Main.cs:17 

答えて

2

PropertyListViewController does not have a constructor that takes one IntPtr argumentを。あなたのUIViewControllerサブクラスで

、そのよう.ctorを追加します。

public partial class PropertyListViewController : UIViewController 
{ 
    protected PropertyListViewController(IntPtr handle) : base(handle) 
    { 
     // Note: this .ctor should not contain any initialization logic. 
    } 
    ~~~~ 
} 
+0

おかげで、私はチェックしますが、私はこの前に、コンストラクタではない持っていたし、それが正常に働いていました! – AVEbrahimi

+0

@AVEbrahimiこの 'UIViewController'をストーリーボード/ xib経由で使用している場合は必須です。コードでそれを作成している場合、それは必要ではありません... – SushiHangover

+0

あなたが言及したコンストラクタを追加しましたが、今このエラーが表示されます: – AVEbrahimi

関連する問題