Constant NSArray Count
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