exception while trying to save CoreData - iphone

NSError *error;
if (managedObjectContext != nil) {
if ([managedObjectContext hasChanges] && ![managedObjectContext save:&error]) {
DLog(#"Unresolved error %#, %#", error, [error userInfo]);
abort();
}
}
while saving some items with the above code in CoreDate i get the following exception. the managedObjectContext has 50 unresolved deletes and 700 unresolved insertions. obviously its having a problem with the deletes. any ideas on how to track it down?
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSSet0 removeObject:]: unrecognized selector sent to instance 0x61a4840'
*** Call stack at first throw:
(
0 CoreFoundation 0x018d45a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x01a28313 objc_exception_throw + 44
2 CoreFoundation 0x018d60bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x01845966 ___forwarding___ + 966
4 CoreFoundation 0x01845522 _CF_forwarding_prep_0 + 50
5 CoreData 0x00ffa31d -[NSManagedObject(_NSInternalMethods) _excludeObject:fromPropertyWithKey:andIndex:] + 397
6 CoreData 0x00fef7d1 -[NSManagedObject(_NSInternalMethods) _maintainInverseRelationship:forProperty:oldDestination:newDestination:] + 449
7 CoreData 0x01043b55 -[NSManagedObject(_NSInternalMethods) _propagateDelete:] + 1541
8 CoreData 0x00ffa02a -[NSManagedObject(_NSInternalMethods) _propagateDelete] + 42
9 CoreData 0x00ff9e53 -[NSManagedObjectContext(_NSInternalChangeProcessing) _propagateDeletesUsingTable:] + 515
10 CoreData 0x00ff9c12 -[NSManagedObjectContext(_NSInternalChangeProcessing) _processDeletedObjects:] + 146
11 CoreData 0x00fecba8 -[NSManagedObjectContext(_NSInternalChangeProcessing) _propagatePendingDeletesAtEndOfEvent:] + 104
12 CoreData 0x00fb8982 -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:] + 754
13 CoreData 0x00ff2715 -[NSManagedObjectContext save:] + 149
14 Ace Metrix iPad 0x00075153 +[CoreDataHelper saveCoreDate:] + 82
15 Ace Metrix iPad 0x0007a790 -[WSBreakingAds platformRequestFinishedWhidType:withResponse:] + 772
16 Ace Metrix iPad 0x00077c6d -[PlatformContainer operation:completedWithResponse:withNSManagedObjectContext:] + 1042
17 Ace Metrix iPad 0x000401ec -[WebServiceAuthServiceSoapBinding_getPartialAdvertisementsAfterDate connectionDidFinishLoading:] + 1209
18 Foundation 0x00182112 -[NSURLConnection(NSURLConnectionReallyInternal) sendDidFinishLoading] + 108
19 Foundation 0x0018206b _NSURLConnectionDidFinishLoading + 133
20 CFNetwork 0x00dec492 _ZN19URLConnectionClient23_clientDidFinishLoadingEPNS_26ClientConnectionEventQueueE + 220
21 CFNetwork 0x00eb76e1 _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 293
22 CFNetwork 0x00de2c84 _ZN19URLConnectionClient13processEventsEv + 100
23 CFNetwork 0x00de2ad3 _ZN17MultiplexerSource7performEv + 251
24 CoreFoundation 0x018b58ff __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
25 CoreFoundation 0x0181388b __CFRunLoopDoSources0 + 571
26 CoreFoundation 0x01812d86 __CFRunLoopRun + 470
27 CoreFoundation 0x01812840 CFRunLoopRunSpecific + 208
28 CoreFoundation 0x01812761 CFRunLoopRunInMode + 97
29 GraphicsServices 0x01e3e1c4 GSEventRunModal + 217
30 GraphicsServices 0x01e3e289 GSEventRun + 115
31 UIKit 0x003eec93 UIApplicationMain + 1160
32 Ace Metrix iPad 0x00002814 main + 102
33 Ace Metrix iPad 0x000027a5 start + 53
)
terminate called after throwing an instance of 'NSException'

