2

I want load the html data in webview. At the button click, it open the viewcontroller and load the html data in this viewcontroller (add web view in this view controller using Interface builder). When the html data not proper loading and i press the back button, at that time crash the app. i am not doing allocation & init webview in the coding. set IBOUTLET using Interface builder & bind it.

- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
    [connection release];
    NSString *strResponce = [[NSString alloc] initWithData:jsonData_Info encoding:NSUTF8StringEncoding];
    [jsonData_Info release];
    NSError *error;
    SBJSON *json = [[SBJSON new] autorelease];
    self.jsonArray_Info=[json objectWithString:strResponce error:&error];
    str_InfoDetail = [[self.jsonArray_Info objectAtIndex:0] valueForKey:@"Page"];
    str_html = [NSString stringWithFormat:@"%@",str_InfoDetail];
    NSString *temp;
    temp = [NSString stringWithFormat:@"<html><head><style>body{background-color:transparent;}</style></head><body><span style='color:white'>%@</span></body></html>",str_html];
    //web_Information = [[UIWebView alloc]init];
    web_Information.backgroundColor=[UIColor clearColor];
    web_Information.opaque= NO;

    [web_Information loadHTMLString:temp baseURL:nil];  
    [act stopAnimating];
    [strResponce release];  
}

please give me any solution.

thanks.

Jhaliya - Praveen Sharma
  • 31,697
  • 9
  • 72
  • 76
Sam007
  • 1,385
  • 3
  • 17
  • 32

1 Answers1

0

Pls post some code and crash log if you need answers. By the look of it I think it may be because of implementation of UIWebView delegate in your class. I think when you navigate back you do not make the delegate nil which can cause the app to crash

visakh7
  • 26,380
  • 8
  • 55
  • 69