Thanks. Of course, I was misreading the precedence operators (I was reading it as (self.isOn = newValue) ? .myTrue : .myFalse . And once you start reading incorrectly, it's hard to change one's mind.
@techboss_11123 WHere does this code fit ? What do you show here ? And you do not answer on what T is and if it's an array… So please explain more clearly.
So the question is: who is self referring to ? Could you check ? Maybe it is to an instance that does not exist anymore. Could you try adding a capture of self ? UIAction(title: "Edit Value", image: UIImage(systemName: "square.and.pencil"), handler: { [self] (_) in
The point would be to be able to test the code to find out the issue.
What is self in self.edit ?
What if you replace self.edit() by a call to a dummy func as
func test() { print("Test", self) }
Thanks. Of course, I was misreading the precedence operators (I was reading it as (self.isOn = newValue) ? .myTrue : .myFalse . And once you start reading incorrectly, it's hard to change one's mind.
@techboss_11123 WHere does this code fit ? What do you show here ? And you do not answer on what T is and if it's an array… So please explain more clearly.
So the question is: who is self referring to ? Could you check ? Maybe it is to an instance that does not exist anymore. Could you try adding a capture of self ? UIAction(title: "Edit Value", image: UIImage(systemName: "square.and.pencil"), handler: { [self] (_) in
The point would be to be able to test the code to find out the issue.
What is self in self.edit ?
What if you replace self.edit() by a call to a dummy func as
func test() { print("Test", self) }