• 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: NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView


  • Subject: Re: NSTableView
  • From: Jeremy <email@hidden>
  • Date: Thu, 28 Feb 2008 19:51:18 -0500

Thanks about the memory leaks and about the allocating memory and stuff. And I thought that might be my problem but I am not sure how to actually use that method. The documentation was very vague in my opinion.

Jeremy
"For a long time it puzzled me how something so expensive, so leading edge, could be so useless, and then it occurred to me that a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match." - Bill Bryson



On Feb 28, 2008, at 7:49 PM, Nick Zitzmann wrote:


On Feb 28, 2008, at 5:41 PM, Jeremy wrote:

In awakeFromNib:

categoriesArray = [[[NSMutableArray alloc] init] retain];

Here you're over-retaining an NSArray. This won't do anything if you're using GC, but if you're not, then you've created a memory leak.


	NSString *string;
	string = [NSString init];

Never initialize a variable without allocating it memory first.

string = @"Main Category";

Here you've overwritten a variable you just (incorrectly) initialized. If all you want is a string, then you can do this:


NSString *string = @"Main Category";

[...]
The NSTableView is not being populated at all... No rows, and nothing else....


Did you remember to set the table view's data source?

Nick Zitzmann
<http://www.chronosnet.com/>


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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


References: 
 >NSTableView (From: Jeremy <email@hidden>)
 >Re: NSTableView (From: "Hamish Allan" <email@hidden>)
 >Re: NSTableView (From: Jeremy <email@hidden>)
 >Re: NSTableView (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: NSTableView
  • Next by Date: Re: NSTableView
  • Previous by thread: Re: NSTableView
  • Next by thread: Re: NSTableView
  • Index(es):
    • Date
    • Thread