nsimage من عنوان URL على الويب
-
27-09-2019 - |
سؤال
أنا بحاجة لإنشاء NSImage
من عنوان URL ثم قم بتعيينه على عرض صورة في طلبي. جربت بعض الرموز التي وجدتها على الإنترنت لكنها لم تنجح. إذا كان أي شخص يعرف كيفية القيام بذلك ، فستكون أي مساعدة رائعة.
شكرًا
المحلول
سترغب في النظر إلى
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.
لا تنتمي إلى StackOverflow