cocoa - Managing subviews from superview? -



have window content view. load subview on different nib file programmatically. there way change on subview can captured controls on window's content view?

for instance, have tableview on subview. if selection of tableview changes, want enable button on windows's content view. possible? if yes, please guide..

thanks in advance..

there few ways

you can set object creates subview delegate tableview , implement tableviewselectiondidchangein object.

or can subscribe nstableviewselectiondidchangenotification notification, passing tableview:

[[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(tableviewselectiondidchange:) name:nstableviewselectiondidchangenotification object:tableview]; 

and handle in :

- (void)tableviewselectiondidchange:(nsnotification *)anotification {     nstableview *tableview = (nstableview *)anotification.object;     nslog(@"selection changed: %i", [tableview selectedrow]); } 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -