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

Re: Constant NSArray Count


  • Subject: Re: Constant NSArray Count
  • From: Nathan Kinsinger <email@hidden>
  • Date: Sat, 20 Sep 2008 18:27:01 -0600

On Sep 20, 2008, at 4:53 AM, Alex Mills wrote:

Hey,

Yeah I have been reading through a bit of it. At the moment I have an NSArrayController setup in IB to access a Core Data Entity. A table view is then connected to that Array Controller to display the contents of it. This is all done without any code written by myself so I'm pretty new to working with these objects programatically. I need code that will recognize when the selection count of my table view changes, if that count is 0 it will display tab 1, if the selection count is 1 or more it will display tab 2. Right now I have an IBAction that will do this but requires me to press a button for the count check to be performed, what do you think would be the best way to implement this idea?

This is the IBAction:

-(IBAction)checkCount: sender;
{
	NSArray *selectedObjects = [propertyTableController selectedObjects];
	NSUInteger count = [selectedObjects count];
	if (count == 0)
	{
		[newTabView selectTabViewItemWithIdentifier:@"2"];
	}
	else
	{
		[newTabView selectTabViewItemWithIdentifier:@"1"];
	}
	return;
}

Cheers
Alex Mills

You might want to look at the tableViewSelectionDidChange: delegate method of NSTableView.
http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/ApplicationKit/Classes/NSTableView_Class/Reference/Reference.html#/ /apple_ref/occ/instm/NSObject/tableViewSelectionDidChange:



--Nathan



_______________________________________________

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: 
 >Constant NSArray Count (From: Alex Mills <email@hidden>)
 >Re: Constant NSArray Count (From: Nick Zitzmann <email@hidden>)
 >Re: Constant NSArray Count (From: Alex Mills <email@hidden>)
 >Re: Constant NSArray Count (From: Jason Coco <email@hidden>)
 >Re: Constant NSArray Count (From: Alex Mills <email@hidden>)

  • Prev by Date: Re: cocoa, Iphone and NDA
  • Next by Date: escaping a string
  • Previous by thread: Re: Constant NSArray Count
  • Next by thread: Text View with fixed width
  • Index(es):
    • Date
    • Thread