,PFImageView及其.file属性和相应的-loadInBackground方法,非常有用。我无法弄清楚如何“走另一条路”,即PFFile从新图像中获取参考:
RA_MyAccount.h(摘录)
@property (weak, nonatomic) IBOutlet PFImageView *profilePic;
-(IBAction)saveButtonTapped:(id)sender;
RA_MyAccount.m(摘录)
-(void)setLocalImageToPFImageView:(UIImage *)localImage
{
self.profilePic.image = localImage
}
-(IBAction)saveButtonTapped:(id)sender
{
PFUser *cUser = [PFUser currentUser];
// Get the PFFile reference for the new image
PFFile *file;
file = ??? ??? ??? ???
// Set
cUser[PF_USER_PIC] = file;
[cUser saveInBackgroundWithBlock:
^(BOOL succeeded, NSError *error){
[self performSegueWithIdentifier:@"unwindtotabviewsegue" sender:self];
}];
}
我已经指出了??? ??? ??? ???我遇到问题的地方。