Ios 如何基于NextviewControllerValue设置徽章值?

Ios 如何基于NextviewControllerValue设置徽章值?,ios,objective-c,badge,message-passing,Ios,Objective C,Badge,Message Passing,我想将firstComponentValue填充到lbl\u卡计数徽章中 UILabel *lbl_card_count = [[UILabel alloc]initWithFrame:CGRectMake(23,0, 13, 13)]; int Temp_card_count; lbl_card_count.textColor = [UIColor whiteColor]; lbl_card_count.textAlignment

我想将
firstComponentValue
填充到
lbl\u卡计数
徽章中

        UILabel *lbl_card_count = [[UILabel alloc]initWithFrame:CGRectMake(23,0, 13, 13)];
        int Temp_card_count;
        lbl_card_count.textColor = [UIColor whiteColor];
        lbl_card_count.textAlignment = NSTextAlignmentCenter;
        lbl_card_count.text = [NSString stringWithFormat:@"%d",Temp_card_count];
        lbl_card_count.layer.borderWidth = 1;
        lbl_card_count.layer.cornerRadius = 8;
        lbl_card_count.layer.masksToBounds = YES;
        lbl_card_count.layer.borderColor =[[UIColor clearColor] CGColor];
        lbl_card_count.layer.shadowColor = [[UIColor clearColor] CGColor];
        lbl_card_count.layer.shadowOffset = CGSizeMake(0.0, 0.0);
        lbl_card_count.layer.shadowOpacity = 0.0;
        lbl_card_count.backgroundColor = [UIColor colorWithRed:247.0/255.0 green:45.0/255.0 blue:143.0/255.0 alpha:1.0];
        lbl_card_count.font = [UIFont fontWithName:@"ArialMT" size:11];
        [lbl_card_count setHidden:YES];
        [appliancesButton addSubview:lbl_card_count];
        [categoryView addSubview:appliancesButton];


-(void)changecolor:(UIGestureRecognizer *)gestureRecognizer
{
    AddApplianceViewController *addApplianceVC = [[AddApplianceViewController alloc]init];
    [self showPopupWithTransitionStyle:STPopupTransitionStyleSlideVertical rootViewController:addApplianceVC];
    addApplianceVC.labelText = gestureRecognizer.accessibilityLabel;
    NSLog(@"tapped");
}
AddAppliancesViewController.m

-(void)setButtonAction
{
if ([self.picker selectedRowInComponent:0]!=0)
{

    firstComponentValue = [self.picker selectedRowInComponent:0];
    NSLog(@"Appliances Count==>>%d",firstComponentValue);

    [self dismissViewControllerAnimated:YES completion:NO];
}
else
{
    [self alert];
}

}`

不太清楚您想做什么。请重新编写您的问题(只包括与您的问题相关的代码部分)@yvindHauge更新了我的代码。。。。。