|
|
#1 |
|
Google Search Bar in Browser
could someone please help me figure out how to put a google search bar in the web browser I'm making in xcode.
Last edited by Programmer; Jun 18, 2009 at 04:11 PM. |
|
|
|
0
|
|
|
#2 |
|
hmm. select View, then 'customize toolbar', then drag it and drop it....
__________________
Live simply so that others may simply live... -Gandhi |
|
|
|
0
|
|
|
#3 |
|
You are using Safari, right?
__________________
15" MacBook Pro 8GB/1TB; 13" MacBook Air i7, 1.8 Ghz; 32GB Black iPhone 4 ; iPad 2 BK/64GB/WiFi
|
|
|
|
0
|
|
|
#4 |
|
__________________
Live simply so that others may simply live... -Gandhi |
|
|
|
0
|
|
|
#5 |
|
xcode
no i'm i am trying to program it into my web browser i'm making in xcode.
|
|
|
|
0
|
|
|
#6 | |
|
Quote:
In either case, you'll want to set yourself up as a delegate of a second NSTextField, do something like this when you receive textDidEndEditing: from it: Code:
NSString *searchURL = [NSString stringWithFormat:@"http://www.google.com/search?q=%@", [googleField stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; The main observations are merely that you need to: (i) escape the search string (eg, to turn a space into %20 so that it works in a URL); and (ii) add http://www.google.com/search?q= to the start to turn it into a Google search URL. Then just treat that identically to a URL directly entered by the user. |
||
|
|
0
|
|
|
#7 |
|
Thanks
thanks
what i'v been having trouble with is when i try to retrieve the text from the google search bar in the .h file then do the @synthesize in the .m file to put it into this string of code [HTML]NSString *searchURL = [NSString stringWithFormat:@"http://www.google.com/search?q=%@", [GoogleSearchField stringValue]];[/HTML] i am used to programing on the iphone this is what i would normally do so i don't know if it is different on a mac |
|
|
|
0
|
|
|
#8 |
|
url field problem
i'm making a web browser but when i run this code
- (BOOL)textFieldShouldReturn UITextField *)textField{ NSString *searchURL = [NSString stringWithFormat:@"http://", [urlField stringValue], NSString stringWithFormat:@".com"]; [textField resignFirstResponder]; [myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[textField text]]]]; return YES; } i get this [HTML]Expected expression before NSString[/HTML] can anyone help |
|
|
|
0
|
|
|
#9 |
|
First (and we really need to sticky this for this forum), if you're going to include cope snippets, please enclose them in [ CODE ][ /CODE ] tags (spaces removed). These tags are easily accessed via the # icon in the toolbar.
Second, your problem starts here: Code:
- (BOOL)textFieldShouldReturnUITextField *)textField Code:
- (BOOL)textFieldShouldReturn:(UITextField *)textField Code:
NSString *searchURL = [NSString stringWithFormat:@"http://", [urlField stringValue], NSString stringWithFormat:@".com"]; Code:
NSString *searchURL = [NSString stringWithFormat:@"http://%@%@", [textField text], @".com"];
__________________
|
|
|
|
0
|
|
|
#10 | |
|
Quote:
What you want is Code:
NSString *searchURL = [NSString stringWithFormat:@"http://%@.com", [urlField stringValue]]
__________________
*** -[NSAutoreleasePool autorelease]: Cannot autorelease an autorelease pool |
||
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| thread | Thread Starter | Forum | Replies | Last Post |
| Google search bar in safari | nalk7 | iPad | 6 | Sep 1, 2010 01:30 PM |
| Google search suggestions in Search Bar | tejaykay | iPhone Tips, Help and Troubleshooting | 0 | Jul 28, 2010 10:42 AM |
| Safari google search bar how to change to uk searches | chipandegg | Mac OS X | 1 | May 23, 2009 02:30 AM |
| Clearing Google search bar in Safari 4? | Learjet035 | Mac Applications and Mac App Store | 1 | Mar 4, 2009 05:48 PM |
| Safari - Text fill in Google Search Bar? | meagain | Mac OS X | 0 | Jul 2, 2007 10:59 PM |
All times are GMT -5. The time now is 06:54 PM.






15" MacBook Pro 8GB/1TB; 13" MacBook Air i7, 1.8 Ghz; 32GB Black iPhone 4 ; iPad 2 BK/64GB/WiFi

UITextField *)textField
I support the
Linear Mode

