我尝试检索某个对象的值,但是当我尝试访问major
,minor
或UUID
时,它会一直返回0。但是当我print
beacon.beacon
时,它会返回正确的值。这是我的代码:
for beacon in allContent {
print(beacon.beacon!)
}
返回
Beacon {
id = 1;
name = Beacon 1;
major = 10221;
minor = 19561;
UUID = FDA53493-A4E2-4FB1-AFCF-C6EB07646825;
}
检索次要
for beacon in allContent {
print(beacon.beacon!.minor)
}
返回
0