I write one application A written in objective-c which use my another framework B which is also written in objective-c. The framework B has some database related operations. To perform those operations I try to use DBAccess ORM (http://www.db-access.org/).
In B I have created a model class which base class is DBObject.
@interface SettingsModel : DBObject
- AppDelegate of application A delegates the DBDelegate protocol, in "-(BOOL) application: didFinishLaunchingWithOptions:" sets the delegate "[DBAccess setDelegate:self];"
- There is a class EnvironmentManager in B, which sets the database name in its init method. [DBAccess openDatabaseNamed:@"dbname"];
- An object of EnvironmentManager is created from A's ViewController's viewDidLoad method.
- Now I try to save and retrieve data from A's viewController methods.
When I run the application A with both save and retrieve methods opened, retrieve method give me the saved data. But if I comment the save data section and run A then no previous data can be retrieved.
- Is it possible to use DBAccess framework from another framework?
- If possible then Please help me to figure-out the problem from my above description.
EDIT:
I have tried some others options, which is discussed @Adrian_H answers comment section. I have got the same path in both A and B using
NSURL *applicationCachesDirectory = [[[NSFileManager defaultManager] URLsForDirectory:NSCachesDirectory inDomains:NSUserDomainMask] lastObject];
NSLog(@"%@",[applicationCachesDirectory path]);