Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MacBuddySupport

macrumors member
Original poster
Nov 19, 2007
57
0
Hey, could someone post a couple line of code on how to count how many items you have in a table view and display them as a badge on the applications home screen?

Please help
 

Niiro13

macrumors 68000
Feb 12, 2008
1,719
0
Illinois
Easiest if you have like an array of that table's data...then you'd just go

[UIApplication sharedApplication].applicationIconBadgeNumber = [array count];
 

MacBuddySupport

macrumors member
Original poster
Nov 19, 2007
57
0
Easiest if you have like an array of that table's data...then you'd just go

[UIApplication sharedApplication].applicationIconBadgeNumber = [array count];

OK, What file do I put it in. The Delegate, ViewController? .m or .h file?

Make a quick tutorial on what I need to do. What lines of code need to go into the h file and m file. I have tried this method and got no results except for an error.

Please help,
 

admanimal

macrumors 68040
Apr 22, 2005
3,531
2
Do you actually want to learn how to create an app yourself? Asking for this type of help is not the way...
 

roberthuttinger

macrumors newbie
Sep 24, 2008
8
0
nirr0 gave you exactly what you asked for.

so noodle it out. you can only have an array count where the array is instantiated and used, therefore, you can only use the update badge code where.........

cheers.bo

wyzfam :apple: tCiMP :apple: tMiMP :apple: My Baby Signs
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.