Large amount of crashes on core data managedobjectmodel - swift

Using Fabrics crash analytics or "Crashlytics" I am getting a large amount of crashes (I assume BAD_ACCESS) from the following method/property :
lazy var managedObjectModel: NSManagedObjectModel = {
// The managed object model for the application. This property is not optional. It is a fatal error for the application not to be able to find and load its model.
var modelURL = NSBundle.mainBundle().URLForResource("<app_name>", withExtension: "momd")
return NSManagedObjectModel(contentsOfURL: modelURL!)!
}()
By large amount I mean 275 crashes for 150 users in just one day. It is working fine on most devices but I did have the issue once with my simulator and I reset the contents and restarted my machine and the error went away.
I am hoping there is a better solution than having to tell people who are calling our tech support.
Returned by fabric
Crashed: com.apple.main-thread
0 <app_name> 0x100082f9c specialized AppDelegate.(persistentStoreCoordinator.getter).(closure #1) (AppDelegate.swift:314)
1 <app_name> 0x10007e678 AppDelegate.saveContext() -> () (AppDelegate.swift:340)
2 <app_name> 0x10007e014 #objc AppDelegate.applicationWillTerminate(UIApplication) -> () (AppDelegate.swift)
3 UIKit 0x1949f0d48 -[UIApplication _terminateWithStatus:] + 244
4 UIKit 0x194bef268 __102-[UIApplication _handleApplicationDeactivationWithScene:shouldForceExit:transitionContext:completion:]_block_invoke.2093 + 792
5 UIKit 0x194bf2a18 _runAfterCACommitDeferredBlocks + 292
6 UIKit 0x194be4ab4 _cleanUpAfterCAFlushAndRunDeferredBlocks + 528
7 UIKit 0x194958724 _afterCACommitHandler + 132
8 CoreFoundation 0x18e7e49a0 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
9 CoreFoundation 0x18e7e2628 __CFRunLoopDoObservers + 372
10 CoreFoundation 0x18e7e2a74 __CFRunLoopRun + 956
11 CoreFoundation 0x18e712d94 CFRunLoopRunSpecific + 424
12 GraphicsServices 0x19017c074 GSEventRunModal + 100
13 UIKit 0x1949cb130 UIApplicationMain + 208
14 <app_name> 0x100069940 main (AppDelegate.swift:43)
15 libdyld.dylib 0x18d72159c start + 4
Has anyone else run into this issue? We are using Swift 2.3 currently converting to Swift 3.1.
The function is called when applicationWillTerminate() is called. The modelURL is nil.

I also observed similar situation in my app. I once or twice had this error on simulator.
According to my observations it's happens when user swipes app from App Switcher (and removes it from memory). My guess is that Bundle.main becomes unavailable earlier and app cannot finish something.
I didn't have any contact from users that observed that. It looks like that they can't observe this because they just killed the app. So it's probably harmless (even if annoying).

Related

Crashing when attempting to write to realm

I have an app that takes recordings of passing vehicles and information about them. A client of ours is experiencing a crash when using the app, but I can't find the source. This is the report that I get from Crashlytics:
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000098
Crashed: com.apple.main-thread
0 Realm 0x100d2f298 realm::Table::get_link_target(unsigned long) + 28
1 Realm 0x100b046f0 _ZZZN12_GLOBAL__N_110makeSetterIU8__strongP13RLMObjectBaseS3_EEP11objc_objectP11RLMPropertyEUb1_ENKUlvE_clEv (bind_ptr.hpp:186)
2 Realm 0x100b046f0 _ZZZN12_GLOBAL__N_110makeSetterIU8__strongP13RLMObjectBaseS3_EEP11objc_objectP11RLMPropertyEUb1_ENKUlvE_clEv (bind_ptr.hpp:186)
3 Realm 0x100b0462c ___ZN12_GLOBAL__N_110makeSetterIU8__strongP13RLMObjectBaseS3_EEP11objc_objectP11RLMProperty_block_invoke_2 (RLMAccessor.mm:313)
4 App Name 0x10070a398 SurveyController.(selected(button : RadioButton, in : RadioGroup) -> ()).(closure #1) (Survey Controller.swift:170)
5 RealmSwift 0x1007ee1e4 Realm.write(() throws -> ()) throws -> () (Realm.swift:155)
6 App Name 0x10070b200 specialized SurveyController.selected(button : RadioButton, in : RadioGroup) -> () (Survey Controller.swift:169)
7 App Name 0x10070a64c #objc SurveyController.selected(button : RadioButton, in : RadioGroup) -> () (Survey Controller.swift)
8 App Name 0x100715b24 specialized RadioGroup.buttonTapped(UITapGestureRecognizer) -> () (Radio Group.swift:77)
9 App Name 0x100715028 #objc RadioGroup.buttonTapped(UITapGestureRecognizer) -> () (Radio Group.swift)
10 UIKit 0x18e4f66e8 -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] + 64
11 UIKit 0x18ea633b4 _UIGestureRecognizerSendTargetActions + 124
12 UIKit 0x18e658e38 _UIGestureRecognizerSendActions + 320
13 UIKit 0x18e4f5740 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 764
14 UIKit 0x18ea54bd4 _UIGestureEnvironmentUpdate + 1096
15 UIKit 0x18e4ef4d8 -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 404
16 UIKit 0x18e4ef010 -[UIGestureEnvironment _updateGesturesForEvent:window:] + 276
17 UIKit 0x18e4ee874 -[UIWindow sendEvent:] + 3132
18 UIKit 0x18e4ed1d0 -[UIApplication sendEvent:] + 340
19 UIKit 0x18ecced1c __dispatchPreprocessedEventFromEventQueue + 2340
20 UIKit 0x18ecd12c8 __handleEventQueueInternal + 4744
21 UIKit 0x18ecca368 __handleHIDEventFetcherDrain + 152
22 CoreFoundation 0x1846b3404 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
23 CoreFoundation 0x1846b2c2c __CFRunLoopDoSources0 + 276
24 CoreFoundation 0x1846b079c __CFRunLoopRun + 1204
25 CoreFoundation 0x1845d0da8 CFRunLoopRunSpecific + 552
26 GraphicsServices 0x1865b5020 GSEventRunModal + 100
27 UIKit 0x18e5ed758 UIApplicationMain + 236
28 App Name 0x100701994 main (Image Controller.swift:15)
29 libdyld.dylib 0x184061fc0 start + 4
Line 4, SurveyController.(selected(button : RadioButton, in : RadioGroup) -> ()).(closure #1) (Survey Controller.swift:170) is where I'm assuming the cause of the issue if coming from. This is that block of code:
vehicleGroup.clearSelection() // Line 155
...
func selected(button: RadioButton, in group: RadioGroup) {
if group == vehicleGroup {
let vehicle = realm.objects(Vehicle.self).filter("value = \(button.tag)").first
do {
try realm.write {
recording.vehicle = button.isSelected ? vehicle : nil // Line 170
}
} catch {
record(error: error)
}
}
...
}
// Allows parent controllers to remove selections and reset the view.
func clearSelection() {
for button in buttons {
button.isSelected = false
}
}
Some additional details from the client:
They usually have a few hundred recording made by the time it crashes, but not always. It doesn't always crash when they have that many recordings.
The crash usually kicks them back a screen in the app, but most recently closed the entire thing. I did add the do try catch blocks before the most recent crash, so it might have crashed the whole thing from that, but I thought those would help keep the app open.
What is the cause for the crash? According to Crashlytics, the device still has plenty of RAM left, so I assume it's not a memory leak. Also, like I said, this doesn't happen every time they have a large number of recordings.

Xcode 9 / iOS 11 "CALayer bounds contains NaN: [nan 0; nan 0]" when popping view controller with nested UINavigationController and UITabBarController

I am updating my application for Xcode 9, Swift 4, iOS 11 and the iPhone X. It seems to go relatively smooth all the way but whenever I hit the back button my application crashes. I can go forward 3-4 screens without any problem but the first back button crashes the application, always. It doesn't require the simulator to run as an iPhone X.
It doesn't seem to dip into my code in the stack trace so this is in my opinion the redraw phase of the view controller I'm popping to but I'm not sure.
Since I do quite a bit of custom drawing because there are custom shadows around UITableViews and UIViews I set up breakpoints in all locations where I divide by a variable, but nothing gets hit. So it doesn't seem to be my code that does the calculation by zero.
*** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer bounds contains NaN: [nan 0; nan 0]'
*** First throw call stack:
(
0 CoreFoundation 0x000000010af711cb __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010a8d3f41 objc_exception_throw + 48
2 CoreFoundation 0x000000010afe5b95 +[NSException raise:format:] + 197
3 QuartzCore 0x0000000109424424 _ZN2CA5Layer10set_boundsERKNS_4RectEb + 230
4 QuartzCore 0x0000000109414c29 -[CALayer setBounds:] + 251
5 UIKit 0x0000000107267439 __27-[_UILabelLayer setBounds:]_block_invoke + 80
6 UIKit 0x000000010726717b -[_UILabelLayer _setFrameOrBounds:settingAction:] + 23
7 UIKit 0x00000001072673d8 -[_UILabelLayer setBounds:] + 155
8 QuartzCore 0x000000010941537c -[CALayer setFrame:] + 630
9 UIKit 0x0000000107267319 __26-[_UILabelLayer setFrame:]_block_invoke + 80
10 UIKit 0x000000010726717b -[_UILabelLayer _setFrameOrBounds:settingAction:] + 23
11 UIKit 0x00000001072672b8 -[_UILabelLayer setFrame:] + 155
12 UIKit 0x0000000106c4cf1e -[UIView(Geometry) setFrame:] + 368
13 UIKit 0x0000000106e4ec40 -[UILabel setFrame:] + 141
14 UIKit 0x0000000106fff254 -[UIButton _layoutTitleView] + 248
15 UIKit 0x0000000106fff3cf -[UIButton layoutSubviews] + 250
16 UIKit 0x0000000106c6c551 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1331
17 QuartzCore 0x000000010941b4ba -[CALayer layoutSublayers] + 153
18 QuartzCore 0x000000010941f5a9 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 401
19 QuartzCore 0x00000001093a81cd _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 365
20 QuartzCore 0x00000001093d3ae4 _ZN2CA11Transaction6commitEv + 500
21 UIKit 0x0000000106b97f4a _UIApplicationFlushRunLoopCATransactionIfTooLate + 167
22 UIKit 0x00000001074ef960 __handleEventQueueInternal + 6894
23 CoreFoundation 0x000000010af142b1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
24 CoreFoundation 0x000000010afb3d31 __CFRunLoopDoSource0 + 81
25 CoreFoundation 0x000000010aef8c19 __CFRunLoopDoSources0 + 185
26 CoreFoundation 0x000000010aef81ff __CFRunLoopRun + 1279
27 CoreFoundation 0x000000010aef7a89 CFRunLoopRunSpecific + 409
28 GraphicsServices 0x00000001104e59c6 GSEventRunModal + 62
29 UIKit 0x0000000106b9dd30 UIApplicationMain + 159
30 My Customer's Application Name 0x000000010475f087 main + 55
31 libdyld.dylib 0x000000010cfedd81 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
TL;DR: In our case this iOS 11 / Xcode 9 error was caused by the code that added custom UILabel to the UINavigationItem.titleView.
This code was written using notorious swizzling technique that overrode -[UINavigationItem setTitle:] selector - along with calling the original setTitle: method our developer also set the custom label with the same title to the UINavigationItem.titleView property. The problem was the case when the navigation item was called with setTitle:nil so that empty UILabel was added to the .titleView with zero-rect dimensions and this caused UIKit to crash. The immediate quick fix was to stop setting the .titleView if the title: argument was nil. The long-term fix will be to remove swizzling from the app.
P.S. I have opened a radar with a request to improve the error message for this error:
Xcode 9: Please improve error handling: -[UILabel setFrame:] and -[CALayer setFrame:] throws unfriendly exception if given a malformed CGRect
Since I did all the typing already when I fixed it (it always helps to phrase your question to somebody else ;-) ) I decided to post my question and the answer.
I have a navigation set up where a tab bar is nested in a navigation controller. I know we were warned against it, but hey, it worked like a charm all of the time. After setting large title views via an appearance proxy as follows:
if #available(iOS 11.0, *) {
UINavigationBar.appearance().prefersLargeTitles = true
}
Screens started crashing when going back into them. Changing it back to false made all the problems disappear.
I was getting this same issue, As the toolbar title was set to an empty string on the previous VC. Once I set all the titles with at least some kind of text, I stopped crashing. Again this was only on iOS 11 and Xcode 9, worked in previous versions.
It was happened to me when I set a specify ViewController with the NavigationBar with prefers large titles = true.
I solved it the same way that pjapple15 did. I just set a title like a empty string = " " in the NavigationBar of the previous ViewController and it worked fine.
And I had also added a SearchBar in NavigationBar.titleView, after this I just set NavigationItem.title = " ".

Crash on private method of UIAlertView

I'm seeing a strange crash in one of my apps that seems to be coming from a private method on UIAlertView. I've down some searching and found a few other references to this method being involved in crashes such as here, but I'm not convinced that the cause is the same. However to be certain made sure that I always set the UIAlertView delegate to nil whenever the delegate is deallocated.
The stack trace is as follows:
Exception Type: SIGABRT
Exception Codes: #0 at 0x351ce32c
Crashed Thread: 0
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x351ce32c __pthread_kill + 8
1 libsystem_c.dylib 0x370c329f abort + 95
2 eLogbook 0x000bbacd -[GetOperationPartsDictionary init] (GetOperationPartsDictionary.m:22)
3 UIKit 0x32557f93 -[UIAlertView(Private) _popoutAnimationDidStop:finished:] + 855
4 UIKit 0x3240dc53 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 471
5 UIKit 0x3241357d -[UIViewAnimationState animationDidStop:finished:] + 53
6 QuartzCore 0x36eeac2f CA::Layer::run_animation_callbacks(void*) + 203
7 libdispatch.dylib 0x3140ae91 _dispatch_main_queue_callback_4CF$VARIANT$up + 197
8 CoreFoundation 0x353ad2ad __CFRunLoopRun + 1269
9 CoreFoundation 0x353304a5 CFRunLoopRunSpecific + 301
10 CoreFoundation 0x3533036d CFRunLoopRunInMode + 105
11 GraphicsServices 0x3662c439 GSEventRunModal + 137
12 UIKit 0x32426e7d UIApplicationMain + 1081
13 eLogbook 0x0007767f main (main.m:14)
The thing that is really confusing me about this is that the -[UIAlertView(Private) _popoutAnimationDidStop:finished:] method appears to be calling the init method on my GetOperationPartsDictionary class. From the limited amount of information I've had from users this crash is happening on startup, at which point that class would not have been loaded.
I'm using QuincyKit to deliver the crash reports to a server, from there they're symbolicated using the standard symbolicatecrash script. The version of Xcode being used to symbolicate the crash is the same version that was used to build the binary, and I'm confident that the dSYM used to symbolicate the crash is the correct one - the line numbers for my code are correct for example.
Anyone have any thoughts on this?
Edit: should have added that this is occurring in the field with a live app, but only occasionally. It has affected maybe 1 or 2 users in a thousand or so, but I have never been able to reproduce it either on a device or in the simulator.
Looks like you have called the UIAlertViewDelegate after the alertview has been released.
Release it only in the dealloc method like this :
-(void)dealloc {
self.alertView.delegate = nil; //setting delegate to nil
self.alertView = nil; //if you have defined alert as property
//other release statements of your controller
[super dealloc];
}

How to recognize errors from crash logs

My app works great when I build and debug but when I run on its own, it crashes due to some other issues.
I have one NSObject class, one UITableView class, one UIView class , one UITableViewCell class and one NSOperation class.
Does any body have similar issues or if any one can help me out.
Application Specific Information:
objc_msgSend() selector name: release
iPhone Simulator 235, iPhone OS 4.2 (iPhone/8C134)
Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x01134a67 objc_msgSend + 27
1 UIKit 0x004ab1e2 -[UITableViewCell removeFromSuperview] + 167
2 UIKit 0x003249d9 -[UIView dealloc] + 340
3 UIKit 0x0032e281 -[UIScrollView dealloc] + 341
4 UIKit 0x003661ce -[UITableView dealloc] + 1085
5 Foundation 0x000698da __delayedPerformCleanup + 59
6 CoreFoundation 0x00f4bbde CFRunLoopTimerInvalidate + 446
7 CoreFoundation 0x00fb57d7 __CFRunLoopDoTimer + 1799
8 CoreFoundation 0x00f11cc9 __CFRunLoopRun + 1817
9 CoreFoundation 0x00f11240 CFRunLoopRunSpecific + 208
10 CoreFoundation 0x00f11161 CFRunLoopRunInMode + 97
11 GraphicsServices 0x01874268 GSEventRunModal + 217
12 GraphicsServices 0x0187432d GSEventRun + 115
13 UIKit 0x002fa42e UIApplicationMain + 1160
14 Time 0x00001e08 main + 102 (main.m:14)
15 Time 0x00001d99 start + 53
This technote has the technical info on crashlogs:
http://developer.apple.com/library/mac/#technotes/tn2004/tn2123.html
However, you are having a debugging problem, not a crashlog problem.
See tips for debugging here:
http://www.cocoadev.com/index.pl?DebuggingTechniques
Interpreting crash logs takes practice. People here see this: removeFromSuperview and immediately think "Aha, a clue! this is likely a memory issue" because removeFromSuperview will remove a view then decrement it's retain count. if the retain count is already zero, then decrementing one more time may lead to a crash. Thus, they think you are over releasing your UITableViewCell
check your UITableViewCell for alloc/init, release or autorelease...

My iPhone core data app runs perfectly the first time but crashes when run after that

my app is based around two classes: Jam and JamItem, each with a TableViewController to display / add items.
The model contains two entities for the two classes, and there is an optional one-to-one relationship between them. JamItem has a name field and a price field. Jam has a quantity field. There are corresponding NSManagedObject classes for the two entities.
Both lists are based on table list view controllers and were modelled on the Recipes example on the Apple site. The JamListTableViewController displays all JamItem instances that have been added to the list. When I click add, a new instance of JamItemListTableViewController is created and pushed onto the nav stack. This lists JamItem instances that have been created. When a JamItem is selected, the - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath method creates an instance of JamItem and passes it back via a delegate to JamListTableViewController. This then creates a new instance of Jam and adds the JamItem to it and then saves.
I can run the app perfectly when it is fresh on the simulator and run the first time with a clean database!
The JamItemListTableViewController always works and I can happily add and remove 'jam items' from the list. However, if I stop the app and re-run, then try to add a new JamItem to the jam list (JamListTableViewController), it crashes when JamListTableViewController calls the [jam.managedObjectContext save:&error] and I get the error below, which I think is where it is trying to sort by name.
The NSFetchedResultsController in JamItemListTableViewController is configured to order by name. The NSFetchedResultsController in JamItemListTableViewController is ordered by JamItem.name
I hope this makes sense as I have been pulling my hair out for weeks now trying to find the solution. I think I might have (or have not) released an object, which is causing the JamItem list to flag that it has been updated and start trying to re-sort its list.
This is the dump of the error:
2010-09-29 07:20:00.443 Jams[12451:207] Serious application error. Exception was caught during Core Data change processing. This is usually a bug within an observer of NSManagedObjectContextObjectsDidChangeNotification. [<UINavigationItem 0x5b4dc30> valueForUndefinedKey:]: this class is not key value coding-compliant for the key name. with userInfo {
NSTargetObjectUserInfoKey = "<UINavigationItem: 0x5b4dc30>";
NSUnknownUserInfoKey = name;
}
2010-09-29 07:20:00.446 Jams[12451:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UINavigationItem 0x5b4dc30> valueForUndefinedKey:]: this class is not key value coding-compliant for the key name.'
*** Call stack at first throw:
(
0 CoreFoundation 0x02577919 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x026c55de objc_exception_throw + 47
2 CoreFoundation 0x02577851 -[NSException raise] + 17
3 Foundation 0x000d96b1 -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 279
4 Foundation 0x00040868 _NSGetUsingKeyValueGetter + 147
5 Foundation 0x0003fd2e -[NSObject(NSKeyValueCoding) valueForKey:] + 278
6 Foundation 0x00043535 -[NSObject(NSKeyValueCoding) valueForKeyPath:] + 381
7 Foundation 0x000f7c4f -[NSSortDescriptor compareObject:toObject:] + 128
8 CoreData 0x0237cb5e +[NSFetchedResultsController(PrivateMethods) _insertIndexForObject:inArray:lowIdx:highIdx:sortDescriptors:] + 286
9 CoreData 0x0237d1b2 -[NSFetchedResultsController(PrivateMethods) _postprocessInsertedObjects:] + 402
10 CoreData 0x023831bc -[NSFetchedResultsController(PrivateMethods) _managedObjectContextDidChange:] + 1804
11 Foundation 0x00035c1d _nsnote_callback + 145
12 CoreFoundation 0x0254fcf9 __CFXNotificationPost_old + 745
13 CoreFoundation 0x024cf11a _CFXNotificationPostNotification + 186
14 Foundation 0x0002b7c2 -[NSNotificationCenter postNotificationName:object:userInfo:] + 134
15 CoreData 0x022bf519 -[NSManagedObjectContext(_NSInternalNotificationHandling) _postObjectsDidChangeNotificationWithUserInfo:] + 89
16 CoreData 0x0232eb33 -[NSManagedObjectContext(_NSInternalChangeProcessing) _createAndPostChangeNotification:withDeletions:withUpdates:withRefreshes:] + 259
17 CoreData 0x022a1f78 -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:] + 1352
18 CoreData 0x022dba15 -[NSManagedObjectContext save:] + 149
19 JamsApp 0x000064b3 -[JamsListTableViewController insertJamItem:] + 168
20 JamsApp 0x00006405 -[JamsListTableViewController selectedJamItem:] + 43
21 JamsApp 0x00003f41 -[JamItemListTableViewController tableView:didSelectRowAtIndexPath:] + 143
22 UIKit 0x0033d718 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1140
23 UIKit 0x00333ffe -[UITableView _userSelectRowAtIndexPath:] + 219
24 Foundation 0x0004acea __NSFireDelayedPerform + 441
25 CoreFoundation 0x02558d43 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
26 CoreFoundation 0x0255a384 __CFRunLoopDoTimer + 1364
27 CoreFoundation 0x024b6d09 __CFRunLoopRun + 1817
28 CoreFoundation 0x024b6280 CFRunLoopRunSpecific + 208
29 CoreFoundation 0x024b61a1 CFRunLoopRunInMode + 97
30 GraphicsServices 0x02ddc2c8 GSEventRunModal + 217
31 GraphicsServices 0x02ddc38d GSEventRun + 115
32 UIKit 0x002d9b58 UIApplicationMain + 1160
33 JamsApp 0x00001c0c main + 102
34 JamsApp 0x00001b9d start + 53
)
terminate called after throwing an instance of 'NSException'
I'd say check your nib to see if you have a connection to name, where name doesn't exist, but in suspect it would crash the first time too. Recheck everywhere you define name.
Ok, so I fixed it myself.
I am not completely sure what was going on, but it's seems to me that a field that was there originally and then removed, seemed to be in the core data somewhere?
Anyway, the fix for me was to remove all the core data files and managed object files and delete the instance of the app in the sim, and start again.
It took minutes to do and solved the problem - now jam can flow happily again!
I would have rather solved the problem, however time is in short supply and I already spent too many hours looking at it!