Questions tagged [nstimeinterval]

an Objective-C Foundation Data Type that specifies a time interval

NSTimeInterval is an Foundation Data Type that specifies a time interval. NSTimeInterval values are in seconds.

Resources

Related Tags

364 questions
0
votes
1 answer

Waiting 3 sec before running sprite kit scene

I have a sprite kit scene in which enemies are dispatched at random intervals and a player has to destroy them. However I want to wait a 3 seconds before they start spawning. I tried -(id)initWithSize:(CGSize)size { if (self = [super…
temp
  • 639
  • 1
  • 8
  • 22
0
votes
1 answer

How to store Date from internet like "2014-12-01T20:00:00Z" in core data

How to store Date from internet like "2014-12-01T20:00:00Z" in core data and compare this date with [NSDate Date] using nspredicate. as i am using @((date" >= startDate) && (date <= endDate))..But it fails to match date always..
0
votes
1 answer

NSTimeInterval, NSDate & int64_t Yields Unreasonable Time Calculation

I am doing what should be a simple calculation involving things like int64_t, NSTimeInterval and NSDate in order to keep track of the expiration of a token which expires within an hour of its acquisition and is refreshed (exchanged for a new one)…
jac300
  • 5,182
  • 14
  • 54
  • 89
0
votes
1 answer

Determining if currentPlaybackTime is a cuepoint

With some help from stackoverflow, I managed to implement a timer that checks the currentPlaybackTime variable in a mediaplayer video every 1/10th of a second. I also have an NSArray of Cue objects that have a time attribute (NSNumber). I want some…
Dol
  • 944
  • 3
  • 10
  • 25
0
votes
1 answer

NSTimeInterval 1 second difference with long value

Hi I am doing mathematical operations with NSTimeInterval(which is double type) with one long variable NSTimeInterval timeDifference =[endDateTime timeIntervalSinceDate:startDateTime]; long duration= timeDifference-[dauseDuration longValue]; …
Sandeep Khade
  • 2,832
  • 3
  • 21
  • 37
0
votes
2 answers

Converting Date to milli seconds in ios

hi am using following to convert date to string in objective C. -(void)convertDateToJsonString:(NSString *)strDate { NSDateFormatter * formatter = [[NSDateFormatter alloc] init]; [formatter setTimeZone:[NSTimeZone systemTimeZone]]; …
Sugan S
  • 1,782
  • 7
  • 25
  • 47
0
votes
1 answer

Compare current time with two times-of-day strings

How can i get time like "11:30" formate so that i want to compare it with the following: strOpenTime = @"10:00"; strCloseTime = @"2:00"; so how can i get current time like as above open/close time format and i want if the current time is inside the…
jigs
  • 839
  • 1
  • 6
  • 23
0
votes
1 answer

Sync app with server in background

I am building an app that requires that I look twice a day for new records in a dynamic json file and save it in core data and update the apps badge count. So how would I go about getting that app to run the update function in the background so the…
0
votes
1 answer

NSTimeInterval showing 0

When tracking time since a date using NSTimeInterval, it shows 0.000000 in the NSLog. Here is my Time Interval: NSTimeInterval timeInterval = [intialtime timeIntervalSinceNow]; Here is how I log the data: NSLog(@"%f",timeInterval); What am I…
PanicDev
  • 315
  • 1
  • 4
  • 12
0
votes
2 answers

Why is converting my float to an int making the number negative?

NSTimeInterval expirationTime = (secondsSinceUnixEpoch*1000)+120000; expirationTime = ceil(expirationTime/2); int expirationInt = (int)expirationTime; NSLog(@"%d", expirationInt); The log output is always negative, even though before I convert it…
eddie_cat
  • 2,527
  • 4
  • 25
  • 43
0
votes
1 answer

iOS: why can't I add two NSTimeIntervals together?

According to this article I should be able to simply += two NSTimeIntervals together... but I can't. I'm trying to handle hitting 'pause' on a stop watch and being able to continue by using a 'running counter' so to speak of an NSTimeInterval called…
Beau D'Amore
  • 3,174
  • 5
  • 24
  • 56
0
votes
2 answers

Calculate time difference between two NSDates with different locales

I have a current NSString in the format of 2010-04-23 00:00:00 and then I'm trying to get the number of days passed from the current day. However, I'm not sure how to handle when the user changes their locale to Thailand for example. Here is some of…
aahrens
  • 5,522
  • 7
  • 39
  • 63
0
votes
1 answer

How to store timed passed in NSDate

I want to store the amount of time that has passed within NSDate. So when a button is trigger i want a timer to start counting, i guess in seconds, and then store how much time has passed till the user has hit the next button within NSDate so I can…
4GetFullOf
  • 1,738
  • 4
  • 22
  • 47
0
votes
4 answers

converting NSString to precise number for performSelector: afterDelay:

I am communicating with a webservice to retrieve a numerical value that comes into my function as an NSString. This number tells me the precise amount of time to wait until I perform another action, and it is critical that it be precise. As an…
hookjd
  • 117
  • 1
  • 1
  • 7
0
votes
2 answers

Convert NSTimer to UILabel-string?

I am trying to implement a NSTimer counting down from 5 seconds. But I have not been able to convert a NSTimer to a UILabel counting from 5 to 0. What steps should I take from here? Regards MTPopupWindow.h @class…
Jesper Martensson
  • 1,238
  • 3
  • 18
  • 44