i have this
NSXMLParser *xmlParserf = [[NSXMLParser alloc] initWithContentsOfURL:url];
// NSLog(@"URL%@",urlf);
//Initialize the delegate.
XMLParser *parserf = [[XMLParser alloc] initXMLParser];
[xmlParserf setDelegate:parserf];
//Start parsing the XML file.
BOOL successs = [xmlParserf parse];
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
NSLog(@" this xml is %d",[xmlParserf retainCount]);// getting error
NSLog(@" this paaat is %d",[parserf retainCount]);// getting error
if(successs)
{
NSLog(@"ZONE IS PARSED");
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
}
else
{
NSLog(@"NOT PARSED!!!");
}
//[xmlParserf release]; not working
//[parserf release];
now i dont know when to release those objects these are running in some threads
everytime you
alloc(orcopy), you must eitherreleaseorautorelease.In this case:
and
It means that you keep it in memory at least until the end of the current function. If other objects hang on to it (i.e.
retainit) then the objects stay in memory, until they arereleased(by those other objects).