Professional Web Applications Themes

Cocoa WebKit and files in memory - Mac Programming

Hello NG I want to display some content ( images and text ) with the webview control. The data of the images is stored in a NSData instance. Can I show these data whithout writing the images into a file ? If yes, how will that be referd in javascript or html? Question 2: I want to store some css files and some images into the app tree.How can I resolve the path to these files to show them with webview ? Thank you for your time and help...

  1. #1

    Default Cocoa WebKit and files in memory

    Hello NG
    I want to display some content ( images and text ) with the webview control.
    The data of the images is stored in a NSData instance. Can I show these data
    whithout writing the images into a file ? If yes, how will that be referd in
    javascript or html?
    Question 2:
    I want to store some css files and some images into the app tree.How can I
    resolve the path to these files to show them with webview ?

    Thank you for your time and help


    Florian Guest

  2. #2

    Default Re: Cocoa WebKit and files in memory

    In article <40387526$0$17577$arcor-online.net>,
    de says... 

    I'm trying to do something similar myself. I asked on the webkitsdk list
    and was pointed towards NSURLProtocol. So far I have made my own class
    derived from NSURLProtocol and registered it. It works in as far as URLs
    like: 'mycustomprotocol://foo/bar/poot.html' are recognised by my
    protocol class and I get as far as the -startLoading method being
    called.

    I can fill up an NSData at this point but I don't know how to tell the
    URL loading mechanism to use it. I'm currently prodding around
    NSURLProtocolClient in the hope that some good will come of it.

    I find the doentation of NSURLProtocol and NSURLProtocolClient a bit
    dry. Some samples or even just a discussion on how they should be used
    would be nice! If anyone can give the OP and myself some clues they
    would be much appreciated.
    James Guest

  3. #3

    Default Re: Cocoa WebKit and files in memory

    In article <Individual.NET>,
    net says...
     

    Yey! Found an example:
    /Developer/Examples/WebKit/PictureBrowser/

    Take a look at how the PictureBrowserProtocol class is implemented and
    used.

    My lesson for today is: if you've been had no luck searching Apple's
    site and the Xcode docs try:

    grep -rs <NSHowDoesThisWork> /Developer/Examples/

    and you might get lucky...
    James Guest

Similar Threads

  1. Cocoa memory trouble
    By Lorenzo in forum Mac Programming
    Replies: 2
    Last Post: December 12th, 01:54 AM
  2. webkit SDK Refuses to Install -- Why?
    By MacGuy in forum Mac Programming
    Replies: 3
    Last Post: November 30th, 06:56 AM
  3. newbie cocoa file reading/writing files
    By Richard Humiston in forum Mac Programming
    Replies: 1
    Last Post: July 21st, 02:42 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139