Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6658255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:53:36+00:00 2026-05-26T01:53:36+00:00

I use a class member called soapResults when connecting to a webservice. I use

  • 0

I use a class member called “soapResults” when connecting to a webservice. I use a parser to parse the xml results (it is a json result inside the web service).

- (void) parser:(NSXMLParser *) parser
         didStartElement:(NSString *) elementName
         namespaceURI:(NSString *) namespaceURI
         qualifiedName:(NSString *) qName
         attributes:(NSDictionary *) attributeDict {
NSString *attName = [[NSString alloc]initWithFormat:@"%@Result",methodName];
if ([elementName isEqualToString:attName]) {        
    if (!soapResults) {         
        soapResults = [[NSMutableString alloc] init];   
    }       
    elementFound = YES;     
}

[attName release];
}   

Now soapResults is a retain member and released in dealloc. I tried to release this in the connection fail/pass but did not succeed. I also tried not to alloc it at all but then I get empty results…. Any help would be appriciated

Edit:
I also get memory leaks inside the parser:

-(void)parser:(NSXMLParser *) parser 
foundCharacters:(NSString *)string {    
    if (elementFound) {
        [soapResults appendString: string];//Memory leak here
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:53:36+00:00Added an answer on May 26, 2026 at 1:53 am

    If soapResults is a retain property you should change

    soapResults = [[NSMutableString alloc] init];  
    

    To

    self.soapResults = [NSMutableString string]; 
    

    This releases the old value and retains the new one, avoiding leaks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use XML documentation on the members of a class, and in
Can anyone recommend a ready-to-use class/library compatible with C/C++/MFC/ATL that would parse iCal/vCal/Google calendar
I have an NSMutableArray called mVerticies stored as a member of my class and
OK so I have made a class called Courses with private member functions courseName,
I have a private data member called balance in a base class called bankAccount.
Suppose I have a class called Object. The Object class has a member function
I have a DLL which contains a class with static members . I use
I use class from How to support Arabic text in Android? to show Arabic
I'm trying to use class names to change the color of a link after
I am trying to use Class::DBI with Catalyst::Plugin::Authentication::Store::DBIC. The example given on CPAN does

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.