gpt4 book ai didi

ios - 在 NSMutableArray Parse iOS 中删除 currentUser

转载 作者:行者123 更新时间:2023-11-28 21:44:46 25 4
gpt4 key购买 nike

我想用 Parse 加载 friend ,但要删除 currentUser 对象,我该怎么做?我做错了什么?

我试过这段代码,但它不起作用:

- (void)viewDidLoad
{
[super viewDidLoad];
self.currentUser = [PFUser currentUser];

PFQuery *query = [PFUser query];
[query orderByAscending:@"name"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (error) {
NSLog(@"Error: %@ %@", error, [error userInfo]);
}
else {
self.allUsers = objects;
self.mutableAllUsers = [[NSMutableArray alloc] initWithArray:self.allUsers];
[self.mutableAllUsers removeObject:self.currentUser];
[self.tableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
NSLog(@"%@", self.mutableAllUsers);
}
}];

最佳答案

找到它:添加 [query whereKey:@"objectId"notEqualTo:self.currentUser.objectId]; 在查询中。 :)

关于ios - 在 NSMutableArray Parse iOS 中删除 currentUser,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30620892/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com