I have a tabView with let's say 3 tabs, each of the tabViewItems contains a webView. I want to set the title of each tab as the document.title
of the HTML page each webView is rendering.
So basically, each NSTabViewItem
has a Webview
, via [tabViewItem setView:webView];
.
Now, on the didFinishLoadForFrame
delegate of the webviews, I can retrieve the title of the HTML page by doing a NSString *title = [sender stringByEvaluatingJavaScriptFromString:@"document.title"]
. I only have access to the sender
object, so my question is how can I get the NSTabViewItem
containing my sender. In other words, what should I put inside the < >
s
[<getNSTabViewItemFromSender:sender> setLabel:title]