I have a class A which is a subclass of uitableviewcontroller and one more class B which actually displays my tableview with its content is a subclass of A.
There's an xml parser which parses my xml and stores the content in an nsmutablearray of application delegate. Now, I fetch this delegate array into a local nsmutablearray in class B to minimise the communication between the two classes i.e. delegate and class B and display that.
After certain condition is met in class A, I'm calling xml parser to refill the delegate array and I'm calling class B's tableview reload method. The problem is when I call the tableview's reload data, class B's delegate methods are called. But before that I need to grab this delegate array in local array in class B. How shall I do开发者_如何学编程 that?
Can anybody please help?
Thanx in advance.
Suggest that you post a notification from your xmlParser when it has updated the array. Object B (instance of Class B) can register for the notification. Upon receiving the notification Object B can reload the array before calling [[self tableView] reloadData] in the implementation of Class B.
精彩评论