Post

Replies

Boosts

Views

Activity

Reply to unexpected nil
I tested in playground in an init, and no crash: class OrderTest { struct Order { var order: Int } var nextOrder: Int? var allItems : [Order] = [] init() { nextOrder = self.allItems.map{$0.order}.max() print("nextOrder", nextOrder) if nextOrder == nil { nextOrder = 0 } print("nextOrder after test", nextOrder) nextOrder! += 1 // <--- Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value } } let orderTest = OrderTest() So problem is somewhere else. Could you show the class or structure where this init() is ? One way I could get it crash was by delaying the allocation of next order with a Dispatch: class OrderTest { struct Order { var order: Int } var nextOrder: Int? var allItems : [Order] = [] init() { nextOrder = self.allItems.map{$0.order}.max() if nextOrder == nil { DispatchQueue.main.async(execute: { // <<-- WITH THIS, IT CRASHES self.nextOrder = 0 }) } nextOrder! += 1 // <--- Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value } } Did you show the exact and complete init() ?
Nov ’24
Reply to unexpected nil
It may be because you do it in the init. I propose to add a return. init() { nextOrder = self.AllItems.map{$0.order}.max() if nextOrder == nil { nextOrder = 0 return // <<-- ADD THIS } nextOrder! += 1 // <--- Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value } or add an else: init() { nextOrder = self.AllItems.map{$0.order}.max() if nextOrder == nil { nextOrder = 0 } else { // <<-- ADD THIS nextOrder! += 1 // <--- Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value } }
Nov ’24
Reply to What should I do when my Development or App Store certificates expire?
Don't worry, no problem with your existing apps. Just needed to submit a new release. You can do it even when certificates have expired. But you can do it now, before it expires. I know at least 2 ways (I prefer the first): First go to Xcode > Settings > accounts select your account and there ask for new certificates if you see they will obsolete soon. that's it Second In Xcode project, select TARGETS In signing and capabilities, you will see the certificate is obsolete. Ask to sign again
Nov ’24
Reply to Binding of an array element property inside a struct not working anymore
You don't show enough code (eg, ContentView) to find out what is the problem. Card is not ObservableObject. That may be the cause of the problem. Try to make it a class and ObservableObject. 2 more comments: why don't you use environmentObject for deck, instead of all the bindings ? in Xcode16, observable is much easier to use than ObservableObject. If needed, get details here: https://medium.com/@vladislavshkodich/remove-observableobject-from-your-swiftui-model-cb455e9572ef
Topic: UI Frameworks SubTopic: SwiftUI
Nov ’24
Reply to Guideline 4.3(a) - Design - Spam
That's not a question for the forum (developers here cannot do anything and this forum is not an official channel to Apple). So, you should either reply to reviewer or contact support.
Replies
Boosts
Views
Activity
Nov ’24
Reply to iMessage unable to send photos or files
Welcome to the forum. Your question is not about app development but product usage. You should post your question on Apple Support Community: https://discussions.apple.com/welcome or file a bug report.
Replies
Boosts
Views
Activity
Nov ’24
Reply to ITMS-91109 for logo as PNG file of about dialog
Who did notify ? Xcode ? AppStoreConnect ? I don't know if it is the same problem, but I often had issue when importing png file in resources. The cause was the presence of "detritus". The solution was to clear attributes with the following command in Terminal: xattr -c theFile.png
Replies
Boosts
Views
Activity
Nov ’24
Reply to thunk for @escaping @callee_guaranteed (@guaranteed NSURLSessionTask) -> () + 48 (<compiler-generated>:0)
It is effectively a cryptic message. Did you see this (explains what thunk means): https://stackoverflow.com/questions/55958834/xcode-instruments-leaks-meaning-of-thunk-for-escaping-callee-guaranted Or this https://stackoverflow.com/questions/61429415/thunk-for-escaping-callee-guaranteed-guaranteed-uialertaction
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to Where are 6.7" Screenshots
You can either use 6.7" or 6.9" screenshots in AppStoreConnect. 6.7" are provided by iPhone 15 Pro Max simulator for instance. PS: Don't forget to close your threads when you got a solution, and let others know if and how the problem was solved.
Replies
Boosts
Views
Activity
Nov ’24
Reply to Developing a driver to read HFS disks on MacOS Sonoma and newer
Thanks so much Quinn for this very precise answer (as usual!). The security reason is a very convincing one. I’ll wait for FSKit. And run in user space (it would just be for my personal use), limiting myself to read only.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to Limiting UITableView Width Across Different Table View Configurations
Just to understand: why do you need static table view ? I've found that very old thread but you may find useful information there: https://stackoverflow.com/questions/22364230/static-table-view-outside-uitableviewcontroller Hope that helps.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to unexpected nil
So, when you ask a question, please provide complete information. That will avoid we loose time in guessing. Have a good day.
Replies
Boosts
Views
Activity
Nov ’24
Reply to unexpected nil
I tested in playground in an init, and no crash: class OrderTest { struct Order { var order: Int } var nextOrder: Int? var allItems : [Order] = [] init() { nextOrder = self.allItems.map{$0.order}.max() print("nextOrder", nextOrder) if nextOrder == nil { nextOrder = 0 } print("nextOrder after test", nextOrder) nextOrder! += 1 // <--- Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value } } let orderTest = OrderTest() So problem is somewhere else. Could you show the class or structure where this init() is ? One way I could get it crash was by delaying the allocation of next order with a Dispatch: class OrderTest { struct Order { var order: Int } var nextOrder: Int? var allItems : [Order] = [] init() { nextOrder = self.allItems.map{$0.order}.max() if nextOrder == nil { DispatchQueue.main.async(execute: { // <<-- WITH THIS, IT CRASHES self.nextOrder = 0 }) } nextOrder! += 1 // <--- Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value } } Did you show the exact and complete init() ?
Replies
Boosts
Views
Activity
Nov ’24
Reply to unexpected nil
It may be because you do it in the init. I propose to add a return. init() { nextOrder = self.AllItems.map{$0.order}.max() if nextOrder == nil { nextOrder = 0 return // <<-- ADD THIS } nextOrder! += 1 // <--- Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value } or add an else: init() { nextOrder = self.AllItems.map{$0.order}.max() if nextOrder == nil { nextOrder = 0 } else { // <<-- ADD THIS nextOrder! += 1 // <--- Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value } }
Replies
Boosts
Views
Activity
Nov ’24
Reply to What should I do when my Development or App Store certificates expire?
Don't worry, no problem with your existing apps. Just needed to submit a new release. You can do it even when certificates have expired. But you can do it now, before it expires. I know at least 2 ways (I prefer the first): First go to Xcode > Settings > accounts select your account and there ask for new certificates if you see they will obsolete soon. that's it Second In Xcode project, select TARGETS In signing and capabilities, you will see the certificate is obsolete. Ask to sign again
Replies
Boosts
Views
Activity
Nov ’24
Reply to Where can I enter my D-U-N-S number in my Apple developer account?
Here the steps to change from individual to company: https://help.uscreen.tv/en/articles/8284333-convert-apple-developer-account-from-individual-to-business In case of problem, you can contact Support. They are really helpful.
Replies
Boosts
Views
Activity
Nov ’24
Reply to Apple app store keeps on asking to enter address
Welcome to the forum Could you post a screenshot ?
Replies
Boosts
Views
Activity
Nov ’24
Reply to ERROR: "Failed to build the scheme (APP NAME)"
It would help to see the code on which error is reported… And please tell about the context. Is it a SwiftUI app ? Is it a problem in Preview ? Or is it when you try to run on simulator ?
Replies
Boosts
Views
Activity
Nov ’24
Reply to Binding of an array element property inside a struct not working anymore
You don't show enough code (eg, ContentView) to find out what is the problem. Card is not ObservableObject. That may be the cause of the problem. Try to make it a class and ObservableObject. 2 more comments: why don't you use environmentObject for deck, instead of all the bindings ? in Xcode16, observable is much easier to use than ObservableObject. If needed, get details here: https://medium.com/@vladislavshkodich/remove-observableobject-from-your-swiftui-model-cb455e9572ef
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Nov ’24