In my app, user can make a profile pic by uploading it from phone or taking one from the phone. Everything works fine, and the user is able to do any of these operations smoothly and the profile pic looks great, at the time of setting it up. But, when the user starts the app again, I fetch the path of the image and try to show it. And it is shown, but it is, for some reason, rotated for 90 or 180 degrees!
So, once again, at the moment when the user takes or uploads a pic from the phone, it is not rotated strangely like this, only on the next app life cycle.
Here is some code:
-(void)setAvatar
{
NSMutableArray* imagePathArray = [[Model shared] loadDataForKey:@"avatar"];
NSString *imagePath = [imagePathArray objectAtIndex:0];
UIImage *image = [UIImage imageWithContentsOfFile:imagePath];
if (image!=nil)
_avatar.image = image;
}