Re: A quick memory (release) question
Re: A quick memory (release) question
- Subject: Re: A quick memory (release) question
- From: Camillo Lugaresi <email@hidden>
- Date: Tue, 31 Jan 2006 23:29:10 +0100
On 31/gen/06, at 10:09, Paul Harvey wrote:
Two quick examples:
1 NSMutableAttributedString *ns = [[NSMutableAttributedString
alloc]initWithString: chapterText];
2 NSString *lookFor = [[NSString alloc]initWithFormat:@"\n%d",i];
The rule for memory management says that if you obtain an object
through alloc, you have retained it and it must be manually
released at a later point.
Yet methods like initWithFormat create an autoreleased object don't
they?
Trying to be a Good Programmerâ„¢ I was releasing the objects myself
but that caused problems with my app, yet the problem has gone now
i've removed these lines.
You have a bug elsewhere. Put the release calls back in and find the
real bug.
Camillo _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden