Post

Replies

Boosts

Views

Activity

Reply to How do I use "views" and structures / what's wrong with my code?
There are so many things wrong with your code: You've created a class Balls, which should contain some variables and methods, but you've added a struct UserView inside. This struct should be outside of the class, at the same level as the class. Your #Preview should be at the root level, just like the class and the struct. for item in Balls is completely wrong for two reasons. Firstly, you're trying to access the class Balls not an instance of it, and secondly inside a View you have to use forEach, i.e. balls.forEach { item in. On line 57 you commented out //var balls [Int] = [ball1; ball2; ball3]. This syntax is wrong. You're missing a colon before the [Int] and you have to use commas not semicolons to separate items in an array, i.e. //var balls: [Int] = [ball1, ball2, ball3]. But, even then this is wrong because you're trying to create an array of Ints but you're passing in three objects which are of the type Balls. I think you need to go back to the beginning and look at how to write Swift and SwiftUI code. There are so many issues in your code here. I note, right at the top, on line 4, you've got a comment: Bouncing Balls Simulation without ChatGPT's Code. I fear you've attempted to use ChatGPT to write code for you. Please stop doing this. Learn how to write code properly. ChatGPT won't help you, and it has clearly led you down the wrong path. There are loads of resources to learn Swift. Apple provides tons of sample code that you can read, follow along with, and learn without resorting to unproven, dodgy 'AI'.
Topic: UI Frameworks SubTopic: SwiftUI
Apr ’25
Reply to Can't change iPhone watch app complication picker app name
Which versions of Xcode, iOS and watchOS are you using? There was a version of iOS where this happened, regardless of what you entered into those info.plist strings. Also, I highly recommend against using ChatGPT or any other AI tools for this sort of thing. They miss the nuances that a human will pick up in your questions, and - as you've experienced - they lead you down a bunch of rabbit holes that get you nowhere and just waste your time. You are far better off asking your questions to real humans in the forums.
Apr ’25
Reply to Mac App Crashing with Illegal Instructions
For some reason, people seem to think they need to make an entirely new thread to add a line of text or correct a spelling mistake... You have ONE HOUR from posting something to edit it. If you're outside that window, and the edit is necessary - your edit above really wasn't necessary - just reply to your own post. There is no reason to create duplicate posts within an hour. It just clutters up the forums.
Apr ’25
Reply to Wrong Product.displayPrice?
This is how it's supposed to work, isn't it? A user in Ukraine will be viewing the Ukraine App Store, which shows prices in UAH. Why would Ukrainian App Store users want to see prices in USD? They'd have to convert it to UAH in their heads. There are settings in App Store Connect for your products that deal with the pricing. I'm not sure how much you can tweak it, but you might want to have a look in there and see if there's something you want to change. If I've misunderstood your question, please feel free to provide more clarity.
Apr ’25
Reply to widget gettimeline completion question
Doesn't the completion handler have to be called within the method? (as in, does Code force you to return something from the method?) If not, it should be fine because it just doesn't mark that you've got new data; it didn't complete. If your widget doesn't receive any updates, it should be written to handle missing data. As an example, add the Apple Weather widget to your Home Screen. Turn off your Wi-Fi, mobile data etc. and see what it looks like. It says it can get data right now. Your widget should handle no data in a similar way.
Apr ’25
Reply to iOS 18 System Bug Causes URL Scheme Failure
Right. Have you raised a bug, or are you hoping someone at Apple will come across your post in these Developer Forums (which are for random third-party not-employed-by-Apple developers) and raise the bug for you? Please raise a Feedback report at https://feedbackassistant.apple.com/ then post the FB number here.
Apr ’25
Reply to Debugging help
Put the call to modelContext.fetch() inside a try { ... } catch { ... } block, and print out the error that it catches. If you're trying to do something but you aren't bothering to catch any errors to see why it's failing, you're going to hit issues like this. Your current code is always assuming that everything is 100% tickety-boo all the time. If transactions was nil, the call to transaction.count would crash the app anyway.
Apr ’25
Reply to How do I use "views" and structures / what's wrong with my code?
You can't, but you also don't need to post a new thread for the exact same issue.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Apr ’25
Reply to How do I use "views" and structures / what's wrong with my code?
There are so many things wrong with your code: You've created a class Balls, which should contain some variables and methods, but you've added a struct UserView inside. This struct should be outside of the class, at the same level as the class. Your #Preview should be at the root level, just like the class and the struct. for item in Balls is completely wrong for two reasons. Firstly, you're trying to access the class Balls not an instance of it, and secondly inside a View you have to use forEach, i.e. balls.forEach { item in. On line 57 you commented out //var balls [Int] = [ball1; ball2; ball3]. This syntax is wrong. You're missing a colon before the [Int] and you have to use commas not semicolons to separate items in an array, i.e. //var balls: [Int] = [ball1, ball2, ball3]. But, even then this is wrong because you're trying to create an array of Ints but you're passing in three objects which are of the type Balls. I think you need to go back to the beginning and look at how to write Swift and SwiftUI code. There are so many issues in your code here. I note, right at the top, on line 4, you've got a comment: Bouncing Balls Simulation without ChatGPT's Code. I fear you've attempted to use ChatGPT to write code for you. Please stop doing this. Learn how to write code properly. ChatGPT won't help you, and it has clearly led you down the wrong path. There are loads of resources to learn Swift. Apple provides tons of sample code that you can read, follow along with, and learn without resorting to unproven, dodgy 'AI'.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Apr ’25
Reply to Can't change iPhone watch app complication picker app name
Which versions of Xcode, iOS and watchOS are you using? There was a version of iOS where this happened, regardless of what you entered into those info.plist strings. Also, I highly recommend against using ChatGPT or any other AI tools for this sort of thing. They miss the nuances that a human will pick up in your questions, and - as you've experienced - they lead you down a bunch of rabbit holes that get you nowhere and just waste your time. You are far better off asking your questions to real humans in the forums.
Replies
Boosts
Views
Activity
Apr ’25
Reply to Mac App Crashing with Illegal Instructions
For some reason, people seem to think they need to make an entirely new thread to add a line of text or correct a spelling mistake... You have ONE HOUR from posting something to edit it. If you're outside that window, and the edit is necessary - your edit above really wasn't necessary - just reply to your own post. There is no reason to create duplicate posts within an hour. It just clutters up the forums.
Replies
Boosts
Views
Activity
Apr ’25
Reply to UIInputView not being deallocated
No need to make a duplicate post to correct a spelling mistake...
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Apr ’25
Reply to Docker won't run on Sequoia 15.4
https://github.com/docker/for-mac/issues/7527 suggests a way to fix it. macOS 15.4.1 has also been released, but I doubt that will make any difference, as "the reason for this warning is that some files in existing installations are incorrectly signed."
Replies
Boosts
Views
Activity
Apr ’25
Reply to Wrong Product.displayPrice?
This is how it's supposed to work, isn't it? A user in Ukraine will be viewing the Ukraine App Store, which shows prices in UAH. Why would Ukrainian App Store users want to see prices in USD? They'd have to convert it to UAH in their heads. There are settings in App Store Connect for your products that deal with the pricing. I'm not sure how much you can tweak it, but you might want to have a look in there and see if there's something you want to change. If I've misunderstood your question, please feel free to provide more clarity.
Replies
Boosts
Views
Activity
Apr ’25
Reply to widget gettimeline completion question
Doesn't the completion handler have to be called within the method? (as in, does Code force you to return something from the method?) If not, it should be fine because it just doesn't mark that you've got new data; it didn't complete. If your widget doesn't receive any updates, it should be written to handle missing data. As an example, add the Apple Weather widget to your Home Screen. Turn off your Wi-Fi, mobile data etc. and see what it looks like. It says it can get data right now. Your widget should handle no data in a similar way.
Replies
Boosts
Views
Activity
Apr ’25
Reply to Accidentally Deleted the Build Version Slot in Versioning
Attach the image to THIS thread. I'm not clicking a random unknown url that you've shortened.
Replies
Boosts
Views
Activity
Apr ’25
Reply to I wish ELGATO GAMING Come on Apple TV https://help.elgato.com/hc/en-us/requests/new
Speak to Elgato. No one here can bring this app to the Apple TV for you. I want my brother to wash my car. Why am I telling you? These are the Developer Forums, where third-party, not-employed-by-Apple-or-Elgato developers of apps for Apple's platforms ask each other for hints and tips on coding their own apps. You're in the wrong place.
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Apr ’25
Reply to iOS 18 System Bug Causes URL Scheme Failure
Right. Have you raised a bug, or are you hoping someone at Apple will come across your post in these Developer Forums (which are for random third-party not-employed-by-Apple developers) and raise the bug for you? Please raise a Feedback report at https://feedbackassistant.apple.com/ then post the FB number here.
Replies
Boosts
Views
Activity
Apr ’25
Reply to Program License Agreement?!?!
Chill. Where are you in the process? Is there a screenshot you can share that shows what you're talking about? (Redact any personal information if it's on the screen.)
Replies
Boosts
Views
Activity
Apr ’25
Reply to Accidentally Deleted the Build Version Slot in Versioning
Slot? Where? In App Store Connect? Xcode? Got a screenshot so we can see what you're talking about?
Replies
Boosts
Views
Activity
Apr ’25
Reply to Zoom Crashing
I think you need to report the crash to Zoom, not to us third-party not-employed-by-Apple random developers on these forums.
Replies
Boosts
Views
Activity
Apr ’25
Reply to Debugging help
Put the call to modelContext.fetch() inside a try { ... } catch { ... } block, and print out the error that it catches. If you're trying to do something but you aren't bothering to catch any errors to see why it's failing, you're going to hit issues like this. Your current code is always assuming that everything is 100% tickety-boo all the time. If transactions was nil, the call to transaction.count would crash the app anyway.
Replies
Boosts
Views
Activity
Apr ’25