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
3 answers

NSDate conversion issue in iOs

I am having a double value that represents a NSTimeInterval. I want to create the correct date from the double value, here is my code. I am getting the output, but there is some changes from the actual value. NSString *modiDate = [NSString…
Mithun
  • 459
  • 1
  • 10
  • 32
0
votes
1 answer

NSTimer/NSTimeInterval

Im trying to make a timer that counts down from 30 to 0 but this is the only way i could think to make it work, but it doesn't work. Anyone know what im doing wrong? .h file @interface countDownAppViewController : UIViewController { UIButton…
nfoggia
  • 513
  • 1
  • 8
  • 28
0
votes
1 answer

Xcode - setting limit for NSDate CountDown timer

Iam using xCode 4.3.2, In my count-down timer project (code showing below), i want to stop the count-down after 30 seconds. How can i set this limit for my count-down? Could you please help me? int countLimit=30; //seconds NSDate *startDate; -…
shebi
  • 707
  • 2
  • 14
  • 23
-1
votes
3 answers

How to get hours and minutes from interval of seconds in objective c

I have a time difference between two datetimes. The interval in seconds is 3660 which means 1 hour and 1 minute ago. How can i show the interval of seconds in hours and minutes like i said before? i can get the hours by doing (3600/60)/60 which…
stefanosn
  • 3,264
  • 10
  • 53
  • 79
-1
votes
3 answers

Increase timeInterval of a Timer

Possible Duplicate: Change the time interval of a Timer So I have a timer: timer=[NSTimer scheduledTimerWithTimeInterval:2 target:self selector:@selector(createNewImage) userInfo:nil repeats:YES]; And I would like that the timer decrease every…
-1
votes
1 answer

How can I handle this European-style timestamp?

I’m trying to check through thousands of lines in video subtitle files (in .srt format) and searched the internet for days on end for a solution, but to no avail. The subs contain in/out timestamps as shown in the following example: 61 00:08:35,504…
Tom
  • 45
  • 7
-1
votes
1 answer

Generating the start and end of the month. Swift 2

I have the following code: func rangeOfPeriod(period: NSCalendarUnit, date: NSDate) -> (NSDate, NSDate) { let calendar = NSCalendar.currentCalendar() var startDate: NSDate? = nil var duration: NSTimeInterval = 0 …
Jess Murray
  • 1,273
  • 1
  • 10
  • 32
-1
votes
1 answer

Compare two dates for Countdown Timer Swift2

I'm querying the createdAt column from Parse. My Parse methods are above this code and then I'm doing this: var createdAt = object.createdAt if createdAt != nil { let twentyFourHours = NSTimeInterval(60 * 60 * 24) self.expiresAt =…
Lukesivi
  • 2,206
  • 4
  • 25
  • 43
-1
votes
1 answer

Display time since now in detailTextLabel iOS

I am using NSDate + Timeago to set time since now in detailLextLabel and it does not seem to be working I'm not sure why? I am retrieving the message from parse.com My method: PFObject *message = [self.messages…
smithyy
  • 220
  • 2
  • 12
-1
votes
1 answer

Create a var of NSTimeInterval without an inital value gives me an error

I'm trying to create a var of NSTimeInterval without assigning a value at the time of initialization. var elapsedTime : NSTimeInterval Even without using it in the code at all, I get an error at the class: Class 'myClassName' has no…
Horay
  • 1,388
  • 2
  • 19
  • 36
-1
votes
1 answer

How to convert date from server to NSString in ios

I get datetime from server in double and when I convert it to date string in ios, I get error of EXEC_BAD_ACCESS from the first line of code below. For example, date string from server: 1426923003 This is how I convert it: NSString…
malinchhan
  • 767
  • 2
  • 8
  • 28
-1
votes
1 answer

Calculate seconds between now and an arbitrary time and day in the future

How can I calculate the time difference (in seconds) from now to a specific day and hour (e.g. 6 PM on the 20th day of next month)? I tried a lot, but didn't succeed in finding an easy solution without calculating a lot and checking lots of…
-1
votes
1 answer

Casting an NSTimeInterval as a NSNumber within a block

I'm having difficulty within a block with assigning an NSTimeInterval value to an NSNumber Here is what I have so far: [player addPeriodicTimeObserverForInterval:CMTimeMake(3, 10) queue:NULL usingBlock:^(CMTime time){ NSTimeInterval…
Linda Keating
  • 2,215
  • 7
  • 31
  • 63
-1
votes
1 answer

Need to show time in seconds without time variation while we change the timezone

I am currently working on bid application,bid APP works mainly based on time i used to calculated the time by using NSLog(@"date %d",(int)[[NSDate date] timeIntervalSince1970]); output:1409031539 I took the server time and compare the device time…
sadeesh
  • 343
  • 1
  • 8
-1
votes
4 answers

Best way to show a UIView for a duration and hide it for an interval

I'm making an application in xcode. I need to show an ad in a UIView for while and hide it after that. For eg. I need to show the UIView for like 15 seconds and hide it for like 30 seconds. What is the best way to do this? Will 2 NSTimers do the…
avrospirit
  • 173
  • 4
  • 15