Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

会不会漏掉一些图片 #37

Open
wangxiaobupt opened this issue Apr 11, 2018 · 0 comments
Open

会不会漏掉一些图片 #37

wangxiaobupt opened this issue Apr 11, 2018 · 0 comments

Comments

@wangxiaobupt
Copy link

wangxiaobupt commented Apr 11, 2018

for (NSString *path in resPaths) {
NSString *name = [path lastPathComponent];
if (!name.length) {
continue;
}

        NSString *keyName = [StringUtils stringByRemoveResourceSuffix:name];

        if (!tempResNameInfoDict[keyName]) {
            BOOL isDir = NO;
            ResourceFileInfo *info = [ResourceFileInfo new];
            info.name = name;
            info.path = path;
            info.fileSize = [FileUtils fileSizeAtPath:path isDir:&isDir];
            info.isDir = isDir;
            tempResNameInfoDict[keyName] = info;
       }

}

这段代码中可能存在path不同但[path lastPathComponent];相同的图片,比如在不同的子工程中,后者就不会加到字典中。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant