2014-11-25 61 views
0

如何獲取之前創建的所有lproj文件夾?我需要知道在Xcode項目中創建了多少種語言,以便向用戶提供在iOS應用中強制使用另一種語言的選項獲取Xcode中的所有lproj文件夾

+0

這與'xcode IDE'沒有關係,那你爲什麼要用這個標籤? – Popeye 2014-11-25 10:37:20

回答

0

我找到了解決方案。是最合適的嗎?

NSArray *dirFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:[[NSBundle mainBundle] bundlePath]error:nil]; 
NSArray *lprojFiles = [dirFiles filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"self ENDSWITH '.lproj'"]]; 
相關問題