Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 964247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:47:47+00:00 2026-05-16T01:47:47+00:00

I make a keyboard from UIButtons. On this keyboard there are 49 UIButtons, which

  • 0

I make a keyboard from UIButtons. On this keyboard there are 49 UIButtons, which create the following:


- (void)viewDidLoad {

    [self emoticonButtonOnTheKeyBoard_xCoordinate:0   yCoordinate:0 Emoticone_name:@"emoticon_angel.gif"        backString:@"O:-)"      keyboardView:self.view];
    [self emoticonButtonOnTheKeyBoard_xCoordinate:40  yCoordinate:0 Emoticone_name:@"emoticon_angry.gif"        backString:@":-@"       keyboardView:self.view];
    [self emoticonButtonOnTheKeyBoard_xCoordinate:80  yCoordinate:0 Emoticone_name:@"emoticon_big_smile.gif"    backString:@":-D"       keyboardView:self.view];
    [self emoticonButtonOnTheKeyBoard_xCoordinate:120 yCoordinate:0 Emoticone_name:@"emoticon_confused.gif"     backString:@":-s"       keyboardView:self.view];
    [self emoticonButtonOnTheKeyBoard_xCoordinate:160 yCoordinate:0 Emoticone_name:@"emoticon_cool.gif"         backString:@"B)"        keyboardView:self.view];
    [self emoticonButtonOnTheKeyBoard_xCoordinate:200 yCoordinate:0 Emoticone_name:@"emoticon_cry.gif"          backString:@":,-("      keyboardView:self.view];
    [self emoticonButtonOnTheKeyBoard_xCoordinate:240 yCoordinate:0 Emoticone_name:@"emoticon_disappoint.gif"   backString:@":-|"       keyboardView:self.view];
    [self emoticonButtonOnTheKeyBoard_xCoordinate:280 yCoordinate:0 Emoticone_name:@"emoticon_emo.gif"          backString:@"(Emo)"     keyboardView:self.view];

}

and the creating methods:


- (IBAction) updatingTheTextFiledWithEmoticon
{
    iPhoneClientDevAppDelegate *appDelegate = (iPhoneClientDevAppDelegate *)[[UIApplication sharedApplication] delegate];
    [[appDelegate.personalchatviewcontrollerReference message_textfield] setText:[[[appDelegate.personalchatviewcontrollerReference message_textfield] text] stringByAppendingString:appDelegate.EmoticonCurrentButtonValue]];
}

- (void) emoticonButtonOnTheKeyBoard_xCoordinate:(int)x_coordinate yCoordinate:(int)y_coordinate Emoticone_name:(NSString *)emoticon_name
                                       backString:(NSString *)stringback keyboardView:(UIView *)keyboard
{
    iPhoneClientDevAppDelegate *appDelegate = (iPhoneClientDevAppDelegate *)[[UIApplication sharedApplication] delegate];
    appDelegate.EmoticonCurrentButtonValue = stringback;
    UIButton* emticon_button = [UIButton buttonWithType:UIButtonTypeCustom];
    emticon_button.frame = CGRectMake(x_coordinate, y_coordinate, 40, 43);
    [emticon_button setImage:[UIImage imageNamed:emoticon_name] forState:UIControlStateNormal];
    [emticon_button setImage:[UIImage imageNamed:emoticon_name] forState:UIControlStateHighlighted];
    [emticon_button setBackgroundImage:[UIImage imageNamed:@"background.png"] forState:UIControlStateNormal];
    [emticon_button ]
    [keyboard addSubview:emticon_button];


    [emticon_button addTarget:nil action:@selector(updatingTheTextFiledWithEmoticon)  forControlEvents:UIControlEventTouchUpInside];
}

So, I successfully covered the keyboard, but I have a big problem.
When I press a button on the keyboard, the application always return the last created button value.
How can I distinguish the UIButtons?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T01:47:47+00:00Added an answer on May 16, 2026 at 1:47 am

    Give them a unique .tag property (type int), and make sure your selector takes the sender as an argument:

    -(IBAction)buttonPressed:(id)theButton
    {
        NSLog("Button %d pressed",[theButton tag]);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to make a keyboard disappear without resignFirstResponder ? I have
I tried to make a program that reads ELEM structures from keyboard and writes
I'm newbie. I want to make the client program to receive input from keyboard
I was wondering if there is a way to make an easy keyboard shortcut
I have make like text field search. In which i have first create text
Possible Duplicate: How to make return key on iphone make keyboard disappear? I have
I want to make a smart keyboard that can learn and save new words
I make a bot program and i want to send some keyboard keys between
I want To make a square that has keyboard movement (up, down, left, right)
I'm new. I've determined I cannot make a label active and accept keyboard input,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.