PDA

View Full Version : Webkit




mack255
May 6, 2009, 12:43 PM
Hey can anyone please tell me how i can tell webkit to load a webpage like www.macrumors.com or something like any help would be apprecaited but please dont do stuff like let me googled that for you i have googled it



Spike099
May 6, 2009, 12:50 PM
hey, pretty simple

this following code ASSUMES "webView" is of type "WebView".
I've linked mine as an IBOutlet.

This is a convenience function for me, where the url is a NSString not a NSUrl. Hope it helps.

- (void)gotoURL:(NSString*)url {
[[webView mainFrame] loadRequest:[NSURLRequest requestWithURL:
[NSURL URLWithString:url]]];
}

mack255
May 6, 2009, 09:35 PM
What am i doing wrong here

robbieduncan
May 7, 2009, 03:02 AM
What am i doing wrong here

We don't know: you haven't shown us any code or told us what you are doing. We are not mind readers. If you mean download as in retrieve the HTML source for the page then you can just use a NSURLConnection instead.

mack255
May 7, 2009, 07:53 AM
I'm sorry i forgot to show the picture

robbieduncan
May 7, 2009, 08:05 AM
1) WebView is a classname. Not an instance of that class. You need to send that message to a valid instance. If you don't understand what that means stop. Go a learn the basics of OOP then C then Objective-C the Cocoa

2) urlwww.facebook.com is a meaningless token. If you are trying to define the URL as a string you need something like @"http://www.facebook.com".

From what you've posted I suggest you need to go off and learn the basics before you try writing anything.

mack255
May 7, 2009, 08:10 AM
I tryed your idea it worked but now it wont load no errors

robbieduncan
May 7, 2009, 08:13 AM
I tryed your idea it worked but now it wont load no errors

Treat all warnings as errors. The first warning is a fundamental error in your coding style and understanding: go away and learn the difference between a class and an instance.

mack255
May 7, 2009, 09:36 AM
Dude im only 12 settle the freak dowm

robbieduncan
May 7, 2009, 09:41 AM
Dude im only 12 settle the freak dowm

I am perfectly calm. I am trying to help you and do you a favour. I will not bother in future as clearly you are unable to show gratitude or take advise from a professional programmer.

My last word: learn to walk before you try to run.