Post

Replies

Boosts

Views

Activity

NSUbiquitousKeyValueStore shared between Apple Watch and iPhone app
Hello, Ive found in watchOS 9 NSUbiquitousKeyValueStore is available and I'm wondering if using the same cloud kit container should the value be the same across devices. It currently works between Mac and iPhone apps, but not between Watch and iPhone. I have a switch on Apple Watch if #available(watchOS 9.0, *) { Toggle("Use iCloud", isOn: $dontUseiCloud) .onChange(of: dontUseiCloud) { value in changeiCloudSetting(value)              print("Toggle value = \(value)")              print("Dont use icloud =  \(NSUbiquitousKeyValueStore.default.bool(forKey: "dontUseICloud"))")           }      } }.onAppear(perform: {if #available(watchOS 9.0, *) {isiCloudOn()}}) and when I toggle the switch the Key-Value store changes correctly but only for the Watch. The switch on the iPhone app docent change, even if I wait up to 5 minutes. I have the same code in my iPhone app and Mac app and the switch change happens almost immediacy through iCloud on both devices. Thanks
1
0
1.3k
Sep ’22
Adding or using Note Field Access Entitlement
Hello, Ive ben having an issue with one of my Apps since Ventura came out. The app won't create a new contact It fails giving a few different warnings but no real error. I have tried it unto Ventura 13.0.1 (22A400) The error is 2022-12-03 09:33:54.543143+1000 **** [1941:15105] [api] Attempt to write notes by an unentitled app 2022-12-03 09:33:54.580714+1000 **** [1941:15105] [plugin] CDX_AB_GetGroupCollectionPath: nil group 2022-12-03 09:33:54.580765+1000  **** [1941:15105] [plugin] CDX_AB_GetGroupCollectionPath: nil group 2022-12-03 09:33:54.581969+1000 **** [1941:15105] [ABCDContact] An ABCDRecord is being saved without having a container assignment. Assigning the contact to <CNCDContainer 0x6000013c92c0 ab>. Please remember to assign contacts to containers to avoid recurring container lookup and contact re-validation costs. . When I follow the instructions on this page https://developer.apple.com/documentation/contacts to create a new contact It fails on Ventura to create a new contact and I don't know why. So I submitted a feedback Assistant request (FB11721907) But I also went ahead and got Notes field access as that was one of the warnings. That got approved, Now I would like help adding it in my project. I logged into the Developer Portal and in Identifiers, located my app and went to Additional Capabilities ticked the Box marked Contacts Notes Field Access. Then instructions in the email say 'Once you’ve finished generating the profile, you can use it in Xcode like any other manually-generated profile.' Im not sure what this means. I tried to add 'com.apple.developer.contacts.notes' Boolean, YES, to the entitlement file as described in https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_contacts_notes but the app doesn't launch when it's added. And if I put it into the info.plist file it does nothing. Also im not sure how to add the purpose string.
1
0
2.1k
Dec ’22
Mac Catalyst: Toolbar still appears below title bar, leaving empty safe area
Hi everyone, I’m testing my Catalyst SwiftUI project on iOS 26 / iPadOS 26 / macOS 26. I started with a NavigationSplitView (triple-column) inside a WindowGroup. On iPad it looks great: the toolbar items merge into the navigation bar, with the three traffic lights. But on Mac Catalyst, the app always reserves a blank safe area below the traffic lights, and places the toolbar on a separate line beneath the title bar. That leaves wasted vertical space I don’t want. What I expect (based on Apple’s WWDC session “Elevate the design of your iPad app”): The toolbar should merge into the title bar with the traffic lights, no separate row. Content should extend into the full height of the window. What I get on Mac Catalyst: Title bar + traffic lights at the top. Then a completely separate toolbar row below it. Safe area inset prevents my content from reaching the top of the window. What I’ve tried: .toolbarRole(.automatic), .editor, .browser → no effect. Hiding the title bar via titlebar?.titleVisibility = .hidden → removes the text but not the toolbar gap. Clearing titlebar?.toolbar → no difference. So far, I can’t find any way to get Catalyst to integrate toolbars into the window chrome the way native SwiftUI on macOS does. Is this a known limitation of Mac Catalyst, or is there a supported way to achieve the same “inline toolbar with window controls” layout? Switching to a Mac app vs. Catalyst fixes the issue, but I would have a lot more work to do to get the app ready for release, not ideal since it works near perfect on iPad. Thanks!
1
2
279
Oct ’25
CNSaveRequest without having a container assignment
Hi, When creating a new contact on MacOS Im getting this new error causing my app to crash, on my app only after updating my machine to Ventura 13.0. The last error before (lldb) is "An ABCDRecord is being saved without having a container assignment. Assigning the contact to <CNCDContainer 0x6000039b51a0 ab>. Please remember to assign contacts to containers to avoid recurring container lookup and contact re-validation costs." When saving a new contact I’m using  saveRequest.add(contact, toContainerWithIdentifier: nil)             do {                 try contactsStore.execute(saveRequest) ** I guess it does not like the nil. Am I supposed to add to a particular container, like iCloud? Documentation says to set it to nil - https://developer.apple.com/documentation/contacts/cnsaverequest/1403036-add Even with the most basic example from https://developer.apple.com/documentation/contacts the save request falis.
4
1
1.7k
Oct ’22
Ambiguous use of 'encode(_:forKey:)'
Hello, Im trying to save a custom object into coredata and it works fine on iOS but when trying to run the same code on the Mac Catalyst version of my app I get an error Ambiguous use of 'encode(_:forKey:)' I created a class for the object. I made it type NSObject & NSSecureCoding. I tried to make it encode and decode and save to CoreData with a transformer. Works on iOS version of my app but not macOS. Why is that? Ty
3
1
1.5k
Feb ’23
Update an Existing Xcode Project Core Data with CloudKit & Manage Multiple Stores
Hi, I have.a project that uses CoreData and I want to add some of the data to iCloud to sync with a Watch app and I ticked the option for the Default configuration to use iCloud and It worked but now I don't want to include images in the cloud because it became too large so I Seperated the images into a different data thing and as per instructions here https://developer.apple.com/documentation/coredata/mirroring_a_core_data_store_with_cloudkit/setting_up_core_data_with_cloudkit I added a configuration "Local" and "Cloud" and change the code as below - original lazy var persistentContainer: NSPersistentContainer = { &#9;&#9;let container = NSPersistentContainer(name: "DataModel") &#9;&#9;container.loadPersistentStores(completionHandler: { &#9;&#9;&#9;&#9;storeDescription, error in &#9;&#9;&#9;&#9;if let error = error { &#9;&#9;&#9;&#9;&#9;&#9;print("Could load data store: \(error)") &#9;&#9;&#9;&#9; } &#9;&#9;}) &#9;&#9;print("Loaded data store: DataModel") &#9;&#9;return container }() I created two configurations as per the video and ticked use with iCloud on the one I would like to sync with iCloud. new code lazy var persistentContainer: NSPersistentContainer = { &#9;&#9;var container = NSPersistentContainer(name: "DataModel") &#9;&#9;if #available(iOS 13.0, *) { &#9;&#9;&#9;&#9;container = NSPersistentCloudKitContainer(name: "DataModel") &#9;&#9;&#9;&#9;let local = NSPersistentStoreDescription(url: URL(fileURLWithPath: "/files/local.sqlite")) &#9;&#9;&#9;&#9;local.configuration = "Local" &#9;&#9;&#9;&#9;let cloud = NSPersistentStoreDescription(url: URL(fileURLWithPath: "/files/cloud.sqlite")) &#9;&#9;&#9;&#9;cloud.configuration = "Cloud" &#9;&#9;&#9;&#9;cloud.cloudKitContainerOptions = &#9;&#9;&#9;&#9;&#9;&#9;NSPersistentCloudKitContainerOptions( &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;containerIdentifier: "iCloud.com.AppName") &#9;&#9;&#9;&#9;container.persistentStoreDescriptions = [ local, cloud ] &#9;&#9;&#9;&#9;container.loadPersistentStores { storeDescription, error in &#9;&#9;&#9;&#9;&#9;&#9;guard error == nil else { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;fatalError("Could not load persistent stores. \(error!)") &#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;return container &#9;&#9;} else { &#9;&#9;&#9;&#9;container.loadPersistentStores(completionHandler: { &#9;&#9;&#9;&#9;&#9;&#9;storeDescription, error in &#9;&#9;&#9;&#9;&#9;&#9;if let error = error { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;print("Could load data store: \(error)") &#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;}) &#9;&#9;&#9;&#9;print("Loaded data store: DataModel") &#9;&#9;&#9;&#9;return container &#9;&#9;} }() Most of this code I got from the video https://developer.apple.com/videos/play/wwdc2019/202/ but I keep getting an error about loading or saving the persistent store or something fatal error: Could not load persistent stores. Error Domain=NSCocoaErrorDomain Code=512 "The file couldn’t be saved." UserInfo={reason=Failed to create file; code = 2}: Is anyone able to point out what I am not doing right? Thanks.
1
0
1.5k
Aug ’21
Widgets broken in ios15 Xcode Simulator?
Hello, After updating Xcode today to the Version 13.0 (13A233) when I run my app on the latest iOS simulator Version 13.0 (970), not matter is its an iPhone 12 or 13 etc. the widgets won't load. If I try to search for widgets to add to the Home Screen there is nothing to pick from. And when I try to run the widget directly from Xcode I get an unusual error that I've never had before. Please specify the widget kind in the scheme's Environment Variables using the key '_XCWidgetKind' I used to be able to run the widgets from the target and play with them all at once.
0
0
1.4k
Sep ’21
ITMS-90892: Missing recommended icon error from Apple App Store
I get this error when submitting my app to the App Store recently. . ITMS-90892: Missing recommended icon - The bundle does not contain an alternate app icon for iPad of exactly '167x167' pixels, in .png format for iOS versions supporting iPad Pro. To support older operating systems, the icon may be required in the bundle outside of an asset catalog. Make sure the Info.plist file includes appropriate entries referencing the file. See ... It's related to the alternate icons in the app structure and the names I think but has nothing to do with the assets catalog. In my app a user can choose and icon for the Home Screen. I have 4 icons to choose and 4 sizes for each icon named e.g. - AA_appIcon@2x AA_appIcon@2x~iPad AA_appIcon@3x AA_appIcon83.5@2x~iPad and it used to work fine, but now I get this error for the one name AA_appIcon83.5@2x~iPad. It is in the correct size 167x167, so not sure what the problem is. It just happen in the last few days, didn't happen on my previous submission a month ago. The naming format must have recently changed or something. Is anyone able to spot the error? This is the info.plist <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleAlternateIcons</key> <dict> <key>AA</key> <dict> <key>CFBundleIconFiles</key> <array> <string>AA_appIcon</string> </array> <key>UIPrerenderedIcon</key> <string>No</string> </dict> <key>Cake</key> <dict> <key>CFBundleIconFiles</key> <array> <string>Cake_appIcon</string> </array> <key>UIPrerenderedIcon</key> <string>No</string> </dict> <key>NA</key> <dict> <key>CFBundleIconFiles</key> <array> <string>NA_appIcon</string> </array> <key>UIPrerenderedIcon</key> <string>No</string> </dict> <key>OA</key> <dict> <key>CFBundleIconFiles</key> <array> <string>OA_appIcon</string> </array> <key>UIPrerenderedIcon</key> <string>No</string> </dict> </dict> <key>CFBundlePrimaryIcon</key> <dict> <key>CFBundleIconFiles</key> <array> <string>Cake_appIcon</string> </array> <key>UIPrerenderedIcon</key> <false/> </dict> </dict> </plist> ```<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleAlternateIcons</key> <dict> <key>AA</key> <dict> <key>CFBundleIconFiles</key> <array> <string>AA_appIcon</string> </array> <key>UIPrerenderedIcon</key> <string>No</string> </dict> <key>Cake</key> <dict> <key>CFBundleIconFiles</key> <array> <string>Cake_appIcon</string> </array> <key>UIPrerenderedIcon</key> <string>No</string> </dict> <key>NA</key> <dict> <key>CFBundleIconFiles</key> <array> <string>NA_appIcon</string> </array> <key>UIPrerenderedIcon</key> <string>No</string> </dict> <key>OA</key> <dict> <key>CFBundleIconFiles</key> <array> <string>OA_appIcon</string> </array> <key>UIPrerenderedIcon</key> <string>No</string> </dict> </dict> <key>CFBundlePrimaryIcon</key> <dict> <key>CFBundleIconFiles</key> <array> <string>Cake_appIcon</string> </array> <key>UIPrerenderedIcon</key> <false/> </dict> </dict> </plist>
1
0
2.4k
Jul ’21
Widget reload not as good as Complication reload
I like to keep my apps watch face complication up to date when the user completes an activity but calling WidgetCenter.shared.reloadAllTimelines() is not working as well as the old complication update now I want to go back to complications. I used to call CLKComplicationServer.sharedInstance().reloadTimeline(for: <#T##CLKComplication#>) which would update my complication instantly. The simulator seams to up date widgets immediately but now my app has been released pn the App Store it is not updating. Any one else experiencing this.
4
4
2.5k
Aug ’23