Re: some crash i can not explain.
Re: some crash i can not explain.
- Subject: Re: some crash i can not explain.
- From: Andrew Farmer <email@hidden>
- Date: Mon, 23 Oct 2006 12:26:22 -0700
On 23 Oct 06, at 12:10, Sandro Noel wrote:
First off, thank you Nick.
I corrected every location where i had made the mistake,
but i still get the runtime error, in this block of code.
-(int)addName:(NSString *)name{
ADTreeViewItem *item = [[ADTreeViewItem alloc]init];
[item setDisplayString:name];
[arrayofNames addObject:item];
return [arrayOfNames count];
}
I was thinking that the "item" variable was not in a good place,
and was released after the function ended,and that might cause
problems but then i red up on Array's and they retain objects, so
it should not matter where the object is allocated from.
[arrayofNames addObject:item];
this somehow crashes the app without an error message in the NSLog.
Any help on this would be greatly appreciated!
and thank again! learning cocoa this far is fun :)
Read the Cocoa memory guidelines. I think there are some points
you're still a little unclear on.
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/
MemoryMgmt.html
_______________________________________________
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