I have a urls like
"assets-library://asset/asset.PNG?id=2B9DB56C-B9C6-4F4E-AD51-8A5E5F1DD2AA&ext=PNG"
in "images" array. How i can get NSData from media, by this url? I need use NSData in this code:
#pragma mark VK methods
+(NSMutableArray*)attachmentIds:(NSArray*)images forMe:(NSDictionary*)me{
NSMutableArray *attachmentsList = [NSMutableArray new];
for (int i = 0; i<images.count; i++){
NSData *imageData = [NSData dataWithContentsOfURL:[images objectAtIndex:i] ];
NSString *serverUrl = [self getServerForVKUploadPhotoToWall:me];
NSDictionary *uploadResult = [self sendVKPOSTRequest:serverUrl withImageData:imageData];
NSString *hash = [uploadResult objectForKey:@"hash"];
NSString *photo = [uploadResult objectForKey:@"photo"];
NSString *server = [uploadResult objectForKey:@"server"];
NSString *attach_id = [self getVKAttachIdforUser:me photo:photo server:server hash:hash];
[attachmentsList addObject:attach_id];
}
return attachmentsList;
}
But NSData *imageData = [NSData dataWithContentsOfURL:[images objectAtIndex:i]];
isn't working;