Ios SVProgressHUD如何在下一个ViewController中显示
我有一个带有一些项目的TableViewController,然后有一个filterViewController,其中根据值过滤TableViewController中的数据。它是用UISwitch制成的。无论如何,我想问一下,当我使用过滤数组从filterViewController返回时,如何将SVProgressHUD添加到操作中。在tableView中过滤和显示它们需要几秒钟的时间。我已经尝试过dispatch_async,它甚至不显示HUD。我在filterViewController中有一个iAction for按钮,用于确认值并将其发送到TableViewController 如果我将HUD添加到filterViewController中的操作,HUD不会显示在TableViewController中 filtervewcontroller.m TableViewController.mIos SVProgressHUD如何在下一个ViewController中显示,ios,uitableview,uiactivityindicatorview,svprogresshud,Ios,Uitableview,Uiactivityindicatorview,Svprogresshud,我有一个带有一些项目的TableViewController,然后有一个filterViewController,其中根据值过滤TableViewController中的数据。它是用UISwitch制成的。无论如何,我想问一下,当我使用过滤数组从filterViewController返回时,如何将SVProgressHUD添加到操作中。在tableView中过滤和显示它们需要几秒钟的时间。我已经尝试过dispatch_async,它甚至不显示HUD。我在filterViewController
明白了。为TableViewController中的过滤器生成布尔值。这比我想象的要容易
-(IBAction)Done:(id)sender{
[self willMoveToParentViewController:nil];
[self.navigationController popViewControllerAnimated:YES];
}
- (void)filterController:(filterViewController *)controller didEditConfig:(NSMutableDictionary *)config
{
[SVProgressHUD showWithMaskType:SVProgressHUDMaskTypeGradient];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// time-consuming task
self.konfigg = config;
NSSet *filter = [config keysOfEntriesPassingTest:
^BOOL (id key, NSNumber *value, BOOL *stop) {
return [value boolValue];
}];
NSLog(@"filtered keys: %@ (%lu of %lu)", filter, (unsigned long)filter.count, (unsigned long)config.count);
PFQuery *query = [PFQuery queryWithClassName:@"Class"];
[query addDescendingOrder:@"createdAt"];
[query whereKey:@"eventDay" containedIn:[filter allObjects]];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
self.itemss = [objects mutableCopy];
[self.MainTable reloadData];
NSLog(@"Got filtered results %@ (%lu)", objects, (unsigned long)objects.count);
}}
];
dispatch_async(dispatch_get_main_queue(), ^{
[SVProgressHUD dismiss];
});
});
}