Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > NSDate (stupid newbie question)

NSDate (stupid newbie question)
Thread Tools
JBL
Junior Member
Join Date: Sep 2000
Status: Offline
Reply With Quote
Jan 23, 2001, 11:54 AM
 
I would like to measure the amount of time between successive calls of a particular function. This means that I need to save the time of the last call. I want to put in a line of code like this:
mostRecentDate = [NSDate date]
The documentation says that [NSDate date] creates a new NSDate object. Does that mean that I need to deallocate the previous NSDate object?
(I wish that Apple had more Obj-C sample code. I am having trouble getting the hang of this language.)
     
davebrennan
Guest
Status:
Reply With Quote
Jan 23, 2001, 03:44 PM
 
You don't need to deallocate the NSDate object - it is automatically deallocated at the end of the method you call [NSDate date] in using autorelease. For more details see:
http://developer.apple.com/techpubs/...Ownership.html

regards,

Dave
     
JBL  (op)
Junior Member
Join Date: Sep 2000
Status: Offline
Reply With Quote
Jan 23, 2001, 05:02 PM
 
Thanks!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:09 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2