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

Load xml file in a sub directory #27

Open
ngojchieern opened this issue Jul 26, 2014 · 0 comments
Open

Load xml file in a sub directory #27

ngojchieern opened this issue Jul 26, 2014 · 0 comments

Comments

@ngojchieern
Copy link

In the method initWithXMLFile, in order to load the file the following code is used:
NSString * bundlePath = [[NSBundle bundleForClass:[self class]] pathForResource:aXMLFile ofType:aFileExtension];
I think this is not good. Because when aXMLFile is a file path with directory it won't load correctly. The best way to handle it is to use pathForResource in directory:
NSString *directory = [aXMLFile stringByDeletingLastPathComponent];
NSString *file = [aXMLFile lastPathComponent];

    NSString * bundlePath = [[NSBundle bundleForClass:[self class]] pathForResource:file ofType:aFileExtension inDirectory:directory];

Hope you can fix it in the next version :)

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