我的 CustomClass1 中有一个属性:@property(assign)NSString *url;
- (void)webView:(WebView *)webView decidePolicyForNewWindowAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request newFrameName:(NSString *)frameName decisionListener:(id < WebPolicyDecisionListener >)listener{
_url= [[request URL] absoluteString] ;
NSLog(@"requested url is %@",_url);
NSInteger index=[_tabView numberOfTabViewItems];
NSTabViewItem *newItem=[[NSTabViewItem alloc] init];
[_tabView insertTabViewItem:newItem atIndex:index];
[newItem setLabel:@"Empty Tab" ];
//[_tabView selectPreviousTabViewItem:@"select"];
[self initializeWebView:newItem];
[[_tabView .tabViewItems objectAtIndex:index] setView:[newVC view]];
// NSLog(@"requested url is %@",url);
}
-(void)awakeFromNib{
CustomClass1 *obj=[[CustomClass1 alloc] init];
NSLog(@"url is %@",[obj url]);
[[_newWebView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:obj.url]]];
}
如何在 Viewcontroller 类的 awakefromnib 方法中获取 _url 的值?NSlog 返回 null。我该如何解决这个问题?请帮帮我