On Aug 3, 2014, at 2:19 PM, Kyle Sluder <[email protected]> wrote: > On Aug 3, 2014, at 11:11 AM, Daryle Walker <[email protected]> wrote: >> >> I’m adding a combined Back/Forward toolbar button to my web browser project. >> I was going to enable/disable each button half like: >> >> - (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame >> { >> // Ignore notices from sub-frames >> if ((self.webView == sender) && (frame == [sender mainFrame])) { >> [self.toolbarBackForward setEnabled:[sender canGoBack] >> forSegment:kPrGoBackSegment]; >> [self.toolbarBackForward setEnabled:[sender canGoForward] >> forSegment:kPrGoForwardSegment]; >> } >> } >> >> But I was getting problems with the method signatures being unrecognized. >> Then I realized that the control I dragged from the XIB to the header file >> was a NSToolbarItem*, not the NSSegmentedControl* I was expecting. How do I >> get to that inner control? (Hopefully without wasting time making a >> subclass.) > > The `view` property of NSToolbarItem is pretty clearly documented.
I just noticed that myself. Is “(NSSegmentedControl *)self.toolbarBackForward.view”, a cast to a (2 layers down) subclass, the way you’re supposed to access the control’s stuff? It looks like a hack, but I’ll take it since it (seemingly) works. — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
