Thanks to the help of @stee i was able to get the image to upload to the right class in parse.com. Now i can't get it to display that same image in the same uiimageview i used to upload .
with the help of @stee and @Joey i was able to add the code below to my viewdidload. Now i get a warning saying unused variable for the *image and when i compile and run i can upload but as soon as i leave that controller, the image won't be there.
- (void)viewDidLoad {
[super viewDidLoad];
PFFile * myPFFile = [[PFUser currentUser] objectForKey:@"ProfilePicture"];
[myPFFile getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
if (!error) {
UIImage *image = [UIImage imageWithData:data];
// image can now be set on a UIImageView
}
}];
}
if it helps you understand what I've done, below is the code i used to upload the photo
PFObject *User = [PFUser currentUser];
NSData *imageData = UIImageJPEGRepresentation(_imageView.image, 0.8);
NSString *filename = [NSString stringWithFormat:@"%@.png", _username.text];
PFFile *imageFile = [PFFile fileWithName:filename data:imageData];
[User setObject:imageFile forKey:@"ProfilePicture"];
is there anything that I'm missing from my viewdidload? am i missing anything from my .h file?
in my .h file i have that uiimageview like;
@property (strong, nonatomic) IBOutlet UIImageView *imageView;
i would greatly appreciate any further help in making this possible.