Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 计算出新通知的数量_Ios_Objective C_Iphone_Notifications_Nsmutablearray - Fatal编程技术网

Ios 计算出新通知的数量

Ios 计算出新通知的数量,ios,objective-c,iphone,notifications,nsmutablearray,Ios,Objective C,Iphone,Notifications,Nsmutablearray,我有一个通知的NSMutableArray,每次打开视图控制器时,NSMutableArray都会更新,我如何计算有多少新项目通知已添加到NSMutableArray NSMutableArray *arrItems; [SharedDelegate.hnController loadDataOfType:GTUserNotifications cateId:self.strUserId curPage:curPage result:^(NSArray *results, GTControll

我有一个通知的NSMutableArray,每次打开视图控制器时,NSMutableArray都会更新,我如何计算有多少新项目通知已添加到NSMutableArray

NSMutableArray *arrItems;

[SharedDelegate.hnController loadDataOfType:GTUserNotifications cateId:self.strUserId curPage:curPage result:^(NSArray *results, GTControllerType type, BOOL success) {
        if (!success)
        {
            [UIView animateWithDuration:0.5
                                  delay:0.0
                                options:UIViewAnimationOptionLayoutSubviews | UIViewAnimationOptionAllowUserInteraction
                             animations:^{
                                 [self.vNoNetWork setFrame:CGRectMake(0, 430, 320, 25)];
                                 // animate here...
                             }
                             completion:^(BOOL finished){
                             }];
            //[loading stopAnimating];
            [refreshControl endRefreshing];
            return;
        }

        [self.activityIndicatorView setHidden:YES];
        [[self footerActivityIndicator] stopAnimating];
        [arrItems addObjectsFromArray:results];

        NSLog(@"ArrayItems: %@", arrItems);
        [self.tblView reloadData];

    }];

提前感谢

您可以拥有两个阵列,一个已更新,一个在更新前包含项目的阵列。然后,您需要检测新项目及其计数。您可以比较2个数组并获得新项目及其计数。

打印数组时,按数组返回多少对象?