【发布时间】:2014-09-16 15:39:55
【问题描述】:
我正在尝试复制我在 Objective C 中执行的 for in 循环,但出现“'AnyObject' 没有名为 'GeneratorType' 的成员”错误:
for (NSString *file in [dict objectForKey:@"Files"]){
NSString *content = [[source stringByAppendingPathComponent:@"Contents"] stringByA
}
这是我的斯威夫特
for file in dict.objectForKey("Files") {
let content:String = source.stringByAppendingPathComponent("Contents").stringByAppendingPathComponent(file)
}
我尝试为字典定义一个持有者变量。谁能看到我在这里做错了什么?
【问题讨论】:
标签: loops dictionary swift