我正在写一个FTP下载系统,列表功能:
NSLog(@"%@", listDir.filesInfo);
我在服务器上看到我的文件:
{
kCFFTPResourceGroup = group;
kCFFTPResourceLink = "";
kCFFTPResourceModDate = "2012-11-04 15:49:00 +0000";
kCFFTPResourceMode = 511;
kCFFTPResourceName = "eyeview__0000_sport_general.jpg";
kCFFTPResourceOwner = owner;
kCFFTPResourceSize = 169790;
kCFFTPResourceType = 8;
},
{
kCFFTPResourceGroup = group;
kCFFTPResourceLink = "";
kCFFTPResourceModDate = "2012-11-04 15:49:00 +0000";
kCFFTPResourceMode = 511;
kCFFTPResourceName = "eyeview__0001_sport_reading.jpg";
kCFFTPResourceOwner = owner;
kCFFTPResourceSize = 224795;
kCFFTPResourceType = 8;
},
接下来我想做的是:
for (NSDictionary *file in listDir.filesInfo)
{
NSLog(@"%@", [file objectForKey:(id)kCFFTPResourceName]); //Prints the file name
if ([file objectForKey:(id)kCFFTPResourceType]==8) //*My problem
{
[filesList addObject:[file objectForKey:(id)kCFFTPResourceName]]; //Works perfectly in case outside the if function
}
}
*我的问题是比较错误,我怎么写才能工作?