Women in Technology

Hear us Roar



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ą!

Full Threads Oldest First

Showing messages 1 through 5 of 5.

  • Code for google search:
    2010-01-23 13:52:15  dpagek [View]

    Sorry, but I just started using xcode, and I have everything right up until the part where you have to create the actions and outlets then connect them. I know how to do the ctr-click line thing, but I have no idea how what actions or outlets to add. Please reply.
  • Code for google search:
    2010-01-23 13:52:03  dpagek [View]

    Sorry, but I just started using xcode, and I have everything right up until the part where you have to create the actions and outlets then connect them. I know how to do the ctr-click line thing, but I have no idea how what actions or outlets to add. Please reply.
  • Soz, i'm a noob
    2009-08-30 07:26:18  ProcEnforce [View]

    Where do you put code in the .m file?
  • Noob
    2009-08-30 07:26:03  ProcEnforce [View]

    Where do you put code in the .m file?
  • Code for google search:
    2009-08-30 07:25:58  ProcEnforce [View]

    Where do you put code in the .m file?