Post

Replies

Boosts

Views

Activity

Reply to Testflight Validate ERROR ITMS-90778 NDEF is disallowed
Following this Stack Overflow answer - https://stackoverflow.com/a/61265904/3765705, I have manually removed the NDEF entitlement and was able to upload my app to the App Store without the ITMS-90778 error I was experiencing. But this leaves me with a lot of questions... Why does Xcode add an entitlement that needs to be removed for uploading to the App Store? Is this a bug? Should I file a radar? I have now removed the NDEF entitlement. What will this cause? I am testing my app with a some cheap NFC Tags and everything seem to work, both reading and writing (and this includes the readerSession(_ session: NFCNDEFReaderSession, didDetectNDEFs messages: [NFCNDEFMessage]) NFCNDEFReaderSessionDelegate method that, as made clear by the name, handles the NDEF message of the tag), but have I maybe reduced the number of tags my app will be compatible with, by removing this entitlement? Another Stack Overflow answer - https://stackoverflow.com/a/58146231/3765705 with some upvotes describes the need to also add an ISO7816 application identifiers for NFC Tag Reader Session key to the Info.plist file with a com.apple.developer.nfc.readersession.iso7816.select-identifiers value. I didn't do it and my app seem to work, but again, is this necessary? If I add this, what happens? Thank you for all the informations you can provide, testing this in production is rather scary...
Aug ’20
Reply to How to subclass with SwiftData?
@stockholmelectronica I am currently experimenting with inheritance with SwiftData and I am not yet to the point to declare if it is or it is not supported, but I have verified that adding @Model to a subclass of a @Model class makes the compiler angry: Redundant conformance of 'Subclass' to protocol 'PersistentModel' Property 'backingData' with type 'any BackingData' cannot override a property with type 'any BackingData' Cannot override static method (for schemaMetadata(), included in the Macro) With the caveat of not knowing if data will be persisted yet, what I have established so far is that it seems to be needed to add an implementation of the following method to the subclasses, but I am not sure that calling super.init will be enough: required init(backingData: any BackingData<Question>, fromFetch: Bool = false) { super.init(backingData: backingData) } Update: I am stepping away from trying to use SwiftData with inheritance: after creating a @Model parent class and a subclass with the required init above, I tried adding to the App Struct the contextModel initialisation as follows: .modelContainer(for: ParentClass.self) .modelContainer(for: Subclass.self) but the app crashes at launch with Fatal error: Entity Subclass specifies Parentclass as its parent but no such entity was found in the provided types: [MyApp.Subcass]. I am not equipped to deal with this: Apple didn't make clear if it is supported, there's no documentation for this use case and it appear not to be how they want you to build things anyway, so it might be unwise to fight the system. Update 2: Okay, I realize I made a mistake setting up the modelContainer, the correct approach for multiple classes would be: .modelContainer(for: [ParentClass.self, Subclass.self]) But this doesn't change my conclusion, as now the app crashes at launch with the following error: Thread 1: "Property named 'uuid' in entity 'Subclass' conflicts with property inherited from parent entity 'Parentclass'"; I obviously declared uuid only in the parent class, which was kind of the point of using inheritance in the first place. The fact that all code samples had final class used for @Model should have been a clear enough signal, I'm afraid: feels this will fight me at every turn, time to stash and move on.
Jun ’23
Reply to Apple Watch console / device logs is empty
I am so utterly frustrated by the fact that, 5 years after @Clete2 posted the sysdiagnose profile solution, that was still the only thing that worked for me. watchOS 10, iOS 17, Xcode 15... yesterday morning, I was debugging my Watch app just fine. Then it stopped showing anything in the console, but only for the Watch app, the iPhone counterpart logged normally. Clean derived data. Reboot Watch. Try again. Nope. Clean derived data, reboot Mac, iPhone and Watch. Give each one a few minutes to know they're alive... Try again, a few times. Repeat changing the order of reboots. Still nope. 5 years. Un-freaking-believable. Thank you again, @Clete2 !
Nov ’23