1
votes

I am writing iOS 8 keyboard app. This will be simple english keyboard app. I would like to user to able to set keyboard height within keyboard. But, I don't want to connect user setting with containing app. Because I definitely want user to ensure its safe so I am not plan to ask open access.

I read https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html#//apple_ref/doc/uid/TP40014214-CH21-SW1 and saw Extension Container

this image and it looks like if extension DOES NOT NEED to communicate with container app, it looks like you can save and read setting.

[[NSUserDefaults standardUserDefaults] setFloat:200 forKey:@"portraitHeight"];
[[NSUserDefaults standardUserDefaults] synchronize];

this worked within execution of container app, but if I load keyboard from springboard search, it crashes and doesn't show keyboard.

This ask about read data from containing appBut my question is if I can save/read only within extension.

1

1 Answers

1
votes

OH wait, I might find answer. I could read/write standard default within keyboard, not with container app. I just needed to stop app execution from Xcode and quit, and then start using keyboard from other application. So when debug process is attaching, you can not open from springboard or from other application I guess.

I am not sure this is relate with but sometimes, from springboard search, keyboard doesn't appear and display following error

OS_xpc_dictionary cannot obtain executable path for plug-in XXXXXXX(keyboard name)

this might not directly relate with [NSUserDefaults standardDefaults] read/write problem.