You are calling removeObject: on an immutable instance of NSSet. Make sure that the set you work with is an instance of NSMutableSet. It might help us if you could post the code where you actually perform the deletes.

Related

Core Data sync with CouchBase using CBLIncrementalStore crashing

I am using Core Data in my project and now I wanted to add sync features. Rolling my own turned out to be harder than I thought; therefore, I wanted to try ready libraries.
I integrated Couchbase in the project, setup IBM Cloudant for sync gateway and server.
For a very simple project I tested it and everything seems to be working fine. However, when I implement the same solution to the existing project; it crashes sometimes and I don't have the slightest clue how to approach the problem.
p.s. Info if it makes a difference: I had hell of a time with the model update in CBLIncrementStore as the core data kept complaining that it can't modify an immutable model; event though it was not used or attached to persistent store. In the end I had to create a new project, modified the model, and copy the model to my existing project. Then it started working. Even below code, where returning an mutableCopy of the model; didn't work (event though it worked perfectly in an empty project):
EDIT - Normally, no need to return mutableCopy this is something I tried in my particular case. Explained above^^
// MARK: - MODEL
lazy var modelURL: URL = {
let bundle = Bundle.main
if let url = bundle.url(forResource: "couchsync", withExtension: "momd") {
return url
}
DLog("CRITICAL - Managed Object Model file not found")
abort()
}()
lazy var model: NSManagedObjectModel = {
if let mutableModel = NSManagedObjectModel(contentsOf: self.modelURL)?.mutableCopy() as? NSManagedObjectModel {
return mutableModel
}
DLog("CRITICAL - Can't read model")
abort()
}()
The code crashes below in CBLIncrementalStore:
- (NSIncrementalStoreNode*) newValuesForObjectWithID: (NSManagedObjectID*)objectID
withContext: (NSManagedObjectContext*)context
error: (NSError**)outError {
And the debug output is as follows (CDStack.swift is from my project):
[00324]:CDStack.swift :save.......................... :16:15:14 Inserted objects count = 33
2017-04-11 16:15:14.132 MuhApp[23391:1022666] -[__NSCFNumber _fastCStringContents:]: unrecognized selector sent to instance 0xb000000000000001
2017-04-11 16:15:14.142 MuhApp[23391:1022666] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber _fastCStringContents:]: unrecognized selector sent to instance 0xb000000000000001'
*** First throw call stack:
(
0 CoreFoundation 0x000000010c6e3b0b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010bba0141 objc_exception_throw + 48
2 CoreFoundation 0x000000010c753134 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x000000010c66a840 ___forwarding___ + 1024
4 CoreFoundation 0x000000010c66a3b8 _CF_forwarding_prep_0 + 120
5 CoreData 0x000000010c1e9cfd _PFRawFastIndexForKnownKey + 93
6 CoreData 0x000000010c1e9bfe _PFRawIndexForKnownKey + 62
7 CoreData 0x000000010c1ea49c -[NSKnownKeysDictionary1 objectForKey:] + 28
8 MuhApp 0x000000010a184639 __66-[CBLIncrementalStore newValuesForObjectWithID:withContext:error:]_block_invoke_2 + 121
9 CoreData 0x000000010c239b52 developerSubmittedBlockToNSManagedObjectContextPerform + 178
10 CoreData 0x000000010c239a1f -[NSManagedObjectContext performBlockAndWait:] + 239
11 MuhApp 0x000000010a18449e __66-[CBLIncrementalStore newValuesForObjectWithID:withContext:error:]_block_invoke + 670
12 libdispatch.dylib 0x000000011351405c _dispatch_client_callout + 8
13 libdispatch.dylib 0x00000001134f1de6 _dispatch_barrier_sync_f_invoke + 346
14 MuhApp 0x000000010a184033 -[CBLIncrementalStore newValuesForObjectWithID:withContext:error:] + 403
15 CoreData 0x000000010c2ea624 __95-[NSPersistentStoreCoordinator(_NSInternalMethods) newValuesForObjectWithID:withContext:error:]_block_invoke + 100
16 CoreData 0x000000010c2f32f4 gutsOfBlockToNSPersistentStoreCoordinatorPerform + 196
17 libdispatch.dylib 0x000000011351405c _dispatch_client_callout + 8
18 libdispatch.dylib 0x00000001134f1de6 _dispatch_barrier_sync_f_invoke + 346
19 CoreData 0x000000010c2e0785 _perform + 213
20 CoreData 0x000000010c2e0505 -[NSPersistentStoreCoordinator _routeLightweightBlock:toStore:] + 229
21 CoreData 0x000000010c211d01 -[NSPersistentStoreCoordinator(_NSInternalMethods) newValuesForObjectWithID:withContext:error:] + 417
22 CoreData 0x000000010c211218 _PFFaultHandlerLookupRow + 376
23 CoreData 0x000000010c210c9f _PF_FulfillDeferredFault + 239
24 CoreData 0x000000010c2341e2 -[NSManagedObject(_NSInternalMethods) _includeObject:intoPropertyWithKey:andIndex:] + 130
25 CoreData 0x000000010c2339c0 -[NSManagedObject(_NSInternalMethods) _didChangeValue:forRelationship:named:withInverse:] + 576
26 Foundation 0x000000010b6a96dc NSKeyValueNotifyObserver + 351
27 Foundation 0x000000010b6a8f93 NSKeyValueDidChange + 484
28 Foundation 0x000000010b679709 -[NSObject(NSKeyValueObserverNotification) didChangeValueForKey:] + 111
29 CoreData 0x000000010c21c40d -[NSManagedObject didChangeValueForKey:] + 93
30 CoreData 0x000000010c2a773f -[NSManagedObject(_NSInternalMethods) _updateFromRefreshSnapshot:includingTransients:] + 799
31 CoreData 0x000000010c23fe54 -[NSManagedObjectContext(_NestedContextSupport) _copyChildObject:toParentObject:fromChildContext:] + 948
32 CoreData 0x000000010c23f413 -[NSManagedObjectContext(_NestedContextSupport) _parentProcessSaveRequest:inContext:error:] + 947
33 CoreData 0x000000010c2ba927 __82-[NSManagedObjectContext(_NestedContextSupport) executeRequest:withContext:error:]_block_invoke + 567
34 CoreData 0x000000010c23a0ea internalBlockToNSManagedObjectContextPerform + 106
35 libdispatch.dylib 0x000000011351405c _dispatch_client_callout + 8
36 libdispatch.dylib 0x00000001134f1de6 _dispatch_barrier_sync_f_invoke + 346
37 CoreData 0x000000010c23a054 _perform + 244
38 CoreData 0x000000010c239e7d -[NSManagedObjectContext(_NestedContextSupport) executeRequest:withContext:error:] + 301
39 CoreData 0x000000010c221488 -[NSManagedObjectContext save:] + 3368
40 MuhApp 0x000000010a215522 _TFZFC6MuhApp7CDStack4saveFCSo22NSManagedObjectContextT_U_FT_T_ + 610
41 MuhApp 0x000000010a1a0927 _TTRXFo___XFdCb___ + 39
42 CoreData 0x000000010c239b52 developerSubmittedBlockToNSManagedObjectContextPerform + 178
43 CoreData 0x000000010c239a1f -[NSManagedObjectContext performBlockAndWait:] + 239
44 MuhApp 0x000000010a21529b _TZFC6MuhApp7CDStack4savefCSo22NSManagedObjectContextT_ + 187
45 MuhApp 0x000000010a1ded49 _TFC6MuhApp7MUStoreP33_5810EFAD2D482DA23D84CA4C96F2558221createbusinessFoldersfT_GSaCS_9MUAccount_ + 11145
46 MuhApp 0x000000010a1db875 _TFC6MuhApp7MUStoreP33_5810EFAD2D482DA23D84CA4C96F2558228fetchOrCreateBusinessFoldersfT_GSaCS_9MUAccount_ + 133
47 MuhApp 0x000000010a1d4e78 _TFC6MuhApp7MUStoreg15businessFoldersGSaCS_9MUAccount_ + 120
48 MuhApp 0x000000010a236fa0 _TFC6MuhApp23MainTableViewController7preparefT3forCSo17UIStoryboardSegue6senderGSqP___T_ + 1088
49 MuhApp 0x000000010a2380fb _TToFC6MuhApp23MainTableViewController7preparefT3forCSo17UIStoryboardSegue6senderGSqP___T_ + 187
50 UIKit 0x000000010dc158ee -[UIStoryboardSegueTemplate _performWithDestinationViewController:sender:] + 353
51 UIKit 0x000000010dc1575c -[UIStoryboardSegueTemplate _perform:] + 82
52 UIKit 0x000000010dc15a1f -[UIStoryboardSegueTemplate perform:] + 157
53 UIKit 0x000000010d5a4d77 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1677
54 UIKit 0x000000010d5a4fe3 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 344
55 UIKit 0x000000010d45a7f3 _runAfterCACommitDeferredBlocks + 318
56 UIKit 0x000000010d4477bc _cleanUpAfterCAFlushAndRunDeferredBlocks + 532
57 UIKit 0x000000010d47928c _afterCACommitHandler + 137
58 CoreFoundation 0x000000010c689717 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
59 CoreFoundation 0x000000010c689687 __CFRunLoopDoObservers + 391
60 CoreFoundation 0x000000010c66e720 __CFRunLoopRun + 1200
61 CoreFoundation 0x000000010c66e016 CFRunLoopRunSpecific + 406
62 GraphicsServices 0x0000000110359a24 GSEventRunModal + 62
63 UIKit 0x000000010d44e0d4 UIApplicationMain + 159
64 MuhApp 0x000000010a2a9da7 main + 55
65 libdyld.dylib 0x000000011356065d start + 1
66 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Any ideas how to proceed from here?

ios core data NSFetchedResultsControllerDelegate crash

I am keep getting this error for NSFetchedResultsControllerDelegate.
not sure what to do with it, since it happen sporadically.
I do create the records synchronized, but still ..
any ideas why could this be?
- (Activity *)createActivityWithDictionary:(NSDictionary*)dict
{
#synchronized([DBController sharedManaged])
{
Activity *act = [Activity activityWithDictionary:dict inManagedObjectContext:self.managedObjectContext];
[self saveContext];
return act;
}
}
Date/Time: 2012-09-18 22:55:53.686 -0700
OS Version: iPhone OS 5.1.1 (9B206)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x3724188f __exceptionPreprocess + 163
1 libobjc.A.dylib 0x34f46259 objc_exception_throw + 33
2 CoreFoundation 0x37244a9b -[NSObject doesNotRecognizeSelector:] + 175
3 CoreFoundation 0x37243915 ___forwarding___ + 301
4 CoreFoundation 0x3719e650 _CF_forwarding_prep_0 + 48
5 CoreData 0x36a78f4d -[NSFetchedResultsController(PrivateMethods) _managedObjectContextDidChange:] + 2401
6 Foundation 0x37aa64ff __57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_0 + 19
7 CoreFoundation 0x3720d547 ___CFXNotificationPost_block_invoke_0 + 71
8 CoreFoundation 0x37199097 _CFXNotificationPost + 1407
9 Foundation 0x37a1a3eb -[NSNotificationCenter postNotificationName:object:userInfo:] + 67
10 CoreData 0x36a00839 -[NSManagedObjectContext(_NSInternalNotificationHandling) _postObjectsDidChangeNotificationWithUserInfo:] + 77
11 CoreData 0x36a0031d -[NSManagedObjectContext(_NSInternalChangeProcessing) _createAndPostChangeNotification:withDeletions:withUpdates:withRefreshes:] + 305
12 CoreData 0x36a09d01 -[NSManagedObjectContext(_NSInternalChangeProcessing) _processRecentChanges:] + 1245
13 CoreData 0x369fd145 -[NSManagedObjectContext save:] + 201
14 PalFinds 0x000a57cb -[DBController saveContext] (DBController.m:75)
15 PalFinds 0x000a8dff -[DBController createActivityWithDictionaries:] (DBController.m:852)
16 PalFinds 0x00086649 -[PFMe finishRequest:andRestConnection:] (PFMe.m:1986)
17 PalFinds 0x0002e17d -[RestConnection connectionDidFinishLoading:] (RestConnection.m:326)
18 Foundation 0x37addc29 __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke_0 + 17
19 Foundation 0x37a356d9 -[NSURLConnectionInternalConnection invokeForDelegate:] + 29
20 Foundation 0x37a356a3 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 199
21 Foundation 0x37a355c5 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 61
22 CFNetwork 0x36ed97f5 URLConnectionClient::_clientDidFinishLoading(URLConnectionClient::ClientConnectionEventQueue*) + 193
23 CFNetwork 0x36ece4a5 URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent, XClientEventParams>*, long) + 425
24 CFNetwork 0x36ece599 URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent, XClientEventParams>*, long) + 669
25 CFNetwork 0x36ece599 URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent, XClientEventParams>*, long) + 669
26 CFNetwork 0x36ece1a3 URLConnectionClient::processEvents() + 107
27 CFNetwork 0x36ece0d9 MultiplexerSource::perform() + 157
28 CoreFoundation 0x37215ad3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
29 CoreFoundation 0x3721529f __CFRunLoopDoSources0 + 215
30 CoreFoundation 0x37214045 __CFRunLoopRun + 653
31 CoreFoundation 0x371974a5 CFRunLoopRunSpecific + 301
32 CoreFoundation 0x3719736d CFRunLoopRunInMode + 105
33 GraphicsServices 0x33956439 GSEventRunModal + 137
34 UIKit 0x30f43cd5 UIApplicationMain + 1081
35 PalFinds 0x000038bf main (main.mm:14)
36 PalFinds 0x00003878 start + 40
Looks like it's trying to call the delegate back and the delegate isn't implementing a method it's supposed to.
I'm thinking either controller:didChangeObject:atIndexPath:forChangeType:newIndexPath: or controllerDidChangeContent:
Did you implement those methods in your NSFetchedResultsControllerDelegate?
I know this might seem far fetched BUT I had a very similar problem and I had all those methods implemented and then I realized I had my release commented out for the fetchedREsultsController...once I put that back in no more sigbart and works like a charm.
All I'm saying is that sometimes the error isn't always the obvious.
We would need to see a bit more code to figure it out. Thanks.

App Crash While hitting web Services

I have a table view in which Iam selecting a row of the table view and then it hits the web services, retrieves data and then displayed. Now this is my error log Iam getting.
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-
[__NSCFData setDownloadedLogoImage:]: unrecognized selector sent to instance 0x806cf90'
*** Call stack at first throw:
(
0 CoreFoundation 0x02abdb99 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x02c0d40e objc_exception_throw + 47
2 CoreFoundation 0x02abf6ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x02a2f2b6 ___forwarding___ + 966
4 CoreFoundation 0x02a2ee72 _CF_forwarding_prep_0 + 50
5 FlightSearch 0x000401ef -[AirlineNames connectionDidFinishImage:] + 168
6 FlightSearch 0x0002f535 -[SAHttpManager connectionDidFinishLoading:] + 195
7 Foundation 0x001acb96 -[NSURLConnection(NSURLConnectionReallyInternal) sendDidFinishLoading] + 108
8 Foundation 0x001acaef _NSURLConnectionDidFinishLoading + 133
9 CFNetwork 0x0307172f _ZN19URLConnectionClient23_clientDidFinishLoadingEPNS_26ClientConnectionEventQueueE + 285
10 CFNetwork 0x0313cfcf _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 389
11 CFNetwork 0x03066968 _ZN19URLConnectionClient13processEventsEv + 100
12 CFNetwork 0x030667e5 _ZN17MultiplexerSource7performEv + 251
13 CoreFoundation 0x02a9efaf __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
14 CoreFoundation 0x029fd39b __CFRunLoopDoSources0 + 571
15 CoreFoundation 0x029fc896 __CFRunLoopRun + 470
16 CoreFoundation 0x029fc350 CFRunLoopRunSpecific + 208
17 CoreFoundation 0x029fc271 CFRunLoopRunInMode + 97
18 GraphicsServices 0x032b000c GSEventRunModal + 217
19 GraphicsServices 0x032b00d1 GSEventRun + 115
20 UIKit 0x00419af2 UIApplicationMain + 1160
21 FlightSearch 0x00001e86 main + 84
22 FlightSearch 0x00001e29 start + 53
23 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
Kindly suggest me what should i do.
You're sending the message setDownloadedLogoImage: to an NSData object, which has no idea what to do with it! One of two things has happened:
1) You have not retained something. Take a look at whatever object you expect to call setDownloadedLogoImage on and find out where you create it - you should probably be retaining it there ;)
2) (less likely) Your code is just wrong! Add it to your question and we can take a look.

Core Data save exception

I got very weird issue with managedObjectContext:save. It hasn't happened at the first time I save the context, it only happens at some point of my program. Could you help me to know why it happened and where should I should find a bug in my code? Thanks.
Here is the log:
-[NSCFNumber UTF8String]: unrecognized selector sent to instance 0x5a64110
2011-05-19 16:02:43.235 DMC to Go[98212:40b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFNumber UTF8String]: unrecognized selector sent to instance 0x5a64110'
*** Call stack at first throw:
(
0 CoreFoundation 0x015d85a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x0172c313 objc_exception_throw + 44
2 CoreFoundation 0x015da0bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x01549966 ___forwarding___ + 966
4 CoreFoundation 0x01549522 _CF_forwarding_prep_0 + 50
5 CoreData 0x002f870f -[NSSQLiteConnection execute] + 1231
6 CoreData 0x0034aebd -[NSSQLiteConnection updateRow:] + 365
7 CoreData 0x00349e64 -[NSSQLConnection performAdapterOperations:] + 180
8 CoreData 0x00349b0e -[NSSQLCore _performChangesWithAdapterOps:] + 494
9 CoreData 0x003485ea -[NSSQLCore performChanges] + 410
10 CoreData 0x00342038 -[NSSQLCore saveChanges:] + 216
11 CoreData 0x00300199 -[NSSQLCore executeRequest:withContext:error:] + 409
12 CoreData 0x003b070b -[NSPersistentStoreCoordinator executeRequest:withContext:error:] + 3691
13 CoreData 0x00338948 -[NSManagedObjectContext save:] + 712
14 DMC to Go 0x0000313b -[dmcIpadAppDelegate saveManagedObjectChanges] + 107
15 DMC to Go 0x00020dc5 +[DmcIpadAppDelegate saveManagedObjectChanges] + 117
16 DMC to Go 0x00027883 -[DownloadFileService observeValueForKeyPath:ofObject:change:context:] + 867
17 Foundation 0x00fae1e4 NSKeyValueNotifyObserver + 361
18 Foundation 0x00fadca6 NSKeyValueDidChange + 384
19 Foundation 0x00f943e2 -[NSObject(NSKeyValueObserverNotification) didChangeValueForKey:] + 123
20 DMC to Go 0x0002c674 -[DownloadManager connectionDidFinishLoading:] + 836
21 Foundation 0x00fd4112 -[NSURLConnection(NSURLConnectionReallyInternal) sendDidFinishLoading] + 108
22 Foundation 0x00fd406b _NSURLConnectionDidFinishLoading + 133
23 CFNetwork 0x01dd948e _ZN19URLConnectionClient23_clientDidFinishLoadingEPNS_26ClientConnectionEventQueueE + 220
24 CFNetwork 0x01ea46e1 _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl + 293
25 CFNetwork 0x01dcfc80 _ZN19URLConnectionClient13processEventsEv + 100
26 CFNetwork 0x01dcfacf _ZN17MultiplexerSource7performEv + 251
27 CoreFoundation 0x015b98ff __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
28 CoreFoundation 0x0151788b __CFRunLoopDoSources0 + 571
29 CoreFoundation 0x01516d86 __CFRunLoopRun + 470
30 CoreFoundation 0x01516840 CFRunLoopRunSpecific + 208
31 CoreFoundation 0x01516761 CFRunLoopRunInMode + 97
32 GraphicsServices 0x0202a1c4 GSEventRunModal + 217
33 GraphicsServices 0x0202a289 GSEventRun + 115
34 UIKit 0x00838c93 UIApplicationMain + 1160
35 DMC to Go 0x00001f59 main + 121
36 DMC to Go 0x00001ed5 start + 53
37 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
Current language: auto; currently objective-c
Make sure you have no warnings
Put breakpoints in your code where you think you are setting an NSString on your object
And/Or NSLog %# the class of NSString properties of your core data objects and make sure it is some variation of an NSString. (NSLog(#"%#", [obj.property class]);)
What is happening is something that you are saving has an NSNumber object in place of an NSString. Since NSNumber does not respond to UTF8String your application is crashing.

iphone app crash

I am getting an error while running app with following exception.
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<FavoriteViewController 0x158d30> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key customCell.'
*** Call stack at first throw:
(
0 CoreFoundation 0x314d0987 __exceptionPreprocess + 114
1 libobjc.A.dylib 0x319a149d objc_exception_throw + 24
2 CoreFoundation 0x314d0705 -[NSException dealloc] + 0
3 Foundation 0x31d28b4f -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 182
4 Foundation 0x31d2803b _NSSetUsingKeyValueSetter + 90
5 Foundation 0x31d29da3 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 194
6 Foundation 0x31cdbb17 -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 130
7 UIKit 0x33a8860f -[UIRuntimeOutletConnection connect] + 66
8 CoreFoundation 0x31473fc7 -[NSObject(NSObject) performSelector:] + 18
9 CoreFoundation 0x3147cd51 -[NSArray makeObjectsPerformSelector:] + 388
10 UIKit 0x33a87577 -[UINib instantiateWithOwner:options:] + 586
11 UIKit 0x33a88b39 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 92
12 Fridge 0x0001ab11 -[FavoriteViewController tableView:cellForRowAtIndexPath:] + 192
13 UIKit 0x33907a21 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 516
14 UIKit 0x339077f3 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 34
15 UIKit 0x33905d2d -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 936
16 UIKit 0x33904edd -[UITableView layoutSubviews] + 140
17 UIKit 0x338b10cf -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 26
18 CoreFoundation 0x3146ebbf -[NSObject(NSObject) performSelector:withObject:] + 22
19 QuartzCore 0x30a6c685 -[CALayer layoutSublayers] + 120
20 QuartzCore 0x30a6c43d CALayerLayoutIfNeeded + 184
21 QuartzCore 0x30a6656d _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 212
22 QuartzCore 0x30a66383 _ZN2CA11Transaction6commitEv + 190
23 QuartzCore 0x30a89f9d _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 52
24 CoreFoundation 0x31460c59 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 16
25 CoreFoundation 0x31460acd __CFRunLoopDoObservers + 412
26 CoreFoundation 0x314580cb __CFRunLoopRun + 854
27 CoreFoundation 0x31457c87 CFRunLoopRunSpecific + 230
28 CoreFoundation 0x31457b8f CFRunLoopRunInMode + 58
29 GraphicsServices 0x35d664ab GSEventRunModal + 114
30 GraphicsServices 0x35d66557 GSEventRun + 62
31 UIKit 0x338d5329 -[UIApplication _run] + 412
32 UIKit 0x338d2e93 UIApplicationMain + 670
33 Fridge 0x00002d77 main + 70
34 Fridge 0x00002d2c start + 40
)
The error message: Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key customCell.'
... means that your xib is referencing an IBOutlet named "customCell" but your view controller doesn't have that IBOutlet anymore. You either need to remove the customCell reference from your xib or add an IBOutlet property to your view controller named "customCell".