Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tab View Delegate



Dear List,

I am having problems getting a tab view delegate to work ( at this point I am not so sure that it is even a delegate I need to use). The problem is that I have a tab view in a window. Each of the panels on the view has some stuff that I need to clear whenever a I change tabs ( its a few text fields that I need to reset). I thought at first that I just need to use the -(void) tabView: (NSTabView *)tabview didSelectTabViewItem:(NSTabviewItem *)tabViewItem. But 1- I could not get this to work, 2- I don't even think it is what I want.

Below is the code that I have, The delegate for startup works but not for switching tabs. Thanks for the help!

In Contol.h-

@interface Control(NSApplicationNotifications)
-(void)applicationDidFinishLaunching:(NSNotification*)notification;
- (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem;
@end

In Control.m-

@implementation Control(ApplicationNotifications)
- (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem
{
NSLog(@"Tab Switch");
// Do cleanup stuff
}
-(void)applicationDidFinishLaunching:(NSNotification*)notification
{
// Do load stuff
}
@end

==============================================================================
The contents of this message, together with any attachments, are intended only for the use of the person(s) to which they are addressed and may contain confidential and/or privileged information. Further, any medical information herein is confidential and protected by law. It is unlawful for unauthorized persons to use, review, copy, disclose, or disseminate confidential medical information. If you are not the intended recipient, immediately advise the sender and delete this message and any attachments. Any distribution, or copying of this message, or any attachment, is prohibited.
==============================================================================
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.