Re: why there is a memory leak in this method?
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