• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: storing retrieveing Uint64 data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: storing retrieveing Uint64 data


  • Subject: Re: storing retrieveing Uint64 data
  • From: Nir Soffer <email@hidden>
  • Date: Tue, 26 Dec 2006 20:37:14 +0200


On Dec 26, 2006, at 18:25, julia Cline wrote:

UInt64 startTime = UnsignedWideToUInt64(AbsoluteToNanoseconds(UpTime ()));
printf (" \n\nstart time %llu ", startTime); //checking value
pass ++;
printf ("at pass = %d\n\n", pass); //tracking iteration through method
[nextButtonPressed insertObject: [NSNumber numberWithUnsignedLongLong: startTime] atIndex:pass]; //hopefully putting value into array

Hopefully ? :-)

The way to append values to an array is addObject: and not insertObject:. I guess that you can remove the "pass" temporary if you use addObject.

Read file:///Developer/ADC Reference Library/documentation/Cocoa/ Conceptual/Collections/index.html

Are you sure that "nextButtonPressed" is a proper name for a collection of timestamps?

NSLog(@"\nafter storage starttime is %llu\n\n",[[nextButtonPressed objectAtIndex:pass] longLongUnsignedValue]); //checking value to compare to original

The log output looks like this:

start time 73580042471882  at pass = 1

2006-12-26 08:16:43.544 WordView[5736]
after storage starttime is 4294967296

Maybe its difference between printf and NSLog formatting?

This is an easier and more correct way to check:

UInt64 nano = UnsignedWideToUInt64(AbsoluteToNanoseconds(UpTime ()));

    NSNumber *nanoNumber = [NSNumber numberWithUnsignedLongLong:nano];

    assert(nano == [nanoNumber unsignedLongLongValue]);


Best Regards,

Nir Soffer

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >storing retrieveing Uint64 data (From: julia Cline <email@hidden>)

  • Prev by Date: Re: storing retrieveing Uint64 data
  • Next by Date: extern variable in Development
  • Previous by thread: Re: storing retrieveing Uint64 data
  • Next by thread: extern variable in Development
  • Index(es):
    • Date
    • Thread