我在以下代码中遇到错误,例如未声明的“ScriptNotify”
-(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];
}
}
如何解决这个问题?有什么想法吗?