Nested resources in Objective-C?

I have a library in both C # and Java, which use some XML files to create many objects. I use them, so I don’t need to hardcode them in both languages ​​and easily update the data.

In C # and Java, I can embed these files in a DLL / Package.

How can I do something like this in Objective-C?

+3
source share
1 answer

This is not a language level issue; it is a platform level packaging issue. In both Mac OS X and iOS, as a rule, you will add a resource file to your project, then get the file path with NSBundle:

NSString *path = [[NSBundle mainBundle] pathForResource:@"file" ofType:@"xml"];

Objective-C . , Mac OS X, mainBundle , , bundleForClass:.

iOS , , . .

+6

Source: https://habr.com/ru/post/1757884/


All Articles