Can i keep my Object in memory till application exits?

58 views Asked by At

I am using Native contact to store in NSMutableDictionary. So whenever required i can query any contact from NSMutableDictionary without going to Native API's (ABAdressBookRef, CNContactStore).

My Concern is how long NSMutableDictionary will be available in memory?.

2

There are 2 answers

0
Rob Napier On BEST ANSWER

As long as you hold a strong reference to it somewhere. When there are no strong references to it, it will be released.

0
Shehata Gamal On

You can create a singleton class with any number of properties that you want to keep them a live during app time , edit , read them from anywhere in the app