Okay, so I can get it to work except for the webview. I'm just trying to pull up Google in it right now.
I have it doing it when I click a button but it's not working. Here's my code...
Then on down below that, I have it releasing:Code:#import "ViewController.h" @implementation ViewController @synthesize textField; @synthesize label; @synthesize string; @synthesize pictureWebView; - (IBAction)updateList:(id)sender { // Tell the UIWebView to load the page NSString *webLink = @"http://www.google.com"; NSURL *webURL = [NSURL URLWithString:webLink]; NSURLRequest *requestStory = [NSURLRequest requestWithURL:webURL]; [pictureWebView loadRequest:requestStory]; self.string = textField.text; NSString *nameString = string; if ([nameString length] == 0) { nameString = @"<"; } NSString *update = [[NSString alloc] initWithFormat:@"Store # %@", nameString]; label.text = update; [update release]; } - (BOOL)textFieldShouldReturn:(UITextField *)theTextField { if (theTextField == textField) { [textField resignFirstResponder]; } return YES; }
And here's the h file...Code:- (void)dealloc { [textField release]; [label release]; [string release]; [pictureWebView release]; [super dealloc]; }
FINALLY...one question.Code:#import <UIKit/UIKit.h> @interface ViewController : UIViewController { UITextField *textField; UILabel *label; NSString *string; UIWebView *pictureWebView; } @property (nonatomic, retain) IBOutlet UITextField *textField; @property (nonatomic, retain) IBOutlet UILabel *label; @property (nonatomic, copy) NSString *string; @property (nonatomic, retain) UIWebView *pictureWebView; - (IBAction)updateList: (id)sender; @end
Is there like a "page load" kind of event where I can load up an initial default page in the webview before I try passing it a "Store #"? Hope that made sense.



LinkBack URL
About LinkBacks
Reply With Quote
