Odd error messages when using WebView

jerry porter jep9816 at yahoo.com
Wed Nov 14 05:52:03 PST 2007


Hello,

I just finished upgrading an app from Tiger to Leopard and I am getting a bunch of errors (listed at the bottom of this message) when I load html in a WebView.

I get the same errors regardless if I load file with html or just plain ext with no html markup.

The html renders just fine.

Also when I load web pages from external sites I don't get the error messages when the page is loaded just when I click on a link.

This is the code I am using to load the html:

- (void)_locateElementHelpTip
{
    NSBundle *aBundle = [NSBundle mainBundle];
    NSString *aPath = [aBundle pathForResource: [self elementHelpTip] ofType: @"html" inDirectory: @"ElementTipHelp"];
    NSString *message = @"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"><html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"MainStyle.css\"><title>Not Found Page</title></head><body><h2>Document Not found!</h2><h3><a href=\"index.html\">Index</a></h3></body></html>";
    NSURL *baseURL = [NSURL fileURLWithPath: [aBundle pathForResource: @"index" ofType: @"html" inDirectory: @"ElementTipHelp"]];

    if(aPath == nil)
    {
        [[webView mainFrame] loadHTMLString: message baseURL: baseURL];
    else {
        NSURL *url = [NSURL fileURLWithPath: aPath];
        if(url != nil)
            [[webView mainFrame] loadRequest: [NSURLRequest requestWithURL: url]];
        else
            [[webView mainFrame] loadHTMLString: message baseURL: baseURL];
    }
}


Any ideas?


Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextSetFillColorWithColor: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextSetStrokeColorWithColor: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextSetTextMatrix: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextSetFont: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextSetFontSize: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextGetShouldSmoothFonts: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextSetFontRenderingStyle: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextSetStyle: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextSetCharacterSpacing: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextSetTextPosition: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextShowGlyphsWithAdvances: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextSetFillColorWithColor: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextSetStrokeColorWithColor: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextSetTextMatrix: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextSetFont: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextSetFontSize: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextGetShouldSmoothFonts: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextSetFontRenderingStyle: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextSetFillColorWithColor: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextSetStrokeColorWithColor: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextSaveGState: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextSetStyle: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextSetTextPosition: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextShowGlyphsWithAdvances: invalid context
Tue Nov 13 18:16:29 MyHostName MyAppName[20733] <Error>: CGContextRestoreGState: invalid context



Jerry Porter
IT Distribution MS 34-202
Lincoln Financial Group
One Commerce Square
2005 Market Street
Philadelphia, PA 19103
(215) 255-7031





      ____________________________________________________________________________________
Get easy, one-click access to your favorites. 
Make Yahoo! your homepage.
http://www.yahoo.com/r/hs 
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (Xcode-users at lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/jep9816%40yahoo.com

This email sent to jep9816 at yahoo.com


      ____________________________________________________________________________________
Be a better pen pal. 
Text or chat with friends inside Yahoo! Mail. See how.  http://overview.mail.yahoo.com/


More information about the MacOSX-dev mailing list