IQDatabaseManager contains CoreData helper classes with convenience methods to communicate with CoreData for performing common tasks(inserting+updating+deleting+sorting+searching) on database records. Note that IQDatabaseManager is abstract class. You should not create it's object directly
1) Convenience methods to Insert, Update, Delete records.
2) Convenience methods to do Searching and Sorting.
I created another subclass called MyDatabaseManager for demo purpose.
Step1:- Just create your
Data Model & create your
Entities in your
Step2:- Drag and drop
IQDatabaseManger.h & .m file in your project.
IQDatabaseManager with your custom class name. Import
IQDatabaseManagerSubclass.h in your .m file of your custom class(Don't import it in your .h file), this is the way of implementing protected methods in Objective-C.
+(NSURL*)modelURL abstract method declared in
IQDatabaseManagerSubclass.h in your subclass and return your DataModel URL.
Step5:- Just write your own wrapper in your subclass with your DataModel entities with the help of
IQDatabaseManagerSubclass.h header file.
Step6:- To call your methods, use it's default singleton instance via
sharedManager. For example use
[CustomDatabaseManager sharedManager] getAllData] to call
You can also create multiple subclasses of
IQDatabaseManager in one project. The
sharedManager method will return singleton instance per subclass. For example if you have 4 subclasses the there will be 4 singleton instances, one for each subclass.
Distributed under the MIT License.
Any contribution is more than welcome! You can contribute through pull requests and issues on GitHub.
If you wish to contact me, email at: email@example.com