Correct way to load image into UIWebView from NSData object

前端 未结 10 2075
北恋
北恋 2020-12-03 05:26

I have downloaded a gif image into an NSData object (I\'ve checked the contents of the NSData object and it\'s definitely populated). Now I want to load that image into my U

10条回答
  •  无人及你
    2020-12-03 05:49

    To expand on Ed Marty's comment:

    The HTML command to put in a base 64 image is:

    
    

    I have a category (I'm not sure where it came from, not me...) available on my website that converts NSData to it's Base64 string representation.

    Header Implementation

    Easy enough to do, assuming 'imageData' is the NSData variable containing your image: [imageData base64Encoding] into the above string.

提交回复
热议问题