help-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nsdate


From: David Ayers
Subject: Re: nsdate
Date: Fri, 19 Dec 2003 22:52:01 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007

reuss wrote:
what is the sense of this if there is no return value?
(void) years:months:days:hours:minutes:seconds:sinceDate:

Note the signature is:

- (void) years: (int*)years
        months: (int*)months
          days: (int*)days
         hours: (int*)hours
       minutes: (int*)minutes
       seconds: (int*)seconds
     sinceDate: (NSDate*)date;

The values those int pointers are pointing to will be set.

i.e.

{
  int years = 0;
  int months = 0;
  int day = 0;
  int hours = 0;
  int minutes = 0;
  int seconds = 0;

  [date1 years: &years
         months: &months
         days: &days
         hours: &hours
         minutes: &minutes
         seconds: &seconds
         sinceDate: date2];

  NSLog(@"years: %d months: %d days: %d  "
        @"hours: %d minutes: %d seconds: %d ",
        years, months, days, hours, minutes, seconds);
}



Cheers,
David

also see:
http://www.gnustep.org/resources/documentation/base/NSCalendarDate.html#method$NSCalendarDate(OPENSTEP)-years:months:days:hours:minutes:seconds:sinceDate:







reply via email to

[Prev in Thread] Current Thread [Next in Thread]