Receive error with NSXMLParser: [Parser matches ToProtocol:]: message was sent to the freed instance 0xcd6be20

I get this error from NSXMLParser when I go out to the NSXMLParser view controller and then return to it later. 2010-12-31 21:49:32.306 App Name[12716:207] *** -[Parser conformsToProtocol:]: message sent to deallocated instance 0xcd6be20 :

Here is my code: https://gist.github.com/761366

+3
source share
2 answers

It is impossible to tell from the fragment that you provided exactly what is happening, but this error usually means that you exceeded the passed object. My reading of your description and your code is that the parser is more durable than the object you set as its delegate:

- (void)parseXMLFileAtURL:(NSString *)URL
{   
    stories = [[NSMutableArray alloc] init];
    NSURL *xmlURL = [NSURL URLWithString:URL];
    parser = [[NSXMLParser alloc] initWithContentsOfURL:xmlURL];
    [parser setDelegate:self];
    [parser setShouldProcessNamespaces:NO];
    [parser setShouldReportNamespacePrefixes:NO];
    [parser setShouldResolveExternalEntities:NO];
    [parser parse];

}

, , . , , . , , " " , , , ToProtocol: , , NSXMLParser, , . , NSXMLParser, :

[parser setDelegate: nil];

, , , parseXMLFileAtURL: . iVar , , iVar, (.. dealloc).

, .

+3

, , . , , , , , , . , TableViewController parser, , , . , , .

, NSZombie Xcode. , , xcode.

Xcode NSZombies. http://www.cocoadev.com/index.pl?NSZombieEnabled

0

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


All Articles