Page 1 of 1

xcode help??

Posted: Thu Nov 19, 2009 8:28 am
by [Vk]Pulse!
i have made some files like a web browser is there a way to set the home page?

or make the search bar search?? pls reply

Re: xcode help??

Posted: Thu Nov 19, 2009 8:49 am
by Altimit01
For the homepage you'll want to store it as a persistent file somewhere and have your browser open and read the url every time a new window is opened. For google search the format is pretty simple. At the most basic it's:

Code: Select all

http://www.google.com/search?hl=en&q=SEARCH_TERM
where SEARCH_TERM is a single term. You can have several by putting + symbols between the terms. I couldn't find any API stuff for using it in an app, but google does have information on how to do custom site search here.

Re: xcode help??

Posted: Thu Nov 19, 2009 9:52 am
by [Vk]Pulse!
what?

Re: xcode help??

Posted: Thu Nov 19, 2009 11:21 am
by Altimit01
You said you made a web browser right? I'm giving you some advice on how to implement the browsing features you talked about. The way you would set up a homepage is by storing the data in a file accessible by your program. The way you would use a search bar is by parsing the text in the field, generating a search url (I gave an example with google) and then simply go to that site.

Re: xcode help??

Posted: Thu Nov 19, 2009 2:44 pm
by Dirk
NSString *search_term_formating = [NSString stringByReplacingOccurrencesOfString:@" " withString:@"+"];
NSString *the_search_term = [NSString stringWithFormat:@"http://www.google.com/search?hl=en&sour ... _formating];

Re: xcode help??

Posted: Thu Nov 19, 2009 3:54 pm
by [Vk]Pulse!
ya but where do u put the code in?

Re: xcode help??

Posted: Thu Nov 19, 2009 4:23 pm
by nil
It seems like you're getting way ahead over yourself, especially considering you named the topic "xcode help." You're asking a very general question, with not saying what attempts you have made to solve your problem, and no mention of what tools you're actually using (xcode says _very_ little.).

If you weren't able to understand alt's general response to your general question, or where to use Dirk's code snippet, then perhaps you should consider starting smaller.

Re: xcode help??

Posted: Thu Nov 19, 2009 4:29 pm
by Dirk
What nil said. Get yourself Hillegass' "Cocoa Programming for Mac OS X" off of amazon and start reading.

Re: xcode help??

Posted: Thu Nov 19, 2009 5:29 pm
by [Vk]Pulse!
i have made the app (a web browser) so can some1 tell me where i put the code in?

Re: xcode help??

Posted: Thu Nov 19, 2009 5:50 pm
by kiddten
in your source code

Re: xcode help??

Posted: Thu Nov 19, 2009 7:28 pm
by Jrr51
[VK]Pulse! wrote:i have made the app (a web browser) so can some1 tell me where i put the code in?
That's like saying, "I made a picture, where should I add more colors?" You give so little information that the question becomes so general that no one can answer it in the way that you want.

Re: xcode help??

Posted: Thu Nov 19, 2009 9:20 pm
by Dirk
To me it sounds like you just hooked up UI elements so they require no code. That is no how you want to do this....Like I said, get the book.