A-->B subview(viewcontroller.view)-->Presentmodalviewcontroller(C)
My second Page:(B) code is
- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict{
[currentElement release];
currentElement = [elementName copy];
if ([elementName isEqualToString:@"result"] ) {
Prodid = [[NSMutableString alloc] init];
}
}
- (void)parserDidEndDocument:(NSXMLParser *)parser {
page *login=[[page alloc]init];
login.prodid = Prodid;
login.categid=self.categid;
UINavigationController *navCtrl= [[UINavigationController alloc] initWithRootViewController:login];
[self presentModalViewController:navCtrl animated:YES];
[login release];
[navCtrl release];
[Prodid release];
}
in my next page(C) there is one cancel button
-(void) cancel
{
[self dismissModalViewControllerAnimated:YES];
}
if i click the cancel button the app crash .I check nszombie and find overreleased object (Prodid). If i remove [Prodid release] the app works but leaks in Prodid.How can i solve this issue.
typeofProdid? - EmptyStackprodiddeclined in yourpageclass? - Nekto