return 还是 continue,一个是跳出函数,一个是 跳出本次循环,

 for (NotificationItem *item insortedCommonArray) {

            if (item.type == 1 && item.time == currentTime) {//

                if (!item.parentSelected || !item.selected) {

                    continue;

                }

                 TNotificationView *notificationView = [[[UINibnibWithNibName:@"TNotificationView"bundle:nil]instantiateWithOwner:selfoptions:nil]objectAtIndex:0];

                notificationView.titleLabel.text = item.drugName;

                notificationView.secondLabel.text = item.intro;

                notificationView.iconImageView.image = [UIImage imageNamed:@"icon_medicine.png"];

 

                notificationView.frame = CGRectMake(originX, originY, notificationView.frame.size.width, notificationView.frame.size.height);

                [self.mScrollView addSubview:notificationView];

 

                originY = originY +  notificationView.frame.size.height;

            }

            

        }

原文地址:https://www.cnblogs.com/guligei/p/3160758.html