[英]Can i get the data from userdefault in suspended mode in ios?
I am creating an application on beacon. 我正在信标上创建一个应用程序。 In beacon when the application in suspended mode that time also called
-(void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region
when i am entering particular region but i want is data from the NSUserDefaults
and set it to local notification. 在信标中,当我进入特定区域但我想要的是来自
NSUserDefaults
数据并将其设置为本地通知时,当应用程序处于挂起模式时,该时间也称为-(void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region
。 I have already set a data in to NSUserDefaults
when the application enter to region i want to get a data from the userdefault. 当应用程序进入我要从userdefault获取数据的区域时,我已经在
NSUserDefaults
设置了数据。
I have heard a similar report of this in a deleted answer to a question here: https://stackoverflow.com/a/34347464/1461050 . 我在以下问题的答案中已听到类似的报告: https : //stackoverflow.com/a/34347464/1461050 。 Since you probably cannot see that question, here is what the user reported:
由于您可能看不到该问题,因此用户报告了以下内容:
I have an extremely annoying bug in iOS: 1. Phone battery is done and it is recharge.
我在iOS中有一个非常烦人的错误:1.手机电池已完成,正在充电。 2. App is being waken in the background by a beacon detection (car beacon in our case).
2.正在通过信标检测(在我们的例子中是汽车信标)在后台唤醒应用程序。 3. AppDidFinishLaunchWithOptions is being called (as expected) 4. the NSUserDefault values at that time are null (it appears that it is related to the fact that NSUser defaults are under some kind of protection).
3.调用AppDidFinishLaunchWithOptions(按预期方式)4.当时的NSUserDefault值为null(这似乎与NSUser默认值受到某种保护这一事实有关)。
I have not reproduced this myself, but figured it is worth sharing that other folks have reported having trouble getting access to NSUserDefaults
in certain modes. 我没有
NSUserDefaults
复制此内容,但值得一提的是其他人报告在某些模式下无法访问NSUserDefaults
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.