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
rm...@latencyzero.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