Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
After calling PerformFetch successfully, trying to access the Sections property
results in InvalidCastException.
System.InvalidCastException: Cannot cast from source type to destination type.
at at (wrapper castclass) object:__castclass_with_cache (object,intptr,intptr)
at MonoTouch.Foundation.NSArray.ArrayFromHandle[NSFetchedResultsSectionInfo] (IntPtr handle) [0x00044] in /Developer/MonoTouch/Source/monotouch/src/shared/Foundation/NSArray.cs:188
at MonoTouch.CoreData.NSFetchedResultsController.get_Sections () [0x0000b] in /Developer/MonoTouch/Source/monotouch/src/CoreData/NSFetchedResultsController.g.cs:354
at CoreData.TableViewSource.RowsInSection (MonoTouch.UIKit.UITableView tableView, Int32 section) [0x00007] in /Users/g/Projects/CoreData/CoreData/DataEnvironment.cs:204
at at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging:void_objc_msgSend (intptr,intptr)
at MonoTouch.UIKit.UIWindow.MakeKeyAndVisible () [0x00010] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIWindow.g.cs:129
at CoreData.AppDelegate.FinishedLaunching (MonoTouch.UIKit.UIApplication app, MonoTouch.Foundation.NSDictionary options) [0x00038] in /Users/g/Projects/CoreData/CoreData/AppDelegate.cs:31
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/UIApplication.cs:38
at CoreData.Application.Main (System.String args) [0x00008] in /Users/g/Projects/CoreData/CoreData/Main.cs:16
Created attachment 4699 [details]
It's fixed in Xamarin.iOS 6.9.x but the fix is not related to iOS7 (comment #2). IOW the Xamarin.iOS 7.0 stable release (which will include this fix) will work on older iOS releases.
This is fixed by how protocols are supported by the binding generator (i.e. btouch). This is a big change and won't be backported to the stable 6.4 release (which is why the fix is only avaiable in 6.9+).
*** This bug has been marked as a duplicate of bug 13785 ***