Domanda

Ho bisogno di creare un NSImage da un URL e quindi impostarlo su un panorama di immagini nella mia applicazione. Ho provato un certo codice che ho trovato on-line, ma non ha funzionato. Se qualcuno sa come fare qualsiasi aiuto sarebbe grande.

Grazie

È stato utile?

Soluzione

Ti consigliamo di guardare

 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.

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top