NSImage with website url

I need to create NSImage from a url and then set it as an image in my application. I tried the code that I found on the Internet, but it did not work. If anyone knows how to do this, any help would be great.

thanks

+4
source share
1 answer

Would you like to watch

  initWithContentsOfURL: Initializes and returns an NSImage instance with the contents of the specified URL. - (id)initWithContentsOfURL:(NSURL *)aURL Parameters aUrl The URL identifying the image. Return Value An initialized NSImage instance, or nil if the method cannot create an image representation from the contents of the specified URL. 

From http://developer.apple.com/mac/library/documentation/cocoa/Reference/ApplicationKit/Classes/NSImage_Class/Reference/Reference.html#//apple_ref/occ/instm/NSImage/initWithContentsOfURL :

+5
source

Source: https://habr.com/ru/post/1307244/


All Articles