• 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: strange problem with NSOutlineView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >strange problem with NSOutlineView (From: Nikolay Ilduganov <email@hidden>)

  • Prev by Date: Re: cursor ills
  • Next by Date: Re: Packagemaker can't be copied
  • Previous by thread: strange problem with NSOutlineView
  • Next by thread: Re: strange problem with NSOutlineView
  • Index(es):
    • Date
    • Thread