• 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
Value of type '[AnyObject]!' has no member 'Generator'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Value of type '[AnyObject]!' has no member 'Generator'


  • Subject: Value of type '[AnyObject]!' has no member 'Generator'
  • From: Rick Mann <email@hidden>
  • Date: Sat, 03 Oct 2015 22:48:13 -0700

Why won't this compile?

let devices = AVCaptureDevice.devices()		// OKAY
for device in devices
{
	print("Device: \(device)")

	for f in device.formats			// no member "Generator"
	{
		print("  format: \(f)")
	}
}

Each of the loops' collections is of type [AnyObject]! But for the device.formats, I get

	AppDelegate.swift:25:13: Value of type '[AnyObject]!' has no member 'Generator'

Also, command-clicking on device() takes me to a Swift interface file. Command-clicking on formats takes me to an Objective-C header.

If I put a ! after device.formats, it compiles.

--
Rick Mann
email@hidden



_______________________________________________

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: Value of type '[AnyObject]!' has no member 'Generator'
      • From: Roland King <email@hidden>
  • Prev by Date: Re: NSView - trouble setting next responder on 10.10 - works okay on 10.9
  • Next by Date: Re: Value of type '[AnyObject]!' has no member 'Generator'
  • Previous by thread: Re: An off-topic question/post that may be worth a short read. (Sorry for the xpost)
  • Next by thread: Re: Value of type '[AnyObject]!' has no member 'Generator'
  • Index(es):
    • Date
    • Thread