1

I am newbie at iOS programming. I want to put notifications on UIbutton (for example displaying the click count on top of its corner), shortly it informs some counting on UIButton.

Is it possible? Please give some ideas or some short code for how can I do it.

Lorenzo B
  • 33,216
  • 24
  • 116
  • 190
Omer SOYER
  • 41
  • 5

2 Answers2

0

in the header file add

  {
  IBOutlet UIButton *counterbutton;
  }

  -(IBAction)pushed:(id)sender;

in the .m file int count;

 -(IBAction)pushed:(id)sender
 {
    count = count + 1;
    counterbutton.text = [NSString stringWithFormat:@"count is %i",count];
 }

In the interface builder connect the button to the view controller for both the IBAction and IBOutlet.

Steven Marlowe
  • 230
  • 2
  • 16
0

Flex_Addicted share that link in my question i guess sharing in here more discernible. In that example shows exactly what i asked and it is really easy do just add h and m files in your project. How can I add a badge to a standard UIButton?

Community
  • 1
  • 1
Omer SOYER
  • 41
  • 5