Post

Replies

Boosts

Views

Activity

Reply to Why is this crashing?
Thank you for the help with streamlining it. I couldn't figure that out earlier. As for where it crashes, it prints it fine and then crashes at cell.textLabel?.text = unlocked[indexPath.row], if I comment that out it crashes when setting the image.
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to Why is this crashing?
Could you please give me an example? This is what is not running:                         if IconChange.setIconPurchased == true {                             print("purchased = true")                             self.iconSelected = self.names[indexPath.row]                             UserDefaults.standard.setValue(self.names[indexPath.row], forKey: "iconSelected")                             self.IconSelector.reloadData()                             tableView.cellForRow(at: indexPath)?.accessoryType = .checkmark                             IconChange.pushBack = true                             self.navigationController?.popViewController(animated: true) Also, I am mysteriously getting the index out of range error and crashing again.
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to Why is this crashing?
I fixed it again by instead of using num unlocked using unlocked.count and locked.count.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Why is this crashing?
Thank you for the help with streamlining it. I couldn't figure that out earlier. As for where it crashes, it prints it fine and then crashes at cell.textLabel?.text = unlocked[indexPath.row], if I comment that out it crashes when setting the image.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Why is this crashing?
Could you please give me an example? This is what is not running:                         if IconChange.setIconPurchased == true {                             print("purchased = true")                             self.iconSelected = self.names[indexPath.row]                             UserDefaults.standard.setValue(self.names[indexPath.row], forKey: "iconSelected")                             self.IconSelector.reloadData()                             tableView.cellForRow(at: indexPath)?.accessoryType = .checkmark                             IconChange.pushBack = true                             self.navigationController?.popViewController(animated: true) Also, I am mysteriously getting the index out of range error and crashing again.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Why is this crashing?
I got it working, but now if IconChange.setIconPurchased == true isn't getting triggered because it is running before it's true. Ideas?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
May ’21