• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Proper Memory Management
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Proper Memory Management


  • Subject: Proper Memory Management
  • From: Philip Vallone <email@hidden>
  • Date: Tue, 19 Jan 2010 15:50:03 -0500

I am I trying to learn proper memory management and have question: In the following example, which objects am I responsible to release?


- (void) viewDidLoad{

	NSString *tempStr = nil;
	NSString *filepath = [[NSBundle mainBundle] pathForResource:@"filename" ofType:@"xml"];

	NSData *xmlData = [NSData dataWithContentsOfFile:filepath];

	NSMutableString *xqueryStr = [NSMutableString stringWithFormat:@"/data/title/@number"];

	NSArray *resultNodes = PerformXMLXPathQuery(xmlData, xqueryStr);

	NSEnumerator *e = [resultNodes objectEnumerator];

	id object;

	while (object = [e nextObject]) {

		for (NSString *key in object){

			tempStr = [[object objectForKey:key] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];

			if ([tempStr isEqualToString:@"number"] ) {

			}else {

					// do something here

			}
		}

	}

}

Thanks,

Phil



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Proper Memory Management
      • From: Dave DeLong <email@hidden>
  • Prev by Date: Re: [iphone] Release Navigation View Controller Question
  • Next by Date: Re: Proper Memory Management
  • Previous by thread: Re: Getting filesize when downloading file with NSURLDownload?
  • Next by thread: Re: Proper Memory Management
  • Index(es):
    • Date
    • Thread