Note that there are some explanatory texts on larger screens.

plurals
  1. POXib file Linkage and WebViews
    text
    copied!<p>I got a problem that is going on for a week now, i have a webView that i set up, but the xib file doesn't want to link with my controller, i know there is a topic about that but i'm new to objective c and i don't understand a damn thing and i rather want to do it programmatically if someone can show me or help me please.</p> <p>here is my code : </p> <p>.h #import </p> <pre><code>@interface ViewController : UIViewController &lt;UIWebViewDelegate&gt; { IBOutlet UIWebView *myWebView; } @property (nonatomic, retain) IBOutlet UIWebView *myWebView; -(void)PushView; @end </code></pre> <p>.m</p> <pre><code>#import "MyWebViewController.h" @interface ViewController() @end @implementation ViewController @synthesize myWebView = _myWebview; -(void)viewDidLoad; { myWebView = [[UIWebView alloc] initWithFrame:self.view.frame]; myWebView.delegate = self; NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; NSString *defaults = [prefs stringForKey:@"myKey"]; NSString *defaults2 = [prefs stringForKey:@"mySecondKey"]; NSString *username = defaults; NSString *password = defaults2; NSLog(defaults); NSURL* url = [NSURL URLWithString:@"http://www.google.com"]; NSString* body = [NSString stringWithFormat:@"login=%@&amp;password=%@", username, password]; NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:30]; request.HTTPMethod = @"POST"; request.HTTPBody = [body dataUsingEncoding:NSStringEncodingConversionAllowLossy]; [myWebView loadRequest:request]; [super viewDidLoad]; } </code></pre> <p>@end</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload