• 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
Re: why there is a memory leak in this method?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why there is a memory leak in this method?


  • Subject: Re: why there is a memory leak in this method?
  • From: Scott Stevenson <email@hidden>
  • Date: Fri, 24 Nov 2006 22:29:23 -0800


On Nov 23, 2006, at 10:21 PM, Leo wrote:

I have a simple method:

- (NSString *)hTagString:(NSString *)source{
NSString *hTag=nil;

Your code looks correct. I don't know why it's leaking, but consider using just 'release' at the end of the method. You don't always have to use autorelease, and it's actually more characters to type.


Also, since you're doing HTML parsing, make sure you're not replicating code that already exists in WebKit. There's some fantastic stuff for dealing with web page source. Check out the classes declared in WebKit's DOMCore.h and DOMHTML.h. Particularly things like DOMHTMLDocument's getElementsByName.

[ Side note for everyone else: I can't find documentation for the DOM classes anywhere -- only the category additions. It seems strange that it wouldn't exist. Is it hiding somewhere? Googling for "site:developer.apple.com DOMHTMLDocument" returns zero results. ]

    - Scott
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: why there is a memory leak in this method?
      • From: Chris Ridd <email@hidden>
References: 
 >why there is a memory leak in this method? (From: Leo <email@hidden>)

  • Prev by Date: Re: Re: why there is a memory leak in this method?
  • Next by Date: Re: why there is a memory leak in this method?
  • Previous by thread: why there is a memory leak in this method?
  • Next by thread: Re: why there is a memory leak in this method?
  • Index(es):
    • Date
    • Thread