我正在尝试在给定链接的帮助下获取令牌。请通过此链接http://www.stevesaxon.me/posts/2011/window-external-notify-in-ios-uiwebview/
这是什么_data
?如何声明?
-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
{
if(_data)
{
[_data release];
_data = nil;
}
}
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
if(!_data)
{
_data = [data mutableCopy];
}
else
{
[_data appendData:data];
}
}
-(void)connectionDidFinishLoading:(NSURLConnection *)connection
{
if(_data)
{
NSString* content = [[NSString alloc] initWithData:_data
encoding:NSUTF8StringEncoding];
[_data release];
_data = nil;
// prepend the HTML with our custom JavaScript
content = [ScriptNotify stringByAppendingString:content];
[_webView loadHTMLString:content baseURL:_url];
}
}