• 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
EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/


  • Subject: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/
  • From: Jean Suisse <email@hidden>
  • Date: Sat, 22 Oct 2016 19:43:37 +0200

Dear All,

Running the code below, I get EXC_BAD_INSTRUCTION error. My questions are:

1. Why ?
2. How can I prevent it ?

Best regards,
Jean

CODE
====
	let directoryURL = URL(fileURLWithPath: "/.DocumentRevisions-V100/")
	let manager		 = FileManager.default

	let keys = [URLResourceKey.nameKey, URLResourceKey.isDirectoryKey, URLResourceKey.isSymbolicLinkKey,
	            URLResourceKey.isVolumeKey, URLResourceKey.isPackageKey,URLResourceKey.isSystemImmutableKey,
	            URLResourceKey.isUserImmutableKey, URLResourceKey.isHiddenKey, URLResourceKey.volumeURLKey,
	            URLResourceKey.fileSizeKey, URLResourceKey.fileAllocatedSizeKey, URLResourceKey.totalFileSizeKey,
	            URLResourceKey.totalFileAllocatedSizeKey, URLResourceKey.contentModificationDateKey,
	            URLResourceKey.isAliasFileKey, URLResourceKey.creationDateKey]
	{
		url, error -> Bool in
		print(error.localizedDescription)
		return true
	}

	while let file = enumerator?.nextObject() as? URL	// EXC_BAD_INSTRUCTION HERE
	{
		// ...
	}


ERROR
=====

The error occurs on the line:

	while let file = enumerator?.nextObject() as? URL

STACK TRACE
===========

0 static DateComponents._unconditionnalyBridgeFromObjectiveC(NSDateComponents?) -> DateComponents
1 thunk
2 -[NSURLDirectoryEnumerator nextObject]
3 AppDelegate.applicationDidFinishLaunching(Notification) -> ()


EXAMPLE APP
===========

Just past the code in a Swift Cocoa App in applicationDidFinishLaunching and run.




_______________________________________________

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


  • Follow-Ups:
    • Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: Resize NSCollectionView items after resize
  • Next by Date: Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/
  • Previous by thread: Re: WKWebView and tooltips
  • Next by thread: Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/
  • Index(es):
    • Date
    • Thread