[iOS] 取目前時間 : unix time / unixtime / timeIntervalSince1970 / NSDate / NSUserDefaults standardUserDefaults

..

取目前時間( unix time : integer )

// ---

    int now_timestamp = [[NSDate date] timeIntervalSince1970];
// ---

設定內定值 standardUserDefaults

// ---
    NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
    
    if ( [prefs stringForKey:@"starturl"]==NULL ) {
        [prefs setObject:@"https://www.monster.com.tw/app" forKey:@"starturl"];
    } else {
        NSLog(@"%@" , [prefs stringForKey:@"starturl"] );
    }
    
    [prefs setInteger:42 forKey:@"integerKey"];
    [prefs setInteger:1111 forKey:@"age"];
    
    NSLog(@"%@" , [prefs stringForKey:@"age"] );