I've got this error:
2011-03-28 15:38:07.154 FolderNavigation[264:207] -[Subfolder _setViewDelegate:]: unrecognized selector sent to instance 0x6eaafd0
Unhandled Exception: MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInvalidArgumentException Reason: -[Subfolder _setViewDelegate:]: unrecognized selector sent to instance 0x6eaafd0
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/plasma/Source/iphone/monotouch/UIKit/UIApplication.cs:26
at MonoTouch.UIKit.UIApplication.Main (System.String[] args) [0x00000] in /Users/plasma/Source/iphone/monotouch/UIKit/UIApplication.cs:31
at FolderNavigation.Application.Main (System.String[] args) [0x00000] in /Users/claudio/Projects/FolderNavigation/FolderNavigation/Main.cs:16
Error connecting stdout and stderr (127.0.0.1:10001)
and following de code using Debug(using Step Into)
Starting on Main.cs:
static void Main (string[] args)
{
UIApplication.Main (args);
}
Subfolder.xib.cs(next Step Into)
[Export("initWithCoder:")]
public Subfolder (NSCoder coder) : base(coder)
{
Initialize ();
}
void Initialize ()
{
}
and in the next step, I have got this error.
Does anybody have an idea?
Thanks in advance!
Is this a View or ViewController? My auto-generated files have a public Subfolder() : base("Subfolder", null) constructor, which I don't see here.
Also, which version of XCode & MT are you running?
Related
After update from mvvmcross 4.4.0 to 5.0.5 method ShowViewModel<SettingsViewModel>(); throws System.InvalidCastException. Output is:
mvx:Diagnostic:121.13 Showing ViewModel SettingsViewModel
iOSNavigation:Diagnostic:121.13 Navigate requested
mvx:Diagnostic:121.16 PresentationAttribute not found for SettingsViewController. Assuming animated Child presentation
and a StackTrace :
at MvvmCross.iOS.Views.MvxTabBarViewController.ShowChildView (UIKit.UIViewController viewController) [0x00007] in <091ad1c63ffa448eb48cc38964d45708>:0
at MvvmCross.iOS.Views.Presenters.MvxIosViewPresenter.ShowChildViewController (UIKit.UIViewController viewController, MvvmCross.iOS.Views.Presenters.Attributes.MvxChildPresentationAttribute attribute, MvvmCross.Core.ViewModels.MvxViewModelRequest request) [0x0004a] in <091ad1c63ffa448eb48cc38964d45708>:0
at MvvmCross.iOS.Views.Presenters.MvxIosViewPresenter.<RegisterAttributeTypes>b__20_1 (UIKit.UIViewController vc, MvvmCross.iOS.Views.Presenters.Attributes.MvxBasePresentationAttribute attribute, MvvmCross.Core.ViewModels.MvxViewModelRequest request) [0x00000] in <091ad1c63ffa448eb48cc38964d45708>:0
at MvvmCross.iOS.Views.Presenters.MvxIosViewPresenter.Show (MvvmCross.iOS.Views.IMvxIosView view, MvvmCross.Core.ViewModels.MvxViewModelRequest request) [0x0002c] in <091ad1c63ffa448eb48cc38964d45708>:0
at MvvmCross.iOS.Views.Presenters.MvxIosViewPresenter.Show (MvvmCross.Core.ViewModels.MvxViewModelRequest request) [0x00009] in <091ad1c63ffa448eb48cc38964d45708>:0
at MvvmCross.iOS.Views.MvxIosViewDispatcher+<>c__DisplayClass2_0.<ShowViewModel>b__0 () [0x00016] in <091ad1c63ffa448eb48cc38964d45708>:0
at MvvmCross.iOS.Views.MvxIosUIThreadDispatcher.RequestMainThreadAction (System.Action action) [0x0001f] in <091ad1c63ffa448eb48cc38964d45708>:0
at MvvmCross.iOS.Views.MvxIosViewDispatcher.ShowViewModel (MvvmCross.Core.ViewModels.MvxViewModelRequest request) [0x00022] in <091ad1c63ffa448eb48cc38964d45708>:0
at MvvmCross.Core.ViewModels.MvxNavigatingObject.ShowViewModelImpl (System.Type viewModelType, MvvmCross.Core.ViewModels.IMvxBundle parameterBundle, MvvmCross.Core.ViewModels.IMvxBundle presentationBundle) [0x0002c] in <ed129c02df414c1d8cea008ca80d94cb>:0
at MvvmCross.Core.ViewModels.MvxNavigatingObject.ShowViewModel (System.Type viewModelType, MvvmCross.Core.ViewModels.IMvxBundle parameterBundle, MvvmCross.Core.ViewModels.IMvxBundle presentationBundle) [0x00000] in <ed129c02df414c1d8cea008ca80d94cb>:0
at MvvmCross.Core.ViewModels.MvxNavigatingObject.ShowViewModel[TViewModel] (MvvmCross.Core.ViewModels.IMvxBundle parameterBundle, MvvmCross.Core.ViewModels.IMvxBundle presentationBundle) [0x00000] in <ed129c02df414c1d8cea008ca80d94cb>:0
at FreQuest.ViewModels.Tabs.MyProfileViewModel.<get_SettingsCommand>b__35_0 () [0x00001] in /Users/pavlomelnyk/frequest-ios-xamarin/FreQuest/ViewModels/Tabs/MyProfileViewModel.cs:114
at MvvmCross.Core.ViewModels.MvxCommand.Execute (System.Object parameter) [0x00009] in <ed129c02df414c1d8cea008ca80d94cb>:0
at MvvmCross.Binding.iOS.Target.MvxUIControlTargetBinding.ControlEvent (System.Object sender, System.EventArgs eventArgs) [0x00025] in <78be62c59fd541e38ea9b95c6cd03bdc>:0
at UIKit.UIControlEventProxy.Activated () [0x00007] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/UIKit/UIControl.cs:38
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/4691/d2270eec/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/4691/d2270eec/source/xamarin-macios/src/UIKit/UIApplication.cs:63
at FreQuest.iOS.Application.Main (System.String[] args) [0x00001] in /Users/pavlomelnyk/frequest-ios-xamarin/iOS/Main.cs:17
I invoke ShowViewModel<SettingsViewModel>(); in MyProfileViewModel that is in UITabBarController that extends MvxTabBarViewController. My guess is somehow ViewModels related to TabBarContreller do not "see" SettingsViewController.
Has somebody face same issue? Your feedback will be very helpful.
Thanks
In my Xamarin app when I call this method
private void MakePayment (SKProduct product)
{
SKPayment payment = SKPayment.PaymentWithProduct (product);
SKPaymentQueue.DefaultQueue.AddPayment (payment);
}
I get this error:
Failed to marshal the Objective-C object 0x14607110 (type:
SKPaymentTransaction). Could not find an existing managed instance for
this object, nor was it possible to create a new managed instance
(because the type 'MonoTouch.StoreKit.SKPaymentTransaction[]' does not
have a constructor that takes one IntPtr argument).
I'm not sure if I have something configured wrong or there is an issue in my code or Xamarin.
Here's the code for the Observer
internal class CustomPaymentObserver : SKPaymentTransactionObserver
{
private InAppPurchase inAppPurchase;
public CustomPaymentObserver (InAppPurchase inAppPurchase)
{
this.inAppPurchase = inAppPurchase;
}
public override void UpdatedTransactions (SKPaymentQueue queue, SKPaymentTransaction[] transactions)
{
Console.WriteLine ("UpdatedTransactions");
foreach (SKPaymentTransaction transaction in transactions) {
switch (transaction.TransactionState) {
case SKPaymentTransactionState.Purchased:
inAppPurchase.CompleteTransaction (transaction);
break;
case SKPaymentTransactionState.Failed:
inAppPurchase.FailedTransaction (transaction);
break;
default:
break;
}
}
}
public override void PaymentQueueRestoreCompletedTransactionsFinished (SKPaymentQueue queue)
{
}
public override void RestoreCompletedTransactionsFailedWithError (SKPaymentQueue queue, NSError error)
{
}
}
Here is the full stack trace:
System.Exception: Failed to marshal the Objective-C object 0x17ecb680 (type: SKPaymentTransaction). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'MonoTouch.StoreKit.SKPaymentTransaction[]' does not have a constructor that takes one IntPtr argument).
at MonoTouch.ObjCRuntime.Runtime.MissingCtor (IntPtr ptr, IntPtr klass, System.Type type, MissingCtorResolution resolution) [0x00046] in /Developer/MonoTouch/Source/monotouch/src/ObjCRuntime/.pp-Runtime.cs:352
at MonoTouch.ObjCRuntime.Runtime.ConstructNSObject[NSObject] (IntPtr ptr, System.Type type, MissingCtorResolution missingCtorResolution) [0x00000] in :0
at MonoTouch.ObjCRuntime.Runtime.GetNSObject (IntPtr ptr, System.Type target_type, MissingCtorResolution missingCtorResolution, System.Boolean& created) [0x00073] in /Developer/MonoTouch/Source/monotouch/src/ObjCRuntime/.pp-Runtime.cs:514
at MonoTouch.ObjCRuntime.Runtime.GetNSObjectWrapped (IntPtr ptr, IntPtr type_ptr, System.Boolean& created) [0x0000c] in /Developer/MonoTouch/Source/monotouch/src/ObjCRuntime/.pp-Runtime.cs:686
at at (wrapper native-to-managed) MonoTouch.ObjCRuntime.Runtime:GetNSObjectWrapped (intptr,intptr,int&)
at at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging:void_objc_msgSend_IntPtr (intptr,intptr,intptr)
at MonoTouch.StoreKit.SKPaymentQueue.AddPayment (MonoTouch.StoreKit.SKPayment payment) [0x00014] in /Developer/MonoTouch/Source/monotouch/src/StoreKit/.pp-SKPaymentQueue.g.cs:109
at IOS.Util.IAP.InAppPurchase.ReceivedResponse (MonoTouch.StoreKit.SKProductsRequest request, MonoTouch.StoreKit.SKProductsResponse response) [0x0001d] in /Users/aaron/Projects/budget-ease-xamarin/IOS/Util/IAP/InAppPurchase.cs:43
at at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/.pp-UIApplication.cs:38
at IOS.Application.Main (System.String[] args) [0x00008] in /Users/aaron/Projects/budget-ease-xamarin/IOS/Main.cs:16
What's happened here is that the C# instance of your CustomPaymentObserver got garbage collected, while it's native ("Objective-C") counterpart lived on. When a notification was finally delivered, the native object tried to call into the now dead C# object and crashed your App.
To circumvent this, keep a reference to your CustomPaymentObserver e.g. in your AppDelegate to keep it alive.
I'm not sure this is documented somewhere for Xamarin.iOS (couldn't find something on a quick look), but I believe very similar for Xamarin.Droid (e.g. http://developer.xamarin.com/guides/android/advanced_topics/garbage_collection/)
I'm not really sure what was causing this. I thought it was perhaps something related to the linker. But I uninstalled Xamarin completely from my Mac (including all the MonoTouch stuff) and reinstalled everything and now it's working.
when using steema Teechart, its working fine in simulator, but application crashing when using in iphone,
its shows following error
System.NullReferenceException: Object reference not set to an instance of an object
at Steema.TeeChart.TChart.ApplyScroll () [0x00000] in :0
at Steema.TeeChart.TChart.m__0 (System.Object sender, System.EventArgs e) [0x00000] in :0
at MonoTouch.UIKit.UIScrollView+_UIScrollViewDelegate.Scrolled (MonoTouch.UIKit.UIScrollView scrollView) [0x0000d] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIScrollView.g.cs:991
at MonoTouch.UIKit.UIScrollView.SetContentOffset (PointF contentOffset, Boolean animated) [0x00010] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIScrollView.g.cs:208
at Steema.TeeChart.TChart.Draw (RectangleF rect) [0x00000] in :0
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38
at CropManageriPhone.Application.Main (System.String[] args) [0x00000] in /Users/vss1/VSS Projects/CP Live/CropManageriPhone04022013/CropManageriPhone/Main.cs:17
and We are using monotouch version 6.0.4
i found solution for this,
i set ZoomScrollStyle for the chart control,
_controller.chart.Aspect.ZoomScrollStyle=Steema.TeeChart.Drawing.Aspect.ZoomScrollStyles.Manual;
When I run app with or without Degugging it give me an error as below
**Unhandled Exception: System.ExecutionEngineException: SIGILL
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00042] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:29
at DicomViewerApplication.Application.Main (System.String[] args) [0x00000] in /Developer/Medsynaptic/DicomViewerApplication/DicomViewerApplication/Main.cs:18
[ERROR] FATAL UNHANDLED EXCEPTION: System.ExecutionEngineException: SIGILL
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00042] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:29
at DicomViewerApplication.Application.Main (System.String[] args) [0x00000] in /Developer/Medsynaptic/DicomViewerApplication/DicomViewerApplication/Main.cs:18 **
but when I run the app from simulator it works properly I want to check the values that come with debugger but it give me an error
This question is likely solved in the latest version of Xamarin
The MonoTouch solution includes two projects.
MonoTouch Binding Project: API Contract interfaces for linked native
ObjC library
Test Client Application
The native ObjC library requires to include Core Data Model file (.momd). I have added it to the project of Test App.
But app crashes with the following error:
Unhandled Exception: MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInvalidArgumentException Reason: Cannot create an NSPersistentStoreCoordinator with a nil model
at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging:void_objc_msgSendSuper_IntPtr_bool (intptr,intptr,intptr,bool)
at MonoTouch.UIKit.UIViewController.PresentModalViewController (MonoTouch.UIKit.UIViewController modalViewController, Boolean animated) [0x00038] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIViewController.g.cs:261
at CombinedControllerApp.MainController.<ViewDidLoad>m__2 (System.Object , System.EventArgs ) [0x0003d] in /Users/mahmood1/Documents/Projects/TouchNote-Prototype/CombinedControllerApp/MainController.cs:96
at MonoTouch.UIKit.UIControlEventProxy.Activated () [0x00000] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIControl.cs:30
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00042] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:29
at CombinedControllerApp.Application.Main (System.String[] args) [0x00000] in /Users/mahmood1/Documents/Projects/TouchNote-Prototype/CombinedControllerApp/Main.cs:17
[ERROR] FATAL UNHANDLED EXCEPTION: MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInvalidArgumentException Reason: Cannot create an NSPersistentStoreCoordinator with a nil model
at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging:void_objc_msgSendSuper_IntPtr_bool (intptr,intptr,intptr,bool)
at MonoTouch.UIKit.UIViewController.PresentModalViewController (MonoTouch.UIKit.UIViewController modalViewController, Boolean animated) [0x00038] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIViewController.g.cs:261
at CombinedControllerApp.MainController.<ViewDidLoad>m__2 (System.Object , System.EventArgs ) [0x0003d] in /Users/mahmood1/Documents/Projects/TouchNote-Prototype/CombinedControllerApp/MainController.cs:96
at MonoTouch.UIKit.UIControlEventProxy.Activated () [0x00000] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIControl.cs:30
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00042] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:29
at CombinedControllerApp.Application.Main (System.String[] args) [0x00000] in /Users/mahmood1/Documents/Projects/TouchNote-Prototype/CombinedControllerApp/Main.cs:17
How to add this needed CoreData Model File into Test Application that it will be visible for the native library?
Thanks!
(Sources are here : http://www.axifile.com/en/71EC96914A)
Per my comment:
Adding most files like this to your project with Build Action of Content will solve the issue.