Monday, 15 February 2010

iphone - WatchKit extension doesn't see updates to NSUserDefaults for App Group -


I have seen some questions on this, and have tried all the given answers, and it still does not work Is me

I am trying to share many small statistics (strings and balls) between my iPhone app and its watchkit extension. (If it makes a difference, then the information is being read by the Glance Controller of the WK App)

Through the developer site, I have created an app group (Group.com..Scaucers-Apprentice) . If I look at 'App ID', then two identical IDs appear for one (com.theYawns.Sorcerers-Apprentice.watchkitextension) for my app (com.theYawns.Sorcerers-Apprentice). Each of them has the 'app group' enabled (for both development and distribution) and app groups selected if I edit app id.

I've turned on 'App Groups' in the capabilities for both app and extension. One concern is that from time to time - every build is not built on several days - if I go in and look at the capabilities tab, then I have a red exclamation point that states that 'Add Ape Group' entitlement to your entitlement file. If I see the entitlement file, then the entitlement happens, and if I click on the 'Fix Issue', then the red exclamation The insertion point turns into a checkmark, but the fact is that I should be worried many times per day. I have some worries.

I've refreshed my provisioning profile several times under XCode preferences, and I do not see app group icon under entitlement, if I hover, I look at the app groups in the tooltip which Pops up.

In both my app and extension, I get a reference of the user default through

  NSUserDefaults. ShareAppDefaults = [[NSUserDefaults alloc] initWithSuiteName: @ "group.com. TheYawns.Sorcerers- Apprentice"];  

I tried to add a [sharedAppDefaults synchonize] after every writing and reading my watchkit, just in case things are not being trapped is . (No difference).

My watchkit extension bundle ID is different from my iPhone app bundle ID, which I have seen on a different thread.

I have also added an NSTimer to refresh the look in every 10 seconds, so if there is a time issue with choosing changes, then I hope this update cycle or two Resolve yourself later, but it is not.

Actually stumped ... it seems that the issue of other people has been solved with the answers to other sources, but no one is working for me.

:

OK, I got an answer in the Apple Developer Forum.

This XCode appeared from the Target 'Abilities' tab, that I have all the correct entitlement sets and I can see the 'Entitlements' file in my project, open it, and see that it Was set correctly.

But - If I saw no entitlement file in the 'Code Signing' section under the 'Build Settings' tab of my app target, (These are shown correctly for all the watchkit extensions, but not for the main iPhone app).

When I plugged in the name of my entitlement file under code signing, everything worked out.

This sounds like a bug - I do not believe that the 'Buildings' tab of the 'Ability' tab and the same goal should always appear at different places for Entertainment. But to answer that which works for me, in that case anyone else is also involved in this matter.

Summary: Make sure that entitlements are correct, you must set up switches properly in the capabilities, and you see the referenced entitlement file under the build settings / code signing.


No comments:

Post a Comment