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 7413541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:55:31+00:00 2026-05-29T06:55:31+00:00

I am creating 2 buttons programmatically in my view. Both selector methods exist but

  • 0

I am creating 2 buttons programmatically in my view. Both selector methods exist but it is still throwing ‘unrecognized selector’ errors. I read something about checking for zombies. But I activiated it (xcode 4.2) and didn’t see anything about any zombies. Here is the code..

- (void)viewDidLoad
{

    for(int i = 0; i < [list count]; i++){  

     ... if statement checks to add text fields
    }

     UIButton *submit = [UIButton buttonWithType:UIButtonTypeRoundedRect];
     [submit addTarget:self action:@selector(submission:)
     forControlEvents:UIControlEventTouchUpInside];
     [submit setTitle:@"Submit" forState:UIControlStateNormal];
     submit.frame = CGRectMake(x+ 170.0, y, 72, 37);

    UIButton *addition = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    [addition addTarget:self action:@selector(addition:)
    forControlEvents:UIControlEventTouchUpInside];
    [addition setTitle:@"Additional Mission" forState:UIControlStateNormal];
    addition.frame = CGRectMake(x, y, 140, 37);

    y = y+90;
   [inputsView addSubview:submit];
   [inputsView addSubview:addition];
   [inputsView setScrollEnabled:YES];
   [inputsView setContentSize:CGSizeMake(320, y)]; 


}

 - (void)submission{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Submission Complete" message:@"Submission"
                                               delegate:self cancelButtonTitle:@"No" otherButtonTitles:@"Yes", nil];
[alert show];
}

 -(void)addition{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Creating Additional Mission" message:@"Additional Mission"
                                               delegate:self cancelButtonTitle:@"No" otherButtonTitles:@"Yes", nil];
[alert show];
}

One thing to note.. inputsView is a UIScrollView that is inside my viewcontroller.

Thanks in advance.

  • 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-29T06:55:32+00:00Added an answer on May 29, 2026 at 6:55 am

    remove the colon from the selector methods

    [submit addTarget:self action:@selector(submission)
    
    [addition addTarget:self action:@selector(addition)
    

    the colon tells the selector that this method takes arguments, yours do not so the colon should not be part of the selector

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my view controller I'm programmatically creating N buttons in my UIView . Each
Im creating and adding a grid of buttons to my custom view keyboardView as
Programmatically I am creating buttons and keeping some background image using setBackgroundImage. I want
I am creating a section view programmatically and I have a UIButton delete also
I'm creating some UIButton s programmatically in a loop but I'm having some problem
I'm creating a UIWebView programmatically and giving it full width and height, but it
I am creating a registration form which contains two submit buttons. I need to
I've seen several questions/answers related to entirely creating a button in code, but not
I'm new to this iPad business, and I'm creating some buttons inside a scrollview
I am creating buttons dynamically for a user-based app. Now I have to tell

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.