views:

430

answers:

1
[[self mainFrame] loadHTMLString:@"<html><body><link href='main.css' rel='stylesheet' type='text/css' /></body></html>" baseURL:nil];

I am trying to load a css file called main.css from the application Resources folder as below from a WebView, how do i get the path of the resources folder correct so i can load the css?

+1  A: 

Just take a look at the NSBundle class:
http://developer.apple.com/mac/library/documentation/cocoa/reference/foundation/Classes/NSBundle_Class/Reference/Reference.html

[ [ NSBundle mainBundle ] pathForResource: @"file" ofType: @"css" ]

sorry for the bad formatting... Replied from my iPhone...

Macmade
perfect, thanks
ADAM