我有一个swift代码,试图理解并将其转换为目标c,下面是代码:
func connectionDidFinish(Identifier: String) {
let count:Int = (data.DictonaryData["actions"]?.allKeys.count)! + (data.DictonaryData["files"]?.allKeys.count)!
ResultsCount_Lable.text = String(count) + " Results"
}
到目前为止我知道
allKeys.count
是NSArray的属性,此代码是否尝试从
NSDictionary
?
根据swift代码,这是正确的代码吗
- (void)connectionDidFinish:(NSString *)string {
NSDictionary *filesDict = [data.dictonaryData objectForKey:@"files"];
NSArray *array = [filesDict allKeys];
int count = array.count;
}