Article:
 |
|
BYOB: Build Your Own Browser
|
| Subject: |
|
Code for google search: |
| Date: |
|
2009-07-27 16:43:22 |
| From: |
|
macindev
|
|
|
In the header (.h) file:
(add between the { } brackets)
IBOutlet id searchQuery;
(add before the @end)
- (IBAction)connectSearch:(id)sender;
In the .m file:
- (void)connectSearch:(id)sender{
[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:
[@"http://www.google.com/search?q=" stringByAppendingString:[searchQuery stringValue]]]]];
}
Then just hook up the outlets and actions in Interface Builder to the search bar, and voilą!
|
Showing messages 1 through 5 of 5.
-
Code for google search:
2010-01-23 13:52:15
dpagek
[View]
-
Code for google search:
2010-01-23 13:52:03
dpagek
[View]
-
Soz, i'm a noob
2009-08-30 07:26:18
ProcEnforce
[View]
-
Noob
2009-08-30 07:26:03
ProcEnforce
[View]
-
Code for google search:
2009-08-30 07:25:58
ProcEnforce
[View]