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

  • Home
  • SEARCH
  • 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 6698735
In Process

The Archive Base Latest Questions

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

I have a method that sets up NSXMLParser with the correct data that I

  • 0

I have a method that sets up NSXMLParser with the correct data that I am pretty sure is causing a memory leak.

This is my first time using instriments to try and solve a memory leak and have got it down to the offending method..

by looking at the response caller value in instruments memory leak testing.

I am hoping you can tell me where the memory leak is here… because I release both myDataArray and parser… im just not sure where I am going wrong.. do I need to assign them nil also?

- (void)startTheParsingProcess:(NSData *)parserData
{
    [myDataArray release]; // clears array for next time it is used.
    myDataArray = [[NSMutableArray alloc] init];

    NSXMLParser *parser = [[NSXMLParser alloc] initWithData:parserData]; //parserData passed to NSXMLParser delegate which starts the parsing process 

    [parser setDelegate:self];
    [parser parse]; // starts the event-driven parsing operation.
    [parser release];
}

any help would be appreciated.

UPDATE:

I have made the changes to my application and when I run it on the simulator I do not get any memory leak errors..

however if I run it on my phone get this in the console…

2011-10-19 11:22:05.673 code[1299:707] -[__NSCFType section]: unrecognized selector sent to instance 0x1b9b80
2011-10-19 11:22:05.683 code[1299:707] CoreAnimation: ignoring exception: -[__NSCFType section]: unrecognized selector sent to instance 0x1b9b80
2011-10-19 11:22:07.949 code[1299:707] -[__NSCFType row]: unrecognized selector sent to instance 0x1b9b80
2011-10-19 11:22:07.951 code[1299:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType row]: unrecognized selector sent to instance 0x1b9b80'
*** First throw call stack:
(0x35e9e8b3 0x366e61e5 0x35ea1acb 0x35ea0939 0x35dfb680 0x334a76cf 0x3353c713 0x30fd5 0x3352cd69 0x335a60ab 0x35cc32ab 0x35e72a57 0x35e726bd 0x35e71293 0x35df44e5 0x35df43ad 0x30fa4fed 0x334a7dc7 0x272f 0x26d8)
  • 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-26T06:36:48+00:00Added an answer on May 26, 2026 at 6:36 am

    Try putting this in the .h

    @property (nonatomic, retain) NSMutableArray *myDataArray
    
    .m
    
    @synthesize myDataArray
    
    in the method...
    
    - (void)startTheParsingProcess:(NSData *)parserData
    {
        self.myDataArray = [NSMutableArray arrayWithCapacity:8];
    
        NSXMLParser *parser = [[NSXMLParser alloc] initWithData:parserData]; //parserData passed to NSXMLParser delegate which starts the parsing process 
    
        [parser setDelegate:self];
        [parser parse]; // starts the event-driven parsing operation.
        [parser release];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a method that sets up my linq data context. Before it returns
I have a method that sets a property public void SetNetworkCredential(string userName, string password,
I have a method that sets the text for a label, and I'd like
I have a method that contains an asynchronous call like this: public void MyMethod()
I have a method that returns Sets of sets. Following is what I mean:
I have the following method that sets a few properties of IEntity. My general
I have a method that loads a Crystal Reports file, sets the appropriate login
I am have a method that sets an alarm using information froma SQLite database
I have a custom method that accepts two parameters. I am using this method
I have class method that returns a list of employees that I can iterate

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.