Note that there are some explanatory texts on larger screens.

plurals
  1. POUIAlertView not firing, after UIActionSheet is displayed
    primarykey
    data
    text
    <p>I have been searching high and low for the answer to my issue. You see I have a UIActionSheet and I am firing it off when the user tries to press a button that they aren't supposed to: it works great, but I am trying to fire of a UIAlert letting the user know the current operation has been stopped and they need to press "Continue" ... my problem is in my - (void) actionSheet .... either the method is not called by the actionSheet or the buttonIndex is not set correctly. </p> <h2>.h</h2> <pre><code>#import &lt;UIKit/UIKit.h&gt; @interface DVRRemote : UIViewController &lt;UIActionSheetDelegate&gt; @property (nonatomic) BOOL pwrOff; @property (nonatomic) BOOL dvrState; @property (nonatomic) BOOL playState; @property (nonatomic) BOOL rcdState; @property (nonatomic) BOOL rcdPlay; @property (strong, nonatomic) IBOutlet UISwitch *pwrSwitch; @property (strong, nonatomic) IBOutlet UITextField *dvrStateLbl; @property (strong, nonatomic) IBOutlet UITextField *PwrLbl; - (IBAction)buttonPressed:(UIButton *)sender; - (IBAction)pwrPressed:(UISwitch *)sender; @end </code></pre> <p>and here is the code <code>UIActionSheet</code> and <code>UIAlertView</code> ... please help. This work is already two weeks overdue.</p> <h2>.m</h2> <pre><code>-(IBAction)buttonPressed:(UIButton*)sender { if (_pwrOff == NO) { if (_rcdPlay == NO) { if ([sender.currentTitle isEqual: @"Play"]) { _dvrStateLbl.text = @"Playing"; _playState = YES; _rcdState = NO; } } else { UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Play not Allowed during Record" delegate:nil cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Continue" otherButtonTitles:nil]; [actionSheet showInView: self.view]; } } } -(void)actionSheet:(UIActionSheet*)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex { if (buttonIndex != [actionSheet cancelButtonIndex]) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Playing" message:[NSString stringWithFormat:@"Recording stopped"] delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil]; [alert show]; } } </code></pre> <p>please note: I have coded the alert under every <code>buttonIndex == 0, == 1, == 2</code> ... it does not want to show. </p> <p>Big thanks to someone who can help! Regards, </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload