Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-09-2011, 11:29 AM   #1 (permalink)
Token farm animal
 
sneaky's Avatar
 
Join Date: Apr 2011
Posts: 321
sneaky is on a distinguished road
Default Core Data & iOS5

Just running the final tests on an app now and I've just started testing on iOS5.
I have been tweaking the Core Data performance all week under iOS4.3 and I've got it to a really sweet state now. So I'm pretty happy that my implementation is pretty good and solid at this stage.

Just started testing on iOS5 and the app is, not crashing but hanging, right left and center. I pause and it's almost always sitting on a ..execurefetchrequest. It never completes but is just hung.

I have several crashes as well. They are happening at different points for different reasons. As in the app can crash at the same spot 5 times and give 3-4 different reasons for it!

Also, trying to insert rows using a fetched results controller throws this:
Code:
CoreData: error: Serious application error.  An exception was caught from the delegate of NSFetchedResultsController during a call to -controllerDidChangeContent:.  Invalid update: invalid number of rows in section 0.  The number of rows contained in an existing section after the update (1) must be equal to the number of rows contained in that section before the update (0), plus or minus the number of rows inserted or deleted from that section (0 inserted, 0 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out). with userInfo (null)
This seems like a pretty fluffy request for help I do agree but this isn't confined to a single block of code or anything, everywhere throughout the app the app is either hanging or crashing on Core Data operations that worked really well on iOS4. Have anyone seen anything like this by any chance when upgrading from 4-5?
sneaky is offline   Reply With Quote
Old 12-09-2011, 02:00 PM   #2 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Well, it says 0 inserted, 0 deleted. That's curious. How are you inserting the rows?
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 12-10-2011, 04:11 AM   #3 (permalink)
Token farm animal
 
sneaky's Avatar
 
Join Date: Apr 2011
Posts: 321
sneaky is on a distinguished road
Default

Everything Core Data is being done in a singleton, all inserts of this type of data just use the one managedobjectcontext.

I tried to insert a bit of data in an init method of my singleton, then as soon as the UI load it calls for the data and the application deadlocks:
Code:
#0  0x94963876 in __psynch_mutexwait ()
#1  0x956dd6af in pthread_mutex_lock ()
#2  0x019f0c22 in -[_PFLock lock] ()
#3  0x019f0bfa in -[NSPersistentStoreCoordinator lock] ()
#4  0x01a08ed9 in -[NSPersistentStoreCoordinator executeRequest:withContext:error:] ()
#5  0x01a0706d in -[NSManagedObjectContext executeFetchRequest:error:] ()
   ...
I have been trying to init the managedobjectcontext with different concurrency types. This one here should mean that the context have the same behaviour as iOS4.
Code:
__managedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSConfinementConcurrencyType];
sneaky is offline   Reply With Quote
Old 12-10-2011, 11:30 AM   #4 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Why are you messing with concurrency?
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 12-10-2011, 01:02 PM   #5 (permalink)
Token farm animal
 
sneaky's Avatar
 
Join Date: Apr 2011
Posts: 321
sneaky is on a distinguished road
Default

I've half figured it out. I'm actually working in different threads. Wasn't a problem under ios4 but it is now. I'm creating a new managedobjectcontext for each now and it's working better.

There is still a good bit of odd behaviour but I'm getting through it.
sneaky is offline   Reply With Quote
Old 12-10-2011, 01:50 PM   #6 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

That's how you were supposed to do it all along, but my understanding is that iOS 5 is meaner about enforcing it.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 414
13 members and 401 guests
7twenty7, AppsBlogger, David-T, Duncan C, EvilElf, HemiMG, heshiming, iekei, LunarMoon, Murphy, sacha1996, Sami Gh, teebee74
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,127
Posts: 402,915
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:45 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0