问答详情
源自:5-7 字典实战和UIKit初探

报错啊亲~~

import UIKit


let colors =

[

    "Air Force Bule":(red:93,green:138,bule:168),

    "Bittersweet":(red:254,green:111,blue:94),

    "Canary Yellow":(red:255,green:239,blue:0),

    "Dark Orange":(red:255,green:140,blue:0),

    "Electric Violet":(red:143,green:0,blue:255),

    "Fern":(red:113,green:188,blue:120),

    "Gamboge":(red:228,green:155,blue:15),

    "Hollywood Cerise":(red:244,green:0,blue:94),

    "Icterine":(red:252,green:247,blue:94),

    "Jazzberry Jam":(red:165,green:11,blue:94)

]


var backView = UIView( frame: CGRectMake(0.0, 0.0, 320.0, CGFloat(colors.count * 50)) )

backView.backgroundColor = UIColor.blackColor()

backView



Console Output显示是:

Playground execution failed: Learning Test.playground:6:1: error: type '(red: IntegerLiteralConvertible, green: IntegerLiteralConvertible, blue: IntegerLiteralConvertible)' does not conform to protocol 'AnyObject'

[

^

到底哪个地方有问题啊~

提问者:Jaywoo8813 2015-07-07 10:33

个回答

  • 小大熊猫
    2015-08-06 13:35:30

    你第一个颜色的blue打错了啊亲