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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:13:40+00:00 2026-06-04T03:13:40+00:00

I try to start an action after click on the button in my alterView

  • 0

I try to start an action after click on the button in my alterView – but nothing happens ;-( In the same viewController I use an actionSheet with several options – this actionsSheet works perfect but the alertView don`t.

Here is my Code. The Dubug has NO ERRORS. What is wrong????? THANKS!

In the Header:

#define alertWelcome 1
#define alertFacebook 2
#define alertRecommend 3

In the ViewDidLoad:

if (! hasRanBefore) {
        NSLog(@"else has ran before");
        UIAlertView *alert = [[UIAlertView alloc]                     
                              initWithTitle:NSLocalizedString(@"Headline_firstLaunch", @"Headline")
                              message:NSLocalizedString(@"firstLaunch", @"1.Start - Hilfe") delegate:self 
                              cancelButtonTitle:NSLocalizedString(@"no",@"No")
                              //defaultButton:@"OK" 
                              //alternateButton:@"Cancel"                            
                              otherButtonTitles:/*NSLocalizedString(@"Facebook",@"Login"),*/ nil];
         alert.tag = alertWelcome;       
        [alert show];
        [alert release];

    }

    [NSTimer scheduledTimerWithTimeInterval:2 target:self selector:@selector(fbLogin:) userInfo:nil repeats:NO];

My method:

- (void)fbLogin:(id)sender{
    NSLog(@"FB Login Alert");
    if (![facebook isSessionValid]) {

        UIAlertView *popupFacebook =  [[UIAlertView alloc]                     
                                      initWithTitle:NSLocalizedString(@"Headline_FacebookL", @"Headline")
                                       message:NSLocalizedString(@"Facebook-Text", @"1.Start - Hilfe") 
                                       delegate:self
                                       cancelButtonTitle:NSLocalizedString(@"no",@"No")
                                       //defaultButton:@"OK" 
                                       //alternateButton:@"Cancel"                            
                                       otherButtonTitles:NSLocalizedString(@"Facebook",@"Login"), nil];
   // [popupFacebook addButtonWithTitle:NSLocalizedString(@"Facebook",@"Login")];
     popupFacebook.tag = alertFacebook;
    [popupFacebook show];
    [popupFacebook release];

}
}

My method:

//First View Alert
-(void)firstActionSheet:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
    NSLog(@"clicking");
    //NSString *title = [actionSheet buttonTitleAtIndex:buttonIndex];

    if (alertView.tag == alertWelcome )  {
        if (buttonIndex == 0) {
            NSLog(@"close");
        }
    }  

    else if (alertView.tag == alertFacebook )  {

        if (buttonIndex == 0) {
            NSLog(@"später");
        }  

        if (buttonIndex == 1) {
            //self.label.text = NSLocalizedString(@"Facebook",@"Login"),
            [self fbActive:nil];
            NSLog(@"Login to FB");
        }  

    }
}

The perfect running actionSheet:

-(IBAction)inviteFriends:(id)sender {
    UIActionSheet *popupQuery = [[UIActionSheet alloc] 
                                 initWithTitle:NSLocalizedString(@"invite_Headline",@"Erzähle es Deinen Freunden:") 
                                 delegate:self 
                                 cancelButtonTitle:NSLocalizedString(@"invite_cancel",@"Abbrechen") 
                                 destructiveButtonTitle:nil
                                 otherButtonTitles:NSLocalizedString(@"invite_eMail",@"per E-Mail einladen"),
                                 NSLocalizedString(@"invite_SMS",@"per SMS einladen"),
                                 NSLocalizedString(@"vote",@"App bewerten"),
                                 /*NSLocalizedString(@"invite_Facebook",@"Facebook"),*/
                                 NSLocalizedString(@"invite_Twitter",@"Twitter"), nil];
    popupQuery.actionSheetStyle = UIActionSheetStyleBlackOpaque;
    popupQuery.tag = alertRecommend;
    [popupQuery showInView:self.view];
    [popupQuery release];

}

-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
    UIDevice* currentDevice = [UIDevice currentDevice];
    if(currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad)  {
        NSLog(@"oh its iPad");




        if (buttonIndex == 0) {
            self.label.text = NSLocalizedString(@"invite_eMail",@"per E-Mail einladen"),
            [self showMailPicker:nil];

        }  
        else if (buttonIndex == 1) {
            self.label.text = NSLocalizedString(@"vote",@"App bewerten"),
            [self bewerten:nil];   
        }
        else if (buttonIndex == 2) {
            self.label.text = NSLocalizedString(@"invite_Twitter",@"Twitter"),
            [self twitter:nil];
        } 
        /*else if (buttonIndex == 3) {
            self.label.text = NSLocalizedString(@"invite_cancel",@"Abbrechen");
        }*/


    }
    else{
        NSLog(@"This is iPhone");

        if (buttonIndex == 0) {
            self.label.text = NSLocalizedString(@"invite_eMail",@"per E-Mail einladen"),
            [self showMailPicker:nil];
            NSLog(@"Mail");

        } else if (buttonIndex == 1) {
            self.label.text =  NSLocalizedString(@"invite_SMS",@"per SMS einladen"),
            [self sendInAppSMS:nil];

        } else if (buttonIndex == 2) {
            self.label.text = NSLocalizedString(@"vote",@"App bewerten"),
            [self bewerten:nil];

        } //else if (buttonIndex == 3) {
        //self.label.text = NSLocalizedString(@"invite_Facebook",@"Facebook"),
        //[self facebook_invite:nil]; 
        //    } 
        else if (buttonIndex == 3) {
            self.label.text = NSLocalizedString(@"invite_Twitter",@"Twitter"),
            [self twitter:nil];

        } /*else if (buttonIndex == 4) {
            self.label.text = NSLocalizedString(@"invite_cancel",@"Abbrechen");
        }*/

    }    
}
  • 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-04T03:13:41+00:00Added an answer on June 4, 2026 at 3:13 am

    THANKS – Im an idiot 😉

    This code works fine 😉

    -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
        NSLog(@"clicking");
        //NSString *title = [actionSheet buttonTitleAtIndex:buttonIndex];
    
        if (alertView.tag == alertWelcome )  {
            if (buttonIndex == 0) {
                NSLog(@"close");
            }
        }  
    
        else if (alertView.tag == alertFacebook )  {
    
            if (buttonIndex == 0) {
                NSLog(@"später");
            }  
    
            if (buttonIndex == 1) {
                //self.label.text = NSLocalizedString(@"Facebook",@"Login"),
                [self fbActive:nil];
                NSLog(@"Login to FB");
            }  
    
        }
    }
    

    Greetz!

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

Sidebar

Related Questions

I try to start action with service (or activity) from an url. (with params)
When i try to start Thread (u) it does nothing! this is what i
I want that my application start after my setup is finished. I try to
I'm try to start usage the collections part of a spring4d. But I cann't
getting error while try to start service
When I try to start the Sql Server (SqlExpress) service I got the following
When I try to start Firefox using Process.Start and ProcessStartInfo (.NET) everything seems to
When I try to start up a websphere portal server, it hangs at the
I'm learned php as functional and procedure language. Right now try to start learn
I am getting some issues in HBase. When I try to start hadoop ,

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.