My application crashes showing sending message to freed instance

My application crashes at the point where the message “send message to an exempted instance” is displayed when I turned on Zombies in my application. I just install NSString in another class that is presented from a view controller. found out that instead of passing nsstring i got nscfstring. How to solve the problem?

+4
source share
4 answers

"Sending a message to a freed instance" is an error that usually occurs when your class receives dealloc'ed but is still a delegate of something (maybe a table view, a collection view, etc.), so it still tries Receive messages. If so, you can try setting these delegates to zero in the dealloc method of your view controller:

- (void)dealloc {
    tableview.delegate = nil;
}

Hope this helps

+1
source

, , , NSString int. , NSCFsting, , . productid int, "[productid intvalue]" "int type" , , setter getter . -

+1

As a subclass of the NSString class, the _NSCFString function is always guaranteed to respond to a given string or isEqualToString. You should register all the data and see if there is anything else that could lead to a failure. More details here :

0
source

What I used to do is lower in previous days.

  • Define a UILabel and make it hidden ...

  • In viewDidLoad, evaluating the NSString value for this UILabel

  • Now, instead of NSString, check the data of this UILabel ...

So I used the NSString problem.

0
source

Source: https://habr.com/ru/post/1599824/


All Articles