MKNumberBadgeView icon indicating copy to clipboard operation
MKNumberBadgeView copied to clipboard

set new value not working

Open y0unghe opened this issue 11 years ago • 0 comments

When I have received a push notification, I am trying to set new value for badge view, but it's not working. It's value still is zero. I set the zero value when init happend.

- (void)viewDidLoad
{
    [super viewDidLoad];

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didGetPush:) name:@"GetPushMessage" object:nil];

    self.badgeView = [[MKNumberBadgeView alloc] initWithFrame:CGRectMake(200, SCREEN_HEIGHT-65, 25, 25)];
    self.badgeView.value = 0;
    [self.view addSubview:self.badgeView];
}

- (void)didGetPush:(NSNotification *)notif
{
    NSLog(@"%d", [[notif userInfo][@"number"] integerValue]); //this part is working, i can see the value in the console. but setValue below is not working.

    [self.badgeView setValue:[[notif userInfo][@"number"] integerValue]];
}

y0unghe avatar Aug 26 '13 08:08 y0unghe