Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

iPhone: how to badge a TabBatItem?

Hello,
In my AppDelegate.m there is a button and if I click on it, a TabBarItem should get a badge with the value "!". But it should not be the same Item like the View with the button but another TabBarItem.

How can I do this?

In the next step, I will show an alert selecting the the view with the badged Item. The alert should only be displayed if the badge has the value "!".

I hope it's not to much work!?
Thanks for helping me.

MacBook, Mac OS X (10.5.5)

Posted on Nov 23, 2008 12:57 AM

Reply
23 replies

Nov 23, 2008 10:35 AM in response to iPhil_good

Phil, you are my god! I thought "What does this guy different then me...?"
But now iI found the misstake: My button wasn't call with id sender and so on, it seems, that my button works only in self.view!

But now it works - it works fine! I'm so happy...

Now the last one: I have to ask if the badge is set to display my alert in my other view controller. How should I do this?

Nov 23, 2008 10:49 AM in response to .macSven

Happy it helped 😉

To read the badge status you may use just the same :
- (IBAction)getBadge:(id)sender {
iDesignerAppDelegate *ad = ((iDesignerAppDelegate *)([[UIApplication sharedApplication] delegate]));
UITabBarItem *tbi = (UITabBarItem *)[ad.tabBar.items objectAtIndex:1];
if ([tbi.badgeValue length] != 0) {
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Info" message:@"Badge exists" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alert show];
[alert release];
}
}


"badgeValue" is basically a read/write NSString ...

Phil

Nov 23, 2008 11:24 AM in response to iPhil_good

What should I say? It works! Thank you very much helping me, I hope I can contact you again?!

Now my App is finished and I can subscribe to the Developer Program. I have 29 warnings in my app - do you think Apple will take my app to the App-Store?

Is it difficult to distribute an App to the App-Store? You know, it is my first App ever...

Nov 23, 2008 11:34 AM in response to .macSven

Congratulations 😉

Apple won't even know about the 29 warnings, they only check if the app works, does what it's advertised for, complies with the interface standards ...

But may be you should review those warnings anyway because they're often the sign of a potential trouble.

Yet many warnings come from the XIB compiler claiming that checking the Bounce Scroll option is meaningless on OS 2.0 ... no big deal ...

Distributing an application is not difficult, it's long !

Follow carefully every single step described in the portal and you should be fine.
Common errors are no 57x57 icon, pictures for the appstore not in jpg format ...

Once submitted you'll have to wait from a couple of hours up to a couple of weeks before being accepted or rejected. It's shorter nowadays than it used to be at the beginning !

Regards
Phil

iPhone: how to badge a TabBatItem?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.