I am trying to display logged in user's profile picture using following:
NSLog(@"url is : %@",[SFAccountManager sharedInstance].idData.pictureUrl);
profilePicData=[NSData dataWithContentsOfURL:[SFAccountManager sharedInstance].idData.pictureUrl];
if ( profilePicData )
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filePath = [NSString stringWithFormat:@"%@/%@", documentsDirectory,@"filename.jpg"];
NSLog(@"pic path: %@",filePath);
[profilePicData writeToFile:filePath atomically:YES];
}
NSLog(@"pic data: %@",profilePicData);
}
in NSLog("%@", [NSData dataWithContentsOfURL:[SFAccountManager sharedInstance].idData.pictureUrl]); shows some data but does not display picture in UIImageView.
Any Help would be appreciated .