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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:27:34+00:00 2026-06-02T18:27:34+00:00

I have some sources below. – (void)Button:(UIButton *)button { NSString *imageName = ((UIButton *)[self.view

  • 0

I have some sources below.

- (void)Button:(UIButton *)button {

    NSString *imageName = ((UIButton *)[self.view viewWithTag:button.tag]).titleLabel.text; 

}

- (void)viewDidLoad { 

    NSMutableArray *_array = [[NSMutableArray alloc] init];

    NSInteger iCount = [_array count];

    for (i = 0; iCount > i; i++) {

        UIButton *btn = [[UIButton alloc] init];
        btn.titleLabel.text = [[_array objectAtIndex:i] objectForKey:@"FILE"];
        btn.tag = i;
        [btn addTarget:self action:@selector(Button:) forControlEvents:UIControlEventTouchUpInside];
        [self.view addSubview:btn];
        [btn release];

}

When I access Button method with 0 index tag, I get SIGABRT error.
What can I do ?

  • 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-06-02T18:27:35+00:00Added an answer on June 2, 2026 at 6:27 pm

    Read your console output properly, by default every view has the tag ‘0’, so it can be crashed because it is taking some other view besides of uibutton, and may be that view don’t not have the titleLabel property.Because it is the property of UIButton.

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

Sidebar

Related Questions

I have created data sources from my objects in my project, some of which
Can anyone please help me on below? I have a WSDL and some XSD
I have a Unix shell script (bash) that sources some environment variables and then
I have some PHP code, listed below. I have a trap that tells me
I have some source code to get the file name of an url for
I have some source codes to display all file names in a UITablView I
I have seen in some source code (by other developers) something like this: #import
I have to build some C source files using Visual Studio (currently using VS2008)
I have some HTML errors in my output source code, coming from one of
I have a problem with some source code regarding OpenSSL and Cpp. For some

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.