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

DeviledMoon

macrumors newbie
Original poster
Oct 13, 2010
7
0
Hey Guys,

Im working on a web app for my mac's that i might release out to everyone when i finish up what im doing with it.

but heres my issue, i cant seem to find a way to load a url into the Web View Component...

Could anyone give me an example of how i can do this?

Thanks,
DeviledMoon
 
Hey Guys,

Im working on a web app for my mac's that i might release out to everyone when i finish up what im doing with it.

but heres my issue, i cant seem to find a way to load a url into the Web View Component...

Could anyone give me an example of how i can do this?

Thanks,
DeviledMoon

Connect the UIWebView from your IB to your controller by making a property.

Then use this:

Code:
NSURL *url = [[NSURL alloc] initWithString:@"http://myurl"];
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
[[webBrowser mainFrame] loadRequest:request];
 
Connect the UIWebView from your IB to your controller by making a property.

Then use this:

Code:
NSURL *url = [[NSURL alloc] initWithString:@"http://myurl"];
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
[[webBrowser mainFrame] loadRequest:request];


Thanks Man, Worked Wonders :D
 
and don't forget to release those objects, or you'll have memory leaks.

of course... me and my team just started on the whole apple developer system, we got a lot of apps coming to the mac and iphone/ipod/ipad

i have a basic knowledge of how to develop for the platform, i know enough to get by and kill all the leaks and what not, just some of the stuff in Xcode/cocoa throws me off lol


Thanks for reminding though!

Oh.
Unrelated question, Key commands... lets say i want to use the menu command (OpenApple+Fn+1), how would i detect that? ive look it up on the developer resources from apple, but unfortunately they arent that helpful.
 
Oh.
Unrelated question, Key commands... lets say i want to use the menu command (OpenApple+Fn+1), how would i detect that? ive look it up on the developer resources from apple, but unfortunately they arent that helpful.
I'd suggest a new thread for this since it's quite off-topic. :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.