Post

Replies

Boosts

Views

Activity

How do I store FileManager.ubiquityIdentityToken?
I need any kind of help I can get on this question and am open to any solutions or workarounds. When I archive FileManager.ubiquityIdentityToken with NSKeyedArchiver.archivedData(withRootObject:requiringSecureCoding:), what should I set the second parameter to in order to be able to unarchive later, and how do I unarchive the Data object using unarchivedObject(ofClass:from:) or any other method of NSKeyedUnarchiver? My code currently uses the deprecated method of archivedData(withRootObject:), which gives me a code time warning saying: 'archivedData(withRootObject:)' was deprecated in iOS 12.0: Use +archivedDataWithRootObject:requiringSecureCoding:error: instead I'm getting code time error messages in red for the argument to archivedData(withRootObject:requiringSecureCoding:) which is declared as type Any. I tried different arguments. The one I this should work is (NSCoding & NSCopying & NSObject).Type, which generates two error messages: Static method 'unarchivedObject(ofClass:from:)' requires that '(NSObject & NSCoding & NSCopying).Type' inherit from 'NSObject' Type '(NSObject & NSCoding & NSCopying).Type' cannot conform to 'NSCoding' Setting the argument to (NSCoding & NSCopying & NSObject) generates the error message: 'NSObject & NSCoding & NSCopying' cannot be used as a type conforming to protocol 'NSCoding' because 'NSCoding' has static requirements I haven't been able to discover what that means that 'NSCoding' has static I get the idea to use (NSCoding & NSCopying & NSObject) because when run code: print("type of FileManager.default.ubiquityIdentityToken: \(type(of: FileManager.default.ubiquityIdentityToken))") the debug window shows type of FileManager.default.ubiquityIdentityToken: Optional<NSCoding & NSCopying & NSObject> but when I run the following code print("type of FileManager.default.ubiquityIdentityToken: \(type(of: FileManager.default.ubiquityIdentityToken!))") I get the following in the debug window type of FileManager.default.ubiquityIdentityToken: _NSInlineData I read on stackoverflow that "_NSInlineData" is not made available to us by Apple. I'm open to doing this any other way, not necessarily with NSKeyedArchiver or NSKeyedUnarchiver, including using unsafe pointers if necessary. In one of Apple's documentation or sample Xcode projects, I found code to check the login status of a user on iOS when an app logs on by checking FileManager.ubiquityIdentityToken and to check the current status with the previous status by checking the ubiquityIdentityToken that was saved in UserDefaults. Is there a better way of doing this?
3
1
1.8k
Jul ’22
How do I get my iOS app to contribute an action for a shortcut?
When I go to the Shortcuts app and add an action, there is a tab that lets me see Apps that has actions I can use. How do I make my iOS app be able to contribute actions for users to use in a shortcut, so that a user creating a shortcut can add an action that does something in my app? An example of this is the Walmart app. A user can create use an action that allows him to check in.
0
1
937
Sep ’22
I am getting validation error message creating sandbox tester account.
I am having trouble creating a sandbox tester account in App Store. I keep getting an error message saying there are one or more validation errors when I click on "Invite", but there are no indications of any errors. None of the fields are marked with red for an error.What is going on? Is there a limit of the number of sandbox tester accounts I can create? Is anyone else having trouble with this?
66
1
46k
Aug ’21