Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

subrodrigh

macrumors newbie
Original poster
Dec 19, 2008
4
0
I am programming a simple browser in xcode, there is no URL box or buttons, a simple application that would when launched would load up a specified URL that i chose. Kinda like the iTunes store, you can't see it and cant right click on anything.

But the problem is i have put the safari app in the window, and disabled resizing, but i cannot think how to specify a default URL.

My first time using xcode and its brill, o easy to use but just can't think of this one lol. I don't have any knowledge of coding so please help.

Thanks for your help everyone.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Don't mix up Xcode and Interface Builder. IB is for creating a UI. Xcode is where you actually write the code. If IB doesn't have an option for setting the default URL then you'd have to write some code. If you don't know how to write code then I suppose it's time to learn :)
 

subrodrigh

macrumors newbie
Original poster
Dec 19, 2008
4
0
Hey

Don't mix up Xcode and Interface Builder.

Accident's Happen, as i explained i have just started using xcode.

Thanks for the advice anyway but it was just a simple question looking for a guide as to how i would do it.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Not an accident, just clarifying the terminology. If you know the terminology, than you can research and ask questions better :)

What exactly are your intentions? Are you wanting to learn programming or just messing around?
 

plinden

macrumors 601
Apr 8, 2004
4,029
142
If I'm not misremembering (I'm not at home so can't check), Hillegass's XCode book (Amazon), (Bookpool) has a sample program (among other useful examples) that uses an embedded browser window.

I recommend that book if you want to learn Cocoa/XCode/Interface Builder.

Like kainjow said, you'll need to add some code to be able to specify a default URL.
 

subrodrigh

macrumors newbie
Original poster
Dec 19, 2008
4
0
Reply

All i am really wanting to do is have a program that people could download from my website that they can open and have a specific page open,
its a music section of my site, i am a total Xcode and IB newbie,
i have been looking on a couple video's on youtube and thats where i got the idea for this.

Just a simple application that you can open and a web page is brought up.

I have the application working fine just now but just don't know how to specify a URL to load up when the application is launched.
I have tried a couple of the help documents suggestions but i am totally confused.

I was just hoping someone might be able to explain what i should do and where to put the code ??

Thanks
 

baka rakuda

macrumors newbie
Dec 21, 2008
1
0
You should checkout the "Webkit Objective-C Programming Guide" in the Xcode documentation.

Specifically the Simple Browser page.

Basically all you need to do is add this code in whatever class file you are loading your web view:

Code:
//create the link to our site
NSString *bakaLink = @"http://blog.bakarakuda.com";
	
//myWebView is the instance of our WebView class
[[myWebView mainFrame] 
   loadRequest:[NSURLRequest 
      requestWithURL:[NSURL URLWithString:bakaLink]]];

That should do it.

I just setup a quick project in about a minute and got this to work, All I have is an AppController class and I've placed this code in the awakeFromNib method.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.