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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to