Problems with two instances of one TableViewController
I have a application which uses two instances of one TableViewController in two different views.
ViewA holds instance of ViewC
ViewB holds instance of ViewC
When a manipula开发者_开发问答te ViewC from ViewA and switch to ViewBs instance of ViewC the manipulations done via ViewA seems to change ViewBs' instance of ViewC.
Isn't that strange, or is this how it's suppose to work?
It depends on whether the two separate instance of the TableViewController are using the same datastore/model to populate the table. If both are sharing the one model object (be it a datastore, array etc.) then when one manipulates that shared datastore the changes would be reflected in the other table view.
This is the best thing in in Objective-C. what you should do is that you should make 2 copy of that class, here is a nice link to make you understand the consept
精彩评论