ios - NSMutableArray to NSString to UIImageView CODE CRASHES -
ios - NSMutableArray to NSString to UIImageView CODE CRASHES -
any thought why code crash? taking nsmutablearray
converting nsstring
, using string url uiimageview
. crashes @ nsurl
line.
nsstring *imgstring = [imageone componentsjoinedbystring:@""]; nsurl *imageurl = [nsurl urlwithstring:imgstring]; dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_background, 0), ^{ nsdata *imagedata = [nsdata datawithcontentsofurl:imageurl]; dispatch_async(dispatch_get_main_queue(), ^{ // update ui self.imageview.image = [uiimage imagewithdata:imagedata]; }); });
from apple documentation,
urlstring: url string initialize nsurl object. must url conforms rfc 2396. method parses urlstring according rfcs 1738 , 1808.
in os x v10.7 , later or ios 5 , later, method returns nil if url string nil. in before versions, method throws exception if url string nil.
ios objective-c iphone nsstring nsmutablearray
Comments
Post a Comment