Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/
Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/
- Subject: Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/
- From: Jean Suisse <email@hidden>
- Date: Sat, 22 Oct 2016 23:21:13 +0200
> On 22 Oct 2016, at 23:15, Jens Alfke <email@hidden> wrote:
>
>
>> On Oct 22, 2016, at 12:11 PM, Jean Suisse <email@hidden <mailto:email@hidden>> wrote:
>>
>> To refine, what difference is there between ObjC’s
>> for (NSURL* file in enumerator)
>> and swift’s
>> while let file = enumerator?.nextObject() as? URL
>
> That’s irrelevant. Look at the backtrace of the crash — the problem has to do with Foundation.DateComponents. Apparently the ObjC-Swift bridge is trying to translate a date value from the enumeration result, and crashing due to a bug.
>
> —Jens
I don’t know if it’s so irrelevant, because in the backtrace the swift code calls -[NSURLDirectoryEnumerator nextObject]. Maybe the ObjC code doesn’t. Hence my question.
You asked me if the ObjC equivalent would crash. Here is the code I came up with. It is only relevant if that code actually runs the same API. That’s the origin of my question.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden