ios - How can CCSprite load ImageURL -
uiimageview *imageview = [[uiimageview alloc] init]; [imageviewhelper setimageurl:productinfo.imageurl forimageview:imageview]; ccsprite *imagesprite = [ccsprite spritewithcgimage:imageview.image.cgimage key:productinfo.imageurl];
setimageurl: forimageview:
multithreaded way, , when perform third step, imageview
not loaded successfully, because it's done on separate queue via multi-threading, imagesprite
needs imageview.image
valid.
if getting data ground thread, please try getting onto main queue while loading image sprite:
dispatch_sync(dispatch_get_main_queue(), ^{});
Comments
Post a Comment