> On Jul 7, 2015, at 01:16 , Quincey Morris
> <[email protected]> wrote:
>
> On Jul 7, 2015, at 01:08 , Rick Mann <[email protected]> wrote:
>>
>> But I can't get Swift 2 to let me.
>
> You’ve left a path through the code that doesn’t set ‘someString’. So, you’ll
> need to add:
>
>> else
>> {
>> someString = nil
>> }
>
> to the ‘if’.
Well, I wanted to do this:
// Get the hero thumbnail…
let thumbURL: String?
for imgD in images
{
if let isHero = imgD["is_hero"] as? Bool where isHero,
let t = imgD["thumbnail_signed_src"] as? String
{
thumbURL = t
break
}
}
print("Thumb: \(thumbURL)")
But it complains that it's used before being initialized. I guess I want it to
initialize it to nil, then let me assign it once, then keep it constant.
--
Rick Mann
[email protected]
_______________________________________________
Cocoa-dev mailing list ([email protected])
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 [email protected]