Accessing data from core data when in location background mode - iphone

I have a app that get launched in the background mode by location region service , I would like to then display a local notification but I need to access core-data to get info for the notification and to query weather it should show the notification. every thing works but the query wont return any data when in the background , If it is not possible to access core-data at that time is there any other way I can store my data so I can read it while running in the background.
I did get this sort of working I think it is more of a issue with xcode 4.2 which is giving me issues I could access the core data file from the background mode only if I run the app from xcode then after I quit running I must open the app on the phone or simulator by clicking the app icon not the run button in xcode then close the app then the next time a run the app on the phone or sim by clicking the app icon not the run button in xcode then the application will access the core-data database. but local notification now wont work on the simulator unless I run form xcode which will then stop core-data access. I guess Im stuck with not being able to build this app till xcode 4.2 is at standard of xcode 3 where I could just get things to work.

Thanks for the comments I think Ive sorted it out , I did not have icloud on my iphone as its older one and I've been testing on simulator and thats is why Ive had this issue so if any one else has this problem the way to fix it is to start and stop your app in the simulator first as when you stop the app by clicking stop in xcode after running it kill the app the wrong way here is the log "9/02/12 12:46:52 PM Application '*App Name**' exited abnormally with signal 9: Killed SpringBoard[5273]" which then stops the app from accessing core data while in background , Ill send apple a bug report but I dont know if its something they want to fix . PS grate Site helpful thanks to anyone who answers Questions :)

Related

iPhone4: Application loses all data saved in CoreData on click home button

Am having a serious problem: my app runs perfectly on iphone 3GS, but having problems with iPhone4: when the user taps home button then reopen the app, all the data saved in database are vanished. I cant't explain what is happening, the app used to run fine on both devices (with different os), then when i did some changes on the entities of coreData, this problem occures: I tried to delete the XcDataModel and recreate it, the problem is the same. Any help please?
ps: I tested the app on a new iPhone 4 device (i didn't run on it any previous version of the app ) and I have the same problem
Did you make sure to -save: your NSManagedObjectContext when your application is going to resign its active state? This could be in -[UIApplicationDelegate applicationWillResignActive:] or in response to a UIApplicationWillResignActiveNotification.

iPhone application reset

I have a strange problem with my iPhone app.
I use geolocation and push notification. Everything is ok, but I want to test from scratch on the iPhone (connected to xcode debugger)... and I can't re initialized the iPhone.
I explain: I remove the app from the iPhone, and after re-installing the app (with xcode or with iTunes), I launch the app, but iOS doesn't ask me to approve geolocation and push notification as it does the first time. In fact, it seems to 'remember' my choices.
As I need to debug this (Some users have problem on running app the first time), I'm blocked.
Thanks by advance for yours answers
There's a place in the Settings app to reset Location permissions.

Application crashes after installing iOS 4.2

I recently installed iOS 4.2 for my iPod after then my application started to crash.
The scenario is: I launch my application wait until it's up and running then hit the iPod home button then launch my application again, my application starts again for seconds then crashes.
my application is a job search engine, so in all of its navigation pages it's communicating with internet server.
I think the problem has to do with applicationDidEnterBackground, applicationWillEnterForeground, or applicationDidBecomeActive methods. I do not have an code in these methods and I do not know if I need to, to prevent the crash.
I do not understand what happens after I hit the home button and my application goes to the background:
will it still be running in the background (because of the multithreading thing in iOS4.2).
Sometimes when I relaunch my application it goes to last page I left in before hitting the home button and sometime it starts from the home page.
I do not understand what's going on, I just want it every time it starts to start in the home page.
I was just about to submit my application to the Apple Store just before I updated to iOS4.2 and the crash starts to happen. I'd really appreciate if someone can help me with this issue that I'm not even able/or know how to debug.
Thanks a lot in advance.
Regards,
You can set the Info.plist key ApplicationDoesNotRunOnBackground to make sure the app is completely terminated.
Xcode / Organizer will show your device crash logs.
Xcode -> COMMAND+CONTROL+O -> Device Logs or you (making sure the device is connected) can select the iPod from the list of devices, then choose Device Logs.
You don't need to have any code in the applicationDidEnterBackground, applicationWillEnterForeground, or applicationDidBecomeActive delegates, so that's not making your app crash.
I would definitely check out some of those logs in Organizer. Maybe post some of them here, or pastie.org

Problem with app on device

When I run my app with simulator every thing is ok.also when i run it on device (ipod touch 3G) for the first time,i have no problem but if i close my app and run it again,it hangs(no button working & just i can uninstall it) and if i try to minimize it ios seems out of action(every thing is being black)
how can i solve this problem ?
Run your application in the simulator with the profiling tools, making sure you check for allocations / releases and if there are any network resources left open.
You haven't said anything about what your app does to give any more help than that, but the development tools will tell you what is going on.
Also when you connect to the iPod, check the crash reports to see what happened
have u release any object in appWillTerminate. may be u trying to release object that is already released before the application quit. or u can see the application quit status in nslog if status is not 0 means application is not quitting properly.

App crashed on app store, not in local version

I ran into a horrifying bug when my app went live. It crashes in a spot where it had been fine.
download from app store using complimentary review code
start app
press start button
CRASH
NOTE: crash reoccurs at every app startup until phone is rebooted - then it disappears
When I try to replicate without the app store
start app
press start button
everything is good.
....
I immediately pulled the app from sale. Right now, I can't replicate at all because I can't download the app.
How to debug?
Download the app from the store onto your device.
Gather the crash reports off of the device manually (
Run them through symbolicatecrash (you did keep the dsym's right?)
Find error, rinse and repeat.