Re: dictionaryWithObjects:keys: looses elements

2023-01-03 Thread Roland King via Cocoa-dev
First guess would be that only 7 of the 17 keys are actually unique dates so 
the dictionary only has 7 entries, one for each of them. 

> On 4 Jan 2023, at 06:52, Gabriel Zachmann via Cocoa-dev 
>  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/rols%40rols.org
> 
> This email sent to r...@rols.org

___

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


dictionaryWithObjects:keys: looses elements

2023-01-03 Thread Gabriel Zachmann via Cocoa-dev
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



smime.p7s
Description: S/MIME cryptographic signature
___

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


Re: CALayer shadows and CGContext clip rect

2023-01-03 Thread David Duncan via Cocoa-dev
While you may have solved your problem, your general approach is not one that 
would be recommended – CALayers are not meant to be drawn into a context, but 
rather added to a layer tree to be rendered by the system. For what you are 
doing you would likely have less issue and better performance drawing your 
shadows with AppKit or CoreGraphics directly instead of using CoreAnimation as 
an intermediary.

> On Jan 1, 2023, at 7:23 PM, David Young via Cocoa-dev 
>  wrote:
> 
> On Thu, Dec 15, 2022 at 08:59:24PM -0600, David Young via Cocoa-dev wrote:
>> Is it possible that a CGContext clip path will clip a shadow cast inside
>> the clip path, if the CALayer whose content cast the shadow is fully
>> outside of the clip path?  Any ideas why?
> 
> Just in case it helps somebody in the future: the answer seems to be
> "yes."  If I enlarge the frame of my sublayer (the layer whose drawn
> content actually casts the shadow) to enclose the entire shadow, then
> the shadow will not be clipped, even though I have set the shadow offset
> & opacity & radius on the superlayer.
> 
> I tried leaving the frame of the inner CALayer alone while enlarging
> the frame of the superlayer so that it enclosed the whole shadow.  That
> didn't help: the shadow was still clipped.
> 
> Dave
> 
> -- 
> David Young
> dyo...@pobox.comUrbana, IL(217) 721-9981
> ___
> 
> 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/david.duncan%40apple.com
> 
> This email sent to david.dun...@apple.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