Search code examples
iosobjective-cuicollectionviewxcode7cloudkit

Very weird issues with xcode 7 and cloudkit


I have an app using CloudKit. After upgrading to iOS 9 it continued to work as it did previously with no issues. However, a couple days ago, I upgraded from Xcode 6 to 7. Xcode 7 broke some things visually...alignments, collectionview cell edge insets were changed, etc...definitely annoying, but it's probably some autolayout issues I needed to fix anyway. The real issue is beyond anything I've ever seen before. All of the sudden, my CK data will not get returned unless I'm connected to wifi AND a power source. At first I thought it had to be connected to the laptop and running from Xcode to the device. I tested it by disconnecting from the laptop and plugging into the wall and CK data was returned and CV cells got rendered. And whether or not it's connected to a power source, if I'm on cellular connection I just get the spinner (data loading) and it just sits there. And if it's running from Xcode, I don't see any logging happening either. But if i switch to wifi even while the app is running, then I see the logging of the CK results returned followed by the custom cell views being trigged and finally the cells get rendered on the device.

Just to be clear, I didn't make any coding changes around this happening...just upgraded to Xcode 7 (not the GM version). I did notice the below difference in info.plist when comparing in source control.

xcode 7: CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER)

xcode 6: CFBundleIdentifier com.drivethruu.${PRODUCT_NAME:xxxxxxxxx}

I replaced the actual product name with the "xxxx..." just for this post in case it's something I shouldn't be showing publicly. I did use the xcode 6 value just to see if that was the issue and got the exact same behavior. Didn't make it worse, but didn't make it any better. Also, I've changed the deployment target to everything between iOS 7.1 - 9.0 and no differences.

Anyone experiencing anything like this? Any idea on how to solve this?

UPDATE: Downloaded Xcode 6.4, discarded changes in the storyboard and info.plist files and recompiled and all issues resolved, so it's definitely some issue with Xcode 7. Still running iOS 9...will need to find out why the issue is happening on with Xcode 7 since I'll need to have the app iOS 9 certified before submitting. May need to open a ticket with Apple.

Thank you!


Solution

  • Apple has changed the behavior of the qualityOfService setting and the way data is fetched. In my opinion this is a CloudKit bug. For more information see: iOS 9 CloudKit: query does not return anything while connected to cellular network

    Please also make a bug report of this at http://bugreport.apple.com