my application is world guide. there is a 4 tableview and 4 mapview.
- Continent
- Country
- City
- Place
I have taken NSMutableArray for each above item and allocate them in view did load . when Asia is selected from the Continent table then only Asian countries should display from the country array. if country is selected then only city of respective country should be display in city table view from the city array like vice for place. it’s like a tree. it is too lengthy to work with an array. Please guide me if another way is exist that make this task easy.
I think the better way to implement should be:
NSMutableArrayonly to store the top level Object.NSMutableDictionaryto store the mid & lower level objects.NSMutableDictionaryin yourNSMutableArrayat each index of your top level Object.NSMutableDictionary& value as country name & follow the same for next level.In this case, you have to maintain only a single
NSMutableArrayto work. No need to handle 4-5 different arrays.Hope it works for you.