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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:18:40+00:00 2026-05-17T01:18:40+00:00

How do I debug an iPhone aplication? How can I find out what’s going

  • 0

How do I debug an iPhone aplication? How can I find out what’s going on in the simulator? I’m a beginner in Xcode development and don’t know what’s the problem with the code below. The app is crashing on button click.

- (void)viewDidLoad {

    myLabel = [[UILabel alloc]init];

    [myLabel setText:@"Labela"];
    myLabel.frame = CGRectMake(50.0,50.0, 100.0, 30.0);
    [self.view addSubview:myLabel];

    myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];

    [myButton addTarget:self 
                 action:@selector(buttonAction:)
       forControlEvents:UIControlEventTouchDown];

    [myButton setTitle:@"Klikni" forState:UIControlStateNormal];
    [myButton setFrame:CGRectMake(80.0, 210.0, 160.0, 40.0)];

    [self.view addSubview:myButton];
    [super viewDidLoad];

}

- (void)buttonAction {
    [myLabel setText:@"Promijenjen!"];
}
  • 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-17T01:18:42+00:00Added an answer on May 17, 2026 at 1:18 am
    action:@selector(buttonAction:)
    

    Here you specify that buttonAction selector gets 1 parameter, but it is declared to have none:

    - (void)buttonAction{
    ...
    

    So when button click system tries to call undefined method and that results in crash. To fix that you should either change selector name to

    action:@selector(buttonAction)
    

    or change action method declaration:

    - (void)buttonAction:(id)sender{
        ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can install an app on my development iPhone compiled with Debug configuration using
When I debug an OSX application from XCode, I can communicate with the application's
I'm building an iPhone application using the Simulator on Debug configuration. I get this
I'm working with a View-based application compiling for iPhoneOS 4.0 Simulator (Debug), Xcode 3.2.3.
Is it possible to debug / run Xcode iPhone/iPad application project with multiple testing
Can't understand how to fix it and why it appears? Ld /Users/atencion/Library/Developer/Xcode/DerivedData/Flylista-gcadfttyrgznkmafzaicacwytfey/Build/Products/Debug-iphonesimulator/Flylista.app/Flylista normal i386
I am currently trying to debug a problem with an iPhone app. When I
Why is Xcode saying it can't find my GData framework when I try to
I'm trying to debug an issue that only occurs when my iPhone app receives
Works fine on Debug|iphone build. For Release|iphone I am getting following error: ld: duplicate

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.