Xcode debugger reporting Swift dictionaries as empty (po reports {})

杀马特。学长 韩版系。学妹 提交于 2019-12-06 08:35:12

问题


When I wait until Xcode 6.1.1 hits a breakpoint after this line

let metrics = ["leading" : 15.0, "size" : 44.0]

and then type po metrics the debugger reports (after several seconds delay) {}, which seems wrong. po metrics.count reports 2, which is right.

Is this a feature or a bug?

UPDATE The problem appears when debugging on a physical device (iPhone 5), e.g. not on a simulator (e.g. iPhone 6 Plus).


回答1:


Did you try doing this way?

let metrics:NSDictionary? = ["leading" : 15.0, "size" : 44.0]

println(metrics!)


来源:https://stackoverflow.com/questions/28124159/xcode-debugger-reporting-swift-dictionaries-as-empty-po-reports

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!