0

Any view controller by adding the following code:

The Xcode6 will stop working.

Unable to compile and run.

is a xcode problem?

let popularTableData = [
    [
        "id": 1,
        "title": "xxx"
    ],
    [
        "id": 2,
        "title": "xxx"
    ],
    [
        "id": 3,
        "title": "xxx"
    ],
    [
        "id": 4,
        "title": "xxx"
    ],
    [
        "id": 5,
        "title": "xxx"
    ],
    [
        "id": 6,
        "title": "xxx"
    ],
    [
        "id": 7,
        "title": "xxx"
    ]
]

1 Answer 1

1

Yes, it is a bug. The Swift compiler has a problem determining the type of popularTableData in this case. Give it some help by explicitly declaring the type:

let popularTableData: [[String: AnyObject]] = [

I placed your code in a Playground, and it eventually worked (after over a minute). The compile time seems to increase exponentially with each extra dictionary element added to the array. When you tell the compiler the type, it compiles quickly.

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.