+ Reply
Results 1 to 2 of 2
  1. #1
    What's Jailbreak?
    Join Date
    May 2008
    Location
    Pennsylvania
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Converting Raw Seconds to 00:00:00 format

    I have an NSTimer that spits out a float value every 1/16th of a second. (Every 1/16th of a second, 1/16 of a second is taken off the float value).

    The application functions as a countdown timer, so I want the raw fractional seconds (i.e. 9.9375) to be converted into (hours:minutes:seconds:000).

    This is somewhat hard to explain, and I apologize, but right now, I have an NSString that looks like 9.xxxx; my goal is for it to look like 00:00:9xx.

    If this is possible, I would appreciate some guidance.

    Thanks.
    ________

  2. #2
    Developer NetMage's Avatar
    Join Date
    Aug 2007
    Location
    Virginia
    Posts
    1,292
    Thanks
    71
    Thanked 210 Times in 168 Posts

    I would suggest using NSDateFormatter after creating an NSDate using method dateWithTimeIntervalSinceReferenceDate:
    Starlight Computer Wizardry
    Pocket-sized Development
    Follow me on twitter: @NetMage

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts