Skip to content Skip to sidebar Skip to footer

Equivalent To R In Ios

In android we have the R class that stands for Resources, where we have references to all of our resources and we can easily access them in the code. Is there an equivalent in iOS?

Solution 1:

There is no R class equivalent access method.

In Android, the R class represents access to resources that are consolidated into a native format. iPhone does not do this. Instead, resource files are just copied as is into the application bundle and must be found & opened as such.

Solution 2:

You could create a class to store all of your data for the app. iOS generally likes the app to run lean and mean, so only storing your objects for as long as you need them, releasing them as soon as you are done with them. If you were to store everything globally, it would add some overhead, but assuming you don't have a ton of information, it shouldn't be an issue.

Solution 3:

There is no equivalent for this in iOS apps. All you get is files that you can enumerate using standard file I/O.

However, you can emulate it partially. Here's a simple demo on GitHub

Post a Comment for "Equivalent To R In Ios"