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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:21:06+00:00 2026-06-18T06:21:06+00:00

I have an alarm app with multiple alarms. There is an AlarmListViewController which is

  • 0

I have an alarm app with multiple alarms.

There is an AlarmListViewController which is a UITableView that holds the list of alarms. When the row is selected, a segue is initiated to an AlarmViewController (the detail view). Everything else is passed correctly from the AlarmListViewController to the AlarmViewController except the date.

I should mentioned that fullDate is a category on NSDate to make printing of NSDates easier.

Here’s the code:

header:

AlarmViewController.h

@interface AlarmViewController : UITableViewController <UITableViewDataSource, UITableViewDelegate>

@property (weak, nonatomic) IBOutlet UIDatePicker *timeSelected;
@property (nonatomic, strong) NSMutableArray *repeatSelection;
@property (nonatomic, strong) NSString *alarmID;

@end

implementation:

AlarmViewController.m

- (void)viewDidLoad
{
    [super viewDidLoad];

    NSLog(@"---VIEW DID LOAD---, current date: %@", [[NSDate date] fullDate]);
    NSLog(@"alarmID: %@", self.alarmID);
    NSLog(@"repeat: %@", self.repeatSelection);
    NSLog(@"time: %@", [self.timeSelected.date fullDate]);

}

prepareForSegue:

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    NSLog(@"self.selectedCell: %d", self.selectedCell);
    if ([segue.identifier isEqualToString:@"alarmDetail"] || [segue.identifier isEqualToString:@"addAlarm"])
    {
        AlarmViewController *aVC = (AlarmViewController *)[segue destinationViewController];
        if (self.tableView.editing)
        {
            NSDictionary *setting = [self.alarmList objectAtIndex:self.selectedCell];
            NSLog(@"setting.time = %@", [[setting objectForKey:@"time"] fullDate]);

            aVC.repeatSelection = [setting objectForKey:@"repeat"];
            aVC.alarmID = [setting objectForKey:@"alarmID"];
            aVC.timeSelected.date = [setting objectForKey:@"time"];
        }
    }
}
  • 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-18T06:21:08+00:00Added an answer on June 18, 2026 at 6:21 am

    You can’t set a UI element’s value before its view has been loaded, which is what you’re trying to do when you set the date picker’s date from prepareForSegue. Instead, you need to pass the date to aVC, and then in its viewDidAppear method, set the date picker’s date with that passed in date (you’ll need a property in aVC to hold that date).

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

Sidebar

Related Questions

I have an android app with the following Alarms setup: Alarm A is of
guys :) I have an iOS alarm app, which uses UILocalNotification-s to schedule the
In my app, I have an Alarm which is scheduled to start at 8:00am
I have prepared an Alarm Clock app which uses UILocalnotification for scheduling the alarm.Now
I have a boardcast listener that is listening to alarms my app set previously.
I have an alarm app with several different alarm types that may be triggered
I have an alarm app which I think was programmed in the standard way
The question is very strange: i have done an app that set an Alarm
I have an alarm clock app which works on a timer. When the alarm
I was wondering if it was possible to have an alarm style app that

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.