Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 9, 2007, 03:43 PM   #1
xcoder78
macrumors newbie
 
Join Date: Jul 2007
Xcode: Google searchbar in Browser?

Hi again, I was wondering if someone could tell me how to get a Google Search Bar in Xcode onto my Browser
xcoder78 is offline   0 Reply With Quote
Old Jul 9, 2007, 03:53 PM   #2
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
You realise this is not a one-line of code thing. I suggest you start reading the documentation!
robbieduncan is offline   0 Reply With Quote
Old Jul 9, 2007, 04:07 PM   #3
grabberslasher
macrumors 6502
 
Join Date: Aug 2002
Location: Éire
Assuming your search field is an outlet in the nib file and is called "mySearchBar"

Code:
NSString *searchURL = [NSString stringWithFormat:@"http://www.google.com/search?q=%@", [mySearchBar stringValue]];
Then you just load that URL in your web view.

Code:
[[myWebView mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString: searchURL]]];
This is a simple example, you can probably work from here
grabberslasher is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
iPhone: Anyone using Google Chrome with browser changer? ntegra Jailbreaks and iOS Hacks 11 Mar 5, 2013 02:41 PM
Google Chrome Browser, Google Drive Coming to iOS [Now Available] MacRumors MacRumors.com News Discussion 453 Dec 16, 2012 08:12 PM
Google browser johnchart iPad Tips, Help and Troubleshooting 0 Nov 29, 2012 09:06 AM
can you get google maps and google streetview over iOS chrome browser? PacificBeach iPhone 1 Jun 30, 2012 03:42 PM
Boycott the Google Chrome browser. AbyssImpact Wasteland 55 Jun 30, 2012 04:20 AM

Forum Jump

All times are GMT -5. The time now is 11:13 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC