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

2015-10-05 Thread Graham Cox
> On 6 Oct 2015, at 5:42 am, Jens Alfke wrote: > > Optionals (under various names) have been in use in functional languages for > a long time, e.g. Haskell, OCaml, Scala, ML. They’ve been added to Java > recently and are being proposed for C++. > > Optionals are, among other things, a way to

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

2015-10-05 Thread Charles Srstka
> On Oct 5, 2015, at 1:42 PM, Jens Alfke wrote: > > The problems in this thread seem to stem from missing or incorrect > annotations in one Cocoa class (CIFilter IIRC; I don’t have the whole thread > in front of me.) AVCaptureDevice, actually, but this is exactly it. The problem is that Apple

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

2015-10-05 Thread Jens Alfke
> On Oct 4, 2015, at 4:53 PM, Graham Cox wrote: > > The explanation as to why Swift doesn’t suck doesn’t fit any notion in > compuer science that I have ever heard of in almost 40 years of programming. https://en.wikipedia.org/wiki/Option_type Optionals (under various names) have been

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

2015-10-04 Thread Graham Cox
> On 4 Oct 2015, at 11:10 pm, Roland King wrote: > >> A) Ah, so it's Swift continuing to suck. > > No, not at all, Swift is being consistently consistent. The variable is a > ‘!!’ which means it’s implicitly unwrapped optional of an implicitly > unwrapped optional of an array, so when you use

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

2015-10-04 Thread Rick Mann
> On Oct 4, 2015, at 09:51 , Quincey Morris > wrote: > > On Oct 4, 2015, at 05:10 , Roland King wrote: >> >> Quincey sharpens his keyboard > > No, the only person who’d get hurt is me. > > There are actually several strange things going on here in the > AVCaptureDevice API, and they look l

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

2015-10-04 Thread Quincey Morris
On Oct 4, 2015, at 05:10 , Roland King wrote: > > Quincey sharpens his keyboard No, the only person who’d get hurt is me. There are actually several strange things going on here in the AVCaptureDevice API, and they look like bugs to me: — ‘devices’ and ‘formats’ are documented to return array

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

2015-10-04 Thread Roland King
> On 4 Oct 2015, at 18:56, Rick Mann wrote: > > >> On Oct 3, 2015, at 23:03 , Roland King wrote: >> >> Apply the usual swift technique and break it down into more than one line >> then go look at the types of each variable. >> >> let ff = device.formats >> let pp = ff! >> >> option-click

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

2015-10-04 Thread Rick Mann
> On Oct 3, 2015, at 23:03 , Roland King wrote: > > Apply the usual swift technique and break it down into more than one line > then go look at the types of each variable. > > let ff = device.formats > let pp = ff! > > option-click on each of those variables and you’ll quickly see the ‘!!’ o

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

2015-10-03 Thread Roland King
rmats // 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

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

2015-10-03 Thread Rick Mann
(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 f