2012-06-09 38 views
0

我使用FB图形api将我的ios应用程序与facebook集成。但当登录 webview弹出时,第一个问题是它没有取消按钮 仍然我已经把按钮应用一个动作,但无法从我来的地方进入该屏幕。用于facebook的FB图形API认证

NSString *url_string = [NSString stringWithFormat:@"https://graph.facebook.com/oauth/authorize?client_id=%@&redirect_uri=%@&scope=%@&type=user_agent&display=touch", facebookClientID, redirectUri, extended_permissions]; 
NSURL *url = [NSURL URLWithString:url_string]; 
NSURLRequest *request = [NSURLRequest requestWithURL:url]; 

CGRect webFrame = [super_view frame]; 

webFrame.origin.y = 0; 
UIWebView *aWebView = [[UIWebView alloc] initWithFrame:webFrame]; 
[aWebView setDelegate:self];  
self.webView = aWebView; 

UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 
button.frame = CGRectMake(5.0, 10, 150.0, 30.0); 
[button setTitle:@"My Button" forState:UIControlStateNormal]; 
[button addTarget:self action:@selector(myAction:) forControlEvents:UIControlEventTouchUpInside]; 
[self.webView addSubview:button]; 
[aWebView release]; 

[webView loadRequest:request]; 
[super_view addSubview:webView]; 

所以我怎么能回迁请一些身体帮我.....

+0

你的'myAction:'方法是什么样的? – skram

+0

myAction:在这个动作中,我只是想从我的前面去看 –

回答

0

myAction:方法,去除webView

[self.webView removeFromSuperView]; 
+0

我试过这个,但是它只是给我一个空白的屏幕。 –