Did you dump the arrays to the console to verify uniqueness of your keys?

Can you show that output here?

Sandor

> On Jan 3, 2023, at 17:53, Gabriel Zachmann via Cocoa-dev 
> <cocoa-dev@lists.apple.com> wrote:
> 
> I have this line in my code:
> 
>    NSDictionary * temp = [NSDictionary dictionaryWithObjects: imagefiles_ 
> forKeys: datesAndTimes_ ];
> 
> The funny thing is: 
> the input arrays (imagefiles_ and datesAndTimes_) both have 17 elements;
> however, the dictionary temp has only 7 elements afterwards!
> 
> In the debugger, both input arrays appear to be OK, nothing peculiar about 
> them.
> 
> The array for the keys is constructed essentially the following way:
> 
>    iso_date = [isoDateFormatter_ dateFromString: (__bridge NSString * 
> _Nonnull)(dateref) ];
>    [datesAndTimes_ addObject: iso_date ];
> 
> (I also tried 
> 
>    [datesAndTimes_ addObject: [iso_date copy] ];
> 
> to no avail.)
> 
> The values array is constructed like this:
> 
>    imagefiles_ = [NSMutableArray arrayWithArray: [filelist 
> componentsSeparatedByString: @"\n"] ];
> 
> 
> I'd be very grateful if anybody could shed some light on this.
> 
> Best regards, Gabriel
> 
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please 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:
> https://lists.apple.com/mailman/options/cocoa-dev/admin.szatmari.net%40gmail.com
> 
> This email sent to admin.szatmari....@gmail.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please 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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to