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

NSTimer with error message?

I am trying to implement a NSTimer counting down from 5 seconds. But I am getting the message "No known class method for selector scheduledTimerWithTimeInterval:target:selector:userInfo:repeats....." What am I missing? If you look at the bottom of…
Jesper Martensson
  • 1,238
  • 3
  • 18
  • 44
0
votes
1 answer

Maximum time Intervel for NSTimer

In our application we have to auto log out user if he doesn't logged in for a week. What is the best method to schedule it? I used NSTimer with time interval of (24*7*60*60) will it work?. NB: Login screen will automatically shown after…
Eldhose
  • 726
  • 8
  • 19
0
votes
1 answer

Number of weeks in month

I have the following code: NSDate *dateNow = [[NSDate alloc] init]; NSTimeInterval timeDifference = [usersDate timeIntervalSinceDate:dateNow]; // Get the system calendar NSCalendar *sysCalendar = [NSCalendar currentCalendar]; // Create the…
Mick Walker
  • 3,862
  • 6
  • 47
  • 72
0
votes
2 answers

UNIX TIMESTAMP GMT stored in sqlite in Integer, convert to local time zone

in my table in sqlite i have stored a date in timestamp in gmt time zone, in this way: CREATE TABLE task ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, date INTEGER, name TEXT ); when i query the database i want retrieve the date with the…
Piero
  • 9,173
  • 18
  • 90
  • 160
0
votes
1 answer

NSTimeInterval of startOfDay NSDate to GMT

i'm trying to have a NSTimeInterval of a NSDate with time set to zero, so the start of the day, but give me always my timezone that is GMT+2 and not GMT, i'm doing this: This is the category to set the start of a day in a NSDate: #define…
Piero
  • 9,173
  • 18
  • 90
  • 160
0
votes
1 answer

Get time from pressed button (hold pressed)

When trying to get the time, I am not getting the expected value. When I ran this, the time was 19:59. And in the timeDifferenceString, the Value was 71976.894206. I think that this is the current time. I calculate 71976 / 3600 = 19,99 h 0,99 * 60…
user2635239
0
votes
1 answer

Issue in count down days hours minutes from NSDate

I am struggling with updating UILabel for count down for that I use following code - (void)updateLabel { // convert date string to date then set to a label NSDateFormatter *dateStringParser = [[NSDateFormatter alloc] init]; …
java
  • 239
  • 5
  • 20
0
votes
1 answer

Use datePicker for countdown

I want to let the user set a countdown with choosing the timeintervall by a datePicker. I only have the layout, but don't know how to program it as I'm very new to Xcode: The time should count down in the label when the button is clicked. Thanks to…
user2242550
0
votes
1 answer

Is this method going to always give me 12:00:00 of the current day in ios?

Yes, this is similar to NSDate beginning of day and end of day, but that topic does not discuss whether it works for all situations which is what I am asking here. That question dealt with not getting back the correct value because they forgot…
Dan Nichols
  • 55
  • 1
  • 6
0
votes
1 answer

How can I get the fileCreationDate to an accuracy of 6 decimal places when converted using timeIntervalSince1970?

How can I get the fileCreationDate for a file stored in the NSDocumentsDirectory to an accuracy of 6 decimal places when converted to an NSTimeInverval? Some code: //Not accurate enough: NSDictionary* fileAttribs = [[NSFileManager defaultManager]…
Dave Chambers
  • 2,483
  • 2
  • 32
  • 55
0
votes
1 answer

iOS NSTimeInterval from dates wrong

I'm calculating the duration time between a startTime and endTime and am using the following code to get the time interval between two NSDates NSTimeInterval duration = [self.endTime timeIntervalSinceDate:self.startTime]; NSLog(@"interval:…
user1529956
  • 735
  • 2
  • 10
  • 24
0
votes
2 answers

Problems formatting dates

Here is the set up, I have a JSON feed I am using and I want to find the difference between two specific dates called posted_date and planned_expiration_date. They are in an odd format I so I thought I could truncate them down to just the date.I…
DWB
  • 1,544
  • 2
  • 16
  • 33
0
votes
1 answer

Oscillating AVAudioPlayer Volume in Xcode

I'm trying to get the volume of an AVAudioPlayer to oscillate over time. Ex: Every 10 seconds, adjust volume to 0.5, then to 1.0, etc. I have tried using an NSTimer but it only works the first time and doesn't loop. oscillateTimer = [NSTimer…
Steven Ritchie
  • 228
  • 1
  • 2
  • 12
0
votes
1 answer

Calculate the seconds while the app was in background

I am trying to find out the amount of time the app was in the background. Everything compiles fine, but my counter is not incremented with the amount of time the app was in the background. -(void)applicationWillResignActive:(UIApplication…
Kyle Luchinski
  • 153
  • 1
  • 4
  • 18
0
votes
6 answers

UIButton text appear for sometime and it shows emptytext for anothersometime in ios?

I am new in iOS development. I want to show UIButton text for 1 second, and show no text for another 1 second. Can any one tell me the logic in iOS?