• 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: Possible bug in NSCalendarDate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible bug in NSCalendarDate


  • Subject: Re: Possible bug in NSCalendarDate
  • From: Eric Forget <email@hidden>
  • Date: Wed, 11 Feb 2004 14:02:13 -0500

> I've come across a strange issue when initializing an NSCalendarDate
> from a string passed through a method argument. If I do this:
>
> - (void)displayEntryForPath:(NSString *)path withDate:(NSString
> *)pathDate
> {
> NSCalendarDate *currentDate;
> currentDate = [[NSCalendarDate alloc] initWithString:pathDate
> calendarFormat:@"%Y/%B/%d %A"];
> [...etc]
> }
>
> I get a nil date. However, if I create a new pointer to the string like
> so:
>
> - (void)displayEntryForPath:(NSString *)path withDate:(NSString
> *)pathDate
> {
> NSCalendarDate *currentDate;
> NSString *dateString = pathDate;
> currentDate = [[NSCalendarDate alloc] initWithString:dateString
> calendarFormat:@"%Y/%B/%d %A"];
> [...etc]
> }
>
> the date is initialized normally. Is this a bug, or am I missing some
> elementary yet arcane nuance in Obj-C?

Jeremy,

To me it looks like for your two test cases, pathData didn't have the save
value. Add something like the following in both case while your are running
it:

NSLog(pathDate);
currentDate = [[NSCalendarDate alloc] ...

Eric

___________________________________________________________________

Eric Forget Cafederic
email@hidden <http://www.cafederic.com/>

Fingerprint <86D5 38F5 E1FD 5D9C 71C3 BAA3 797E 70A4 6210 C684>
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Possible bug in NSCalendarDate (From: Jeremy Dronfield <email@hidden>)

  • Prev by Date: Re: [Slightly OT] Shareware donation collection
  • Next by Date: Re: Possible bug in NSCalendarDate
  • Previous by thread: Possible bug in NSCalendarDate
  • Next by thread: Re: Possible bug in NSCalendarDate
  • Index(es):
    • Date
    • Thread