I have an assets library url to a photo: "assets-library://asset/asset.JPG?id=8D4D7820-EDD6-4CA4-A44A-2ACD53A112FC&ext=JPG" I have this in a string property imgURLString. I am trying to convert this to NSURL in the following way:
NSURL *imageURL = [NSURL URLWithString:self.imgURLString];
However, I am getting an exception:
[NSURL length]: unrecognized selector sent to instance 0xa8281f0
I am sure I have the above mentioned string in self.imgURLString and it is not trying to convert an empty string. So why am I getting this exception and how do I solve it?
I am basically trying to convert the string to an NSURL to fetch the photo using the assets library url.
Your
self.imgURLString
is actually already anNSURL
, not anNSString
. You are assigning the asset URL (anNSURL
) to yourNSString
property. Change your property to be anNSURL
.