How to load different viewcontrollers depending on current time (using -(void)didTap...)?


This question already has an answer here:


you can use the following

- (void)didTap_imageButton3:(id)sender forEvent:(UIEvent *)event {
    NSDate *date = [NSDate date];
    NSCalendar *calendar = [NSCalendar currentCalendar];
    NSDateComponents *components = [calendar components:NSHourCalendarUnit fromDate:date];
    NSInteger hour = [components hour];

    //Basing on the hour present a different view controller
    if (5 < hour && hour < 10) {
        TramvajViewController *controller = [[TramvajViewController alloc] init];
        [self.navigationController pushViewController:controller animated:NO];
        [controller release];
    else {
        //Load other VC

Need Your Help

I want to add jstl C:if tag in my code in a form but not able to understand how to implement it

forms jsp jstl

Hello i want to add JSTL C:if tag in a form but did not able to understand how to implement it .

MySQL Workbench Edit Table Data is read only

mysql mysql-workbench

When trying Edit Table Data in MySQL Workbench 5.2.37, its in read only mode.