Wkinterfaceimage Unable to update picture problems

Source: Internet
Author: User

Recent projects related to AppleWatch, but there is a strange problem cannot be solved, and can not understand:

Depending on the user action, the player's album image needs to be modified.

I don't know if it has anything to do with my project needs: Do I need to poll the space to get the sync data, is it a performance issue? I don't know

The method I have tried is as follows:

1. The Wkinterfaceimage inheritance relationship is nsobject,:-> Wkinterfaceobject, There is no way to use UIView to remove a picture and add a new picture (Addsubview,removefromsuperview)

2. No corresponding forced Refresh method such as Setneeddisplay

3. Only the Sethidden method depends on the dot spectrum, but it still fails after the attempt

4. I try to replace it with two different pictures, and call the Sethidden method, still invalid

5. The problem with StackOverflow is similar:there are wkinterfaceimage in the cell in the wkinterfacetable, and when reusing the old cell, it is found that the old picture content has not been replaced. The answer is: This is a bug, has been resolved in xcode6.2 (my God, my 6.3.2, but still not resolved AH), the temporary solution is: Before assigning a new picture content, first assign nil.

[Self.image Setimagenamed:nil];  // can also be an empty string [Self.image setimagenamed:@ "XXXX"];

But I am still invalid here.

6. The final solution is to use the GCD delay method to execute the relevant code when the image needs to be updated. But I don't know if it's due to the inefficient synchronization between watch and iphone???

Dispatch_after (Dispatch_time (Dispatch_time_now, (int64_t) (0.1 * nsec_per_sec)), Dispatch_get_main_queue () , ^{});

In addition: Legend Wkinterfacedevice can store the cache, and can be assigned to the image object by the key value, but unfortunately, I here once found that there are pictures in the cache, and then assign the value of the time, the picture can not be updated, it is very strange .... You are welcome to discuss together.

Wkinterfaceimage Unable to update picture problems

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.