Re: strange problem with NSOutlineView
Re: strange problem with NSOutlineView
- Subject: Re: strange problem with NSOutlineView
- From: "Alastair J.Houghton" <email@hidden>
- Date: Fri, 3 Oct 2003 11:08:53 +0100
On Friday, October 3, 2003, at 07:35 am, Nikolay Ilduganov wrote:
static DataSource *datasource;
void callback(char *name)
{
[datasource addName:name];
}
@implementation DataSource
- (id)init
{
self = [super init];
names = [NSMutableArray arrayWithCapacity: 1];
^^^^^^^^^^^
That's your problem. You need to either do
names = [[NSMutableArray alloc] initWithCapacity:1];
or retain your array
[names retain];
because +arrayWithCapacity: returns an autoreleased object.
You don't need to retain "bsd_name" in your -addName: method.
Have a read of section 3.1.1 of my FAQ, which you can find at
http://www.alastairs-place.net/cocoa/faq.txt
Kind regards,
Alastair.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.