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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:36:19+00:00 2026-06-01T17:36:19+00:00

This piece of code which is supposed to show an alert window with a

  • 0

This piece of code which is supposed to show an alert window with a text input:

self.alert = [[UIAlertView alloc] initWithTitle:@"Hello" message:@"How are you?" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
self.alert.alertViewStyle = UIAlertViewStylePlainTextInput;
[self.alert show];

Causes this error:

Thread 7: Program received signal: "EXC_BAD_ACCESS"

This is how self.alert is defined:

@interface MyClass : NSObject
{
    UIAlertView *alert;
    id <MyClassDelegate> __unsafe_unretained delegate;
}

@property (nonatomic, retain) UIAlertView *alert;
@property (unsafe_unretained) id <MyClassDelegate> delegate;
  • 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-01T17:36:21+00:00Added an answer on June 1, 2026 at 5:36 pm

    The problem is maybe because of the customize.

    I do not know why, but appear to me that the problem is because of the use of threads + customize of your alert.

    Can you try to show this alert on the main thread? What happen?

    You probably get an error in this line:
    self.alert.alertViewStyle = UIAlertViewStylePlainTextInput;

    What you need to do if yes, is perform this in the main thread.

    - (void) yourMethod{
        [self performSelectorOnMainThread:@selector(yourMethod2) withObject:nil waitUntilDone:NO];
    }
    
    - (void) yourMethod2{
        self.alert = [[UIAlertView alloc] initWithTitle:@"Hello" message:@"How are you?" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
        self.alert.alertViewStyle = UIAlertViewStylePlainTextInput;
        [self.alert show];
    }
    

    Sorry to can’t help you more than that, but I do not know exactly what happen, but I already read about issues when editing things to show, in other threads.

    Hope it help you!

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

Sidebar

Related Questions

I'm currently writing a piece of code which is supposed to import text files
I have this piece of code which I'm hoping will be able to tell
I am using std::unique_ptr in this piece of code which compiles and runs as
I am somewhat new to R, and i have this piece of code which
Ok i have this piece of code from which i took from W3schools :-
I am trying to run this seemingly simple piece of code which is repeated
I saw a piece of code which was written like this: if (from n
I have this piece of Open MP code here which performs an integeration of
I have this piece of code: if(($op == q)); then which throws out this
I am trying to fix this piece of code which on Click, removed the

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.