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 tableviewselectiondidchange
in 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
Post a Comment