根据服务器返回值做判断

if ([responseObject[@"msg"]isEqualToString:@"暂时还没有收藏产品!"]) {
//            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"没有收藏产品" message:nil delegate:self cancelButtonTitle:nil otherButtonTitles:nil, nil];
//            alert.delegate=self;
//            [alert show];
//            [alert dismissWithClickedButtonIndex:3 animated:YES];
            UILabel *l=[[UILabel alloc]init];
            l.frame=CGRectMake(10, 100, [UIScreen mainScreen].bounds.size.width-20, 40);
            l.text=@"没有收藏的产品";
            l.textAlignment=NSTextAlignmentCenter;
            l.textColor=[UIColor grayColor];
            [self.view addSubview:l];
        }

原文地址:https://www.cnblogs.com/-ios/p/4672520.html