简体   繁体   中英

Accessing data from core data when in location background mode

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 :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM