【发布时间】:2016-05-27 08:55:03
【问题描述】:
当我想在我的字典中添加 String(beacons[index].major.stringValue) 时,我收到以下错误:
“[String : String]”类型的值没有成员“major”
if(beacons.count > 0) {
let nearestBeacon:CLBeacon = beacons[0]
for var index = 0; index < beacons.count; index++ {
let uuidString = "00000000-0000-0000-0000-000000000000"
var beacons: [Dictionary<String, String>] = []
beacons.append(["uuid": uuidString, "major": String(beacons[index].major.stringValue), "minor": beacons[index].minor.stringValue, "accurency": String(beacons[index].accuracy)])
Server.beaconsSend(beacons) { // success, data in
print(data)
}
}
}
【问题讨论】:
标签: iphone string swift types ibeacon