xcode - CFString doesn't conform to protocol Hashable? -



xcode - CFString doesn't conform to protocol Hashable? -

i updated xcode 6.1 able work ios 8.1, latest project in facing error.

i error saying "cfstring! not conform protocol hashable", next line:

let attributes = [kctforegroundcolorattributename:uicolor.blackcolor().cgcolor, kctfontattributename: font]

i did not error when running xcode 6.0.1. , also, xcode 6.1 extremely slow. mean, slow doesn't finish loading anything. indexing takes several minutes, , building takes long haven't managed sit down through... crashes.

my main problem hashable protocol though. what's that?

this appears type inference bug dictionaries contain cf objects.

the compiler (apparently) using first key/value pair infer dictionary of type [cfstringref:cgcolorref], , fails compile because cfstringref doesn't conform hashable.

you can work around problem explicitly declaring dictionary type:

let attributes : [string:anyobject] = [ kctforegroundcolorattributename:uicolor.blackcolor().cgcolor, kctfontattributename:font ]

xcode swift ios8 xcode6.1 hashable

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -