Post

Replies

Boosts

Views

Activity

Reply to NSUserDefaults no-go macOS, Objective-C, Big Sur
What do you want to achieve ? I do this, which works (in Swift, but easy to adapt). In DidFinishLaunching: let defaults = UserDefaults.standard let h = defaults.bool(forKey: "someKey") When I need to save: let defaults = UserDefaults.standard let h = true // the value to save defaults.set(h, forKey: "someKey") In fact, I don't even use synchronise. PS: MacOS could be a relevant tag
Topic: UI Frameworks SubTopic: AppKit Tags:
Jul ’21
Reply to Using Fruit Basket demo
I'm still unsure about a lot of things. The best way to use this forum is to ask questions, one by one. If you do so, don't forget to post the relevant piece of code and explain clearly what doesn't work as expected or what you don't understand. Note: could you post the link to the WWDC21 session ?
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’21
Reply to Need Help Transfer Data From Button
gives me an unrecognized selector error Which line ? You need to retrieve the item, which is the selected cell. You can do this in didSelectRow to keep the selectedCell reference. Or you could also extract there item.yahooName and keep it in a var selectedName in VC and use it in prepare.
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’21
Reply to Need Help Transfer Data From Button
Another point: don't force downcast. If it fails, app will crash   let destinationController = segue.destination as! HighlightsVC       destinationController.playerName = (item.yahooName!) But conditionnal unwrap: if  let destinationController = segue.destination as? HighlightsVC {       destinationController.playerName = selectedName // Set in didSelectRow } No need either for parenthesis around name, but for such code, use ?? operator:       destinationController.playerName = item.yahooName ?? ""
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’21
Reply to Need Help Transfer Data From Button
The thing is I don't want the whole cell to be selected. I just want the button to be. When you tap the button, de facto you select cell. So probably you can use optional func tableView(_ tableView: UITableView, willSelectRowAt indexPath: IndexPath) -> IndexPath? to get the select and immediately deselect it so that it is not highlighted. But in the meantime, get the cell reference and name.
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’21
Reply to Need Help Transfer Data From Button
what you mean by cell reference In willSelectRowAt, you can either get the cell itself or you can directly get the yahooName of the cell. And save it in a global var of the VC. Then, the segue is from the VC (not the cell) to the next VC. In prepare, you set the name as you have done. In IBAction, just call the segue: @IBAction func CamButtonA(_ sender: UIButton) {           performSegue(withIdentifier: "hs", sender: nil) // No need to know the sender here }
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’21
Reply to HELP! I don't understand Loops.
What is it more precisely you don't understand ? It it the for loop, the while loop ? Is it something specific in the syntax ? Please give examples of what you don't understand, we'll try to help. Note: you should use Apple book: intro to App development with Swift or, more detailed: The Swift programming language. They are much more didactic and will ease your understanding.
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’21
Reply to App Store Connect Trends (Sales) page not loading
Today Trends show a blank page… Contacted Apple Support.
Replies
Boosts
Views
Activity
Jul ’21
Reply to NSUserDefaults no-go macOS, Objective-C, Big Sur
What do you want to achieve ? I do this, which works (in Swift, but easy to adapt). In DidFinishLaunching: let defaults = UserDefaults.standard let h = defaults.bool(forKey: "someKey") When I need to save: let defaults = UserDefaults.standard let h = true // the value to save defaults.set(h, forKey: "someKey") In fact, I don't even use synchronise. PS: MacOS could be a relevant tag
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to SIMULATOR ON XCODE AIN'T WORKING
I finished entered all the codes correctly You don't show code, it is hard to say. But the problem could be that you have created a recursive call, causing infinite loop that finally exceed system resources. We would need to see the code to confirm this hypothesis.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Using Fruit Basket demo
I'm still unsure about a lot of things. The best way to use this forum is to ask questions, one by one. If you do so, don't forget to post the relevant piece of code and explain clearly what doesn't work as expected or what you don't understand. Note: could you post the link to the WWDC21 session ?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Binary Rejected
This is only a reminder of Apple's guidelines. What is your question ? Have you done what is required here ?
Replies
Boosts
Views
Activity
Jul ’21
Reply to Need Help Transfer Data From Button
gives me an unrecognized selector error Which line ? You need to retrieve the item, which is the selected cell. You can do this in didSelectRow to keep the selectedCell reference. Or you could also extract there item.yahooName and keep it in a var selectedName in VC and use it in prepare.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Need Help Transfer Data From Button
Another point: don't force downcast. If it fails, app will crash   let destinationController = segue.destination as! HighlightsVC       destinationController.playerName = (item.yahooName!) But conditionnal unwrap: if  let destinationController = segue.destination as? HighlightsVC {       destinationController.playerName = selectedName // Set in didSelectRow } No need either for parenthesis around name, but for such code, use ?? operator:       destinationController.playerName = item.yahooName ?? ""
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to How to set the default language within API Documentation to swift?
When you open API documentation in Xcode, it does open on Swift version if you have a Swift app. it always shows it in Objective-C,  No, not what I get. When you open in Safari, it depends how you searched for. Could you detail the scenario that causes you this (small) problem ?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Need Help Transfer Data From Button
The thing is I don't want the whole cell to be selected. I just want the button to be. When you tap the button, de facto you select cell. So probably you can use optional func tableView(_ tableView: UITableView, willSelectRowAt indexPath: IndexPath) -> IndexPath? to get the select and immediately deselect it so that it is not highlighted. But in the meantime, get the cell reference and name.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Need Help Transfer Data From Button
what you mean by cell reference In willSelectRowAt, you can either get the cell itself or you can directly get the yahooName of the cell. And save it in a global var of the VC. Then, the segue is from the VC (not the cell) to the next VC. In prepare, you set the name as you have done. In IBAction, just call the segue: @IBAction func CamButtonA(_ sender: UIButton) {           performSegue(withIdentifier: "hs", sender: nil) // No need to know the sender here }
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to How to practice Swift without Xcode?
Why don't you download an older version of XCode ? If it is just to learn Swift, it will let you start…
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to HELP! I don't understand Loops.
What is it more precisely you don't understand ? It it the for loop, the while loop ? Is it something specific in the syntax ? Please give examples of what you don't understand, we'll try to help. Note: you should use Apple book: intro to App development with Swift or, more detailed: The Swift programming language. They are much more didactic and will ease your understanding.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Where is "scrollable stack view" in xcode?
I do not see a stackView in tour set up, to be included in the scrollView.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Will casting "as?" fail if not the correct type?
As OOPer explained, it will fail. It is not a question of size. However, if you subclass MyPeg class MySubPeg : MyPeg { var sub = "hello" } Then test will succeed.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Need Help Transfer Data From Button
You can't put any segues in there. What is the problem ? Do you get an error message ? Did you create the segue between VC (not cell) and the destination ?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21