为不同的类数据浏览器检索图像 Parse.com [英] Retrieve Image for different Class Data browser Parse.com
本文介绍了为不同的类数据浏览器检索图像 Parse.com的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,我正在尝试显示在该应用中注册的用户的个人资料图片.
Hello everyone I'm trying to display the profile picture of a user registered with the app.
在此查询中,我从照片数据浏览器中的任何位置获取来自不同类的数据.我尝试使用 MatchesQuery 但我找不到正确的组合......可能我的代码是错误的......
In this query I am getting data from a different class from wherever it is in the photo databrowser. I tried with MatchesQuery but I can not find the right combination ... Probably my code is wrong ...
- (void)QueryForTableView {
PFQuery *QueryForFriend=[PFQuery queryWithClassName:@"Amicizie"];
[QueryForFriend whereKey:@"A_User" equalTo:[PFUser currentUser]];
[QueryForFriend includeKey:@"Da_User"];
PFQuery *RetrievePhoto_User = [PFUser query];
[RetrievePhoto_User whereKey:@"photo" matchesQuery:QueryForFriend];
[QueryForFriend findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
NSLog(@"nome:%@", objects);
self.UtentiInAttesa = objects ;
[self.FFTableView reloadData];
}
}];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"CellaAmici";
FFCustomCellFriendInAttesa *cell = [self.FFTableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
if (!cell) {
cell = [[FFCustomCellFriendInAttesa alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CellaAmici"];
}
PFUser *FriendUser = [self.UtentiInAttesa objectAtIndex:indexPath.row];
NSString *ValueNomeCognome = [[FriendUser objectForKey:@"Da_User"] valueForKey:FF_USER_NOMECOGNOME];
cell.FFNomeFriendLabel.text = ValueNomeCognome;
cell.FFFotoProfiloInAttesa.file = [FriendUser objectForKey:@"photo"];
cell.FFFotoProfiloInAttesa.image = [UIImage imageNamed:@"FFNoFotoUSer"];
[cell.FFFotoProfiloInAttesa.layer setMasksToBounds:YES];
[cell.FFFotoProfiloInAttesa.layer setCornerRadius:22.5f];
[cell.FFFotoProfiloInAttesa loadInBackground];
return cell;
}
推荐答案
和你聊了几句.以下代码是不必要的和错误的.如此简单的删除它,你就设置好了:
After a little chat with you. The following code is unnecessary and wrong. So simple remove it and you are set:
PFQuery *RetrievePhoto_User = [PFUser query];
[RetrievePhoto_User whereKey:@"photo" matchesQuery:QueryForFriend];
这篇关于为不同的类数据浏览器检索图像 Parse.com的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文