UIWebView help

Discussion in 'iOS Programming' started by Rappa819, Oct 1, 2009.

  1. Rappa819 macrumors newbie

    Joined:
    Feb 28, 2008
    #1
    So I have my .h and .m files, respectively:

    Code:
    #import <Foundation/Foundation.h>
    
    
    @interface ThisController : UIViewController {
    
    	IBOutlet UIWebView *ThisWebView;
    }
    
    @property (nonatomic, retain) UIWebView *ThisWebView;
    
    @end
    Code:
    #import "ThisController.h"
    
    
    @implementation ThisController
    @synthesize ThisWebView;
    
    - (void)viewDidLoad {
    	[super viewDidLoad];
    	
    	NSString *urlAddress = @"http://www.google.com";
    	
    	//Create a URL object.
    	NSURL *url = [NSURL URLWithString:urlAddress];
    	
    	//URL Requst Object
    	NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
    	
    	//Load the request in the UIWebView.
    	[ThisWebView loadRequest:requestObj];
    }
    
    - (void)dealloc {
    	[ThisWebView release];
        [super dealloc];
    }
    
    @end
    I also have the nib file, views are connected, and the UIWebView controller is connected to ThisWebView.

    When I run the app, I tap on the row of the table that this is associated with and it freezes. I get TERMINATION DUE TO UNCAUGHT EXCEPTION on thread 1. and semaphore wait signal trap on thread 2.

    Does anyone know what this means or knows how to fix it?
     
  2. newlearner macrumors member

    newlearner

    Joined:
    Jul 30, 2009
    Location:
    india
    #2
    nothing seems wrong with the webview code you have posted.
    The error seems to be in your table view.Look into your didSelectRowAtIndexPath delegate defined in your table view controller. Try to put a breakpoint inside this delegate or use NSLog after each statement to see where you are going wrong.
     
  3. Rappa819 thread starter macrumors newbie

    Joined:
    Feb 28, 2008
    #3
    Is there something special I need to do with the table view to load a UIWebView, Again its a table populated with a list of arrays, and each member of the array points to the specific section and row to load a nib file for that item when its selected by the user. It works with any other object (text view, labels, boxes) except when i drop a web view onto the nib, connect everything, and run it, when I click that table item it crashes. I cant figure out whats wrong.
     
  4. Rappa819 thread starter macrumors newbie

    Joined:
    Feb 28, 2008

Share This Page