Post

Replies

Boosts

Views

Activity

Reply to Developers Need Some Answers
…are not receiving what they paid for. When trying to reach out to Apple… For sure you have read your licence agreement: https://developer.apple.com/support/terms/apple-developer-program-license-agreement/ 2.10 Updates; No Support or Maintenance … Apple is not obligated to provide any maintenance, technical or other support for the Apple Software or Services. … So, even though that may be frustrating, they just meet their contractual obligation on that point.
5h
Reply to Help, I'm New and Lot
Welcome to the forum Warren85. It is hard to say with such limited information. You should read this to get tips on how to post on the forum: https://developer.apple.com/forums/thread/706527 This being said, please tell: Is it an iOS app (for iPhone / iPad) ? Is it SwiftUI ? Show the code of the app (ContentView if SwiftUI), we shall help you. Or at list the part where the initial content should show on simulator.
1d
Reply to Setting the highlight colour of a selected cell in NSTableView
Thanks for reply.   You definitely wouldn't want to change the highlight style in "viewFor". Maybe do that in viewDidLoad or something. What's the issue ?   There's more than one way to do this. One would be enough Anyway, I change my mind to stay consistent with system behaviour and will change the color of the text (to white) when selected, to make it more readable.
Topic: UI Frameworks SubTopic: AppKit Tags:
5d
Reply to Can we decode twice in the same session with unarchiver?
Thanks for the reply. I tried to replace if let result = unarchiver.decodeObject(of: [/* list */], forKey: someKey) as? someClass { by do { let result = try unarchiver.decodeTopLevelObject(of: [/* list */], forKey: someKey) as! someClass It compiles but does not decode: I get a failure on log : unarchiving failed And with this pattern, I do not know how to test the "double call" within the print Is it an error to use unarchiver.decodeObject ? What can be the side effects ? unarchiver.decodeObject(of: [/* list */], forKey: someKey)
Topic: App & System Services SubTopic: General Tags:
1w
Reply to How to solve this NSKeyedArchiver warning
SOLVED. I did log a message before each call of decoder.decodeObject(of: key:) That let me find the issue, and replace: self.aVar = decoder.decodeObject(of: NSArray.self, forKey: someKey) as? someClass by self.aVar = decoder.decodeObject(of: [NSArray.self, NSSet.self, NSNumber.self], forKey: someKey) as? someClass   Effectively, someClass has properties that have NSSet properties as well as Int. That was my error, but I still think that Xcode should be able to guess this and provide clearer messages or propose autocompletion. Not yet the case in Xcode 16.4 nor 26.2. I'll file a bug report for enhancement.
Topic: App & System Services SubTopic: General Tags:
1w
Reply to How to solve this NSKeyedArchiver warning
Thanks Albert for replying.   Is it an array where you use NSKeyedUnarchiver validateAllowedClass:forKey:? I have a lot of classes with SecureCoding, and I cannot find from the warning in the log where it comes from. What is surprising is that I have commented out all the NSNumber.self in any list of decoder.decodeObject(of:, key:) like if let format = decoder.decodeObject(of: [NSArray.self/*, NSNumber.self*/], forKey: formatKey) as? [[Int]] { And still get the log. *** -[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving safe plist type ''NSNumber' (0x204cdbeb8) [/System/Library/Frameworks/Foundation.framework]' for key 'NS.objects', even though it was not explicitly included in the client allowed classes set: '{( "'NSArray' (0x204cd5598) [/System/Library/Frameworks/CoreFoundation.framework]" )}'. This will be disallowed in the future. *** -[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving safe plist type ''NSNumber' (0x204cdbeb8) [/System/Library/Frameworks/Foundation.framework]' for key 'NS.objects', even though it was not explicitly included in the client allowed classes set: '{( "'NSArray' (0x204cd5598) [/System/Library/Frameworks/CoreFoundation.framework]" )}'. This will be disallowed in the future. So the questions: does the alert ask to include NSNumber.self in some decoder.decodeObject(of:) ? How can I find where the message triggers ? I will try to locate by setting breakpoints at decoder.decodeObject(of:, key:) calls, but there maybe a simpler way ? PS: this new API for secure coding makes it really difficult. It would be great if Xcode could propose the list of Types to include in decoder.decodeObject(of:, key:).
Topic: App & System Services SubTopic: General Tags:
1w
Reply to How to encode / decode Array < Array < SomeStruct > >
I have tried also: if let format = decoder.decodeObject(of: Array<any AnyObject.Type>.self, forKey: someKey) { I get the compiler error: Cannot convert value of type 'Array<any AnyObject.Type>.Type' to expected argument type '[AnyClass]' (aka 'Array<any AnyObject.Type>')   I then tried if let format = decoder.decodeObject(of: [AnyClass].self, forKey: someKey) { and got Cannot convert value of type '[AnyClass].Type' (aka 'Array<any AnyObject.Type>.Type') to expected argument type '[AnyClass]' (aka 'Array<any AnyObject.Type>')    And a last try: if let formatI = decoder.decodeObject(of: [AnyClass], forKey: someKey) { and got Cannot convert value of type '[AnyClass].Type' (aka 'Array<any AnyObject.Type>.Type') to expected argument type '[AnyClass]' (aka 'Array<any AnyObject.Type>')   What should I pass as of: argument?
Topic: App & System Services SubTopic: General Tags:
1w
Reply to App Store Connect rejects screenshot upload: “incorrect size” (subscription purchase flow) — tried all documented sizes
Welcome to the forums. So just select a simulator in Xcode for iPhone and iPad (e.g., iPhone 16 Plus 6.7" and iPad Air 13") and run the app on them. The screenshots generated by the simulator (cmd-S) will provide the right sized images. Note that you have to provide only one size for iPhone and one size for iPad.
1w
Reply to NSKeyedArchiving issue
Hey Quinn, thanks for all the material. I realize that I have a basic issue in my code. data is not loaded. In the previous version, archiver had a connection to data let archiver = NSKeyedArchiver(forWritingWith: data) That's no more the case, so data is empty, hence the problems. let data = NSMutableData() let archiver = NSKeyedArchiver(requiringSecureCoding: true) archiver.encode(myObject, forKey: theKey) archiver.encode(myObject2, forKey: theKey2) archiver.finishEncoding() do { try data.write(to: an uRL, options: []) // data is empty of course ! } catch { } So should I replace: archiver.encode(myObject, forKey: theKey) archiver.encode(myObject2, forKey: theKey2) archiver.finishEncoding() do { try data.write(to: anURL, options: []) // So object and object2 are on file with let data = try! NSKeyedArchiver.archivedData(withRootObject: myObject, requiringSecureCoding: true) let data2 = try! NSKeyedArchiver.archivedData(withRootObject: myObject2, requiringSecureCoding: true) archiver.finishEncoding() If so, how do I write object and object2 in a single file properly ? Would I have to include all in a single root class ? Also, when I compare to https://developer.apple.com/forums/thread/759746, my required init(coder decoder: NSCoder) is different. required init(coder decoder: NSCoder) { super.init() var1 = decoder.decodeObject(forKey: key) as? [someType] var2 = decoder.decodeObject(forKey: key2) as? [someType2] } I do not use decodeObject(of:) as in the reference let identifier = decoder.decodeObject(of: NSString.self, forKey: "identifier"), let codeDataModels = decoder.decodeArrayOfObjects(ofClass: CodeDataModel.self, forKey: "codeDataModels") Is it OK ?
Topic: App & System Services SubTopic: General Tags:
1w