Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-09-2011, 08:18 AM   #1 (permalink)
Registered Member
 
Join Date: Jun 2011
Posts: 22
verbatimbot is on a distinguished road
Default TouchXML and EXC_BAD_ACCESS

Hello,

I am new to objective-c and iphone programming and I have ran into the following problem with TouchXML. The value is successfully parsed and no exception is thrown within callService method, but it throws EXC_BAD_ACCESS error anyways.

If I comment out the last line [nodes release] it has no error in that case, but I am worrying about the memory leaking.

Code:
-(IBAction) callService:(id)sender
{
    NSURL *url = [NSURL URLWithString:@"http://someurl.com/api/getbyid/40"];
    NSData *XMLData   = [NSData dataWithContentsOfURL:url];
    CXMLDocument *doc = [[[CXMLDocument alloc] initWithData:XMLData options:0 error:nil] autorelease];
    
    NSArray *nodes = NULL;
    nodes = [doc nodesForXPath:@"//StoreDetails" error:nil];
    
    for (CXMLElement *node in nodes) {                
        txtOutput.text = [[node nodeForXPath:@"Name" error:nil] stringValue];              
    }
    
    [nodes release];
    
}
verbatimbot is offline   Reply With Quote
Old 06-09-2011, 08:36 AM   #2 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

the problem seem to be

Code:
    [nodes release];
delete it, it it an autoreleased object...
__________________
dany_dev is offline   Reply With Quote
Old 07-04-2011, 09:30 AM   #3 (permalink)
Registered Member
 
Join Date: Jun 2011
Posts: 22
verbatimbot is on a distinguished road
Default

yes, thanks.. i realized that.. dunno why didnt get email notification from the forum when you replied..
verbatimbot is offline   Reply With Quote
Reply

Bookmarks

Tags
exc_bad_access, touchxml, xml

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 316
7 members and 309 guests
chemistry, Dnnake, iOS.Lover, jenniead38, lendo, Leslie80, pbart
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,664
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Leslie80
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:21 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0