Pregunta

Es necesario crear un NSImage desde una URL y luego ponerlo en una vista de la imagen en mi solicitud. Probé un poco de código que encontré en línea, pero no funcionó. Si alguien sabe cómo hacer esto cualquier ayuda sería grande.

Gracias

¿Fue útil?

Solución

Usted querrá mirar a

 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.

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top