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

Constant NSArray Count


  • Subject: Constant NSArray Count
  • From: Alex Mills <email@hidden>
  • Date: Fri, 19 Sep 2008 23:15:32 +0800

Hey,

I'm rather new to cocoa (and programming in general) and I'm working on a core data project that uses a tab view to display different attributes of an entry. I'm trying to code it so that if no items are selected in the list it will display a tab, otherwise display a different tab. I have this working as an IBAction but I want it to run all the time so that it will control the tabs whenever the selection count of the Array changes, how can I do this?

This is the IBAction that I want to run all the time:

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

I also want a similar setup to count the number of items in the array, so that if the user hasn't created anything 'Tab 1' will displayed, if there is at least one created item 'Tab 2' will be displayed. If you guys know of a better way to do the above procedure please let me know.

Cheers
Alex Mills


_______________________________________________

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


  • Follow-Ups:
    • Re: Constant NSArray Count
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: NSOperationQueue
  • Next by Date: Text View with fixed width
  • Previous by thread: Re: how to set Document type and its icon programatically
  • Next by thread: Re: Constant NSArray Count
  • Index(es):
    • Date
    • Thread