First of all, you can NOT read the file from the path that you specified: "USER / user2 / ...", the file must be in your application or in the application sandbox.
Secondly, check the path string if some texts need to be encoded in the url. Try:
NSURL *url = [NSURL URLWithString:[data stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
Also, if the URL is non-zero, you should also check if your [NSData dataWithContentsOfURL:url]; returns [NSData dataWithContentsOfURL:url]; zero. If so, it means your URL is incorrect, so the method cannot find your file.
PS, you are mistaken in creating the image code, you should call alloc before imageWithData:
source share