NSImage de URL del sitio web
-
27-09-2019 - |
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
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.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow