Note that there are some explanatory texts on larger screens.

plurals
  1. POUse a NSString to display in another string?
    primarykey
    data
    text
    <p>I need to be able to show if the switch is on or off in a alert along with other details, all of the details display just fine but when I try to add the notificationStatus string it gives me an error. "Use of undeclared identifier 'notificationStatus'" </p> <pre><code>-(void) procrastinationNotificationSwitchOnOrOff { if (_procrastinationNotificationSwitch.on) { _notificationOnOffLabel.text = @"Procrastination Notification On"; NSString *notificationStatus = @"NOTIFICATION ON"; NSLog(notificationStatus); } else { _notificationOnOffLabel.text = @"Procrastination Notification Off"; NSString *notificationStatus = @"NOTIFICATION OFF"; NSLog(notificationStatus); } } -(void) presentMessage:(NSString *)message { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Class Stuff" message:message delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil]; [alert show]; } -(void) notificationStatus:(NSString *)stat { NSString *status = [NSString stringWithFormat:@"%@", stat]; } -(IBAction)returnKeyButton:(id)sender { [sender resignFirstResponder]; NSString *classNameString = self.className.text; NSLog(classNameString); NSString *assignmentTitleString = self.assignmentTitle.text; NSLog(assignmentTitleString); NSString *assignmentDescriptionString = self.assignmentDescription.text; NSLog(assignmentDescriptionString); NSString *totalStrings = [NSString stringWithFormat:@"%@ %@ %@ %@", classNameString, assignmentTitleString, assignmentDescriptionString, notificationStatus]; NSLog(totalStrings); NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init]; dateFormatter.timeZone = [NSTimeZone defaultTimeZone]; dateFormatter.timeStyle = NSDateFormatterShortStyle; dateFormatter.dateStyle = NSDateFormatterShortStyle; NSString *dateTimeString = [dateFormatter stringFromDate: dateTimePicker.date]; NSLog(@"Alarm Set Button Tapped : %@", dateTimeString ); [self presentMessage:totalStrings]; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. [_procrastinationNotificationSwitch addTarget:self action:@selector(procrastinationNotificationSwitchOnOrOff) forControlEvents:UIControlEventValueChanged]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    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