NSUserDefault with App Group is not working in iOS 8 Beta3

 ̄綄美尐妖づ 提交于 2019-12-01 20:36:19

A few probable solutions are:

  1. Your app group is not setup correctly, or you are not using the correct group identifier with initWithSuiteName:

  2. You have not enabled network access for your keyboard. This document states the following when you have network access disabled for your keyboard (default behavior):

    No shared container with containing app

  3. It's a bug.

Try using

[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"BlackKey"];

when you save and read it by using this code:

if([[NSUserDefaults standardUserDefaults] boolForKey:@"BlackKey"]) {
    NSLog(@"Black");
}

else
{
    NSLog(@"White");
}

or if you already done so, then it can be bug, and Xcode 6 beta versions also have other bugs so it's safer to try in Xcode 5 or older.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!