ios - Dealloc an NSObject using ARC -


I have many visual controllers that are with a strong reference to the subclass of NSObject. Each view controller will allow the user to make this object Allows to change in some fashion and then passes the object to the next visual controller. Once the user was able to complete these changes and the process started with a new instance of NSBZ subclass. The problem I am facing is that some view controllers on the stack retain the context of committed examples.

I have tried to use weak, and unsafe, but it makes it difficult to pass the object between the view controllers.

I basically need an example dealloc of an object once committed, so that the references to any view controllers will be zero. However, ARC does not allow clear calls to dealloc.

Can I solve it using NSNotificationCenter or by using a representative, but is there a cleaner way to do this?

Any insights will be greatly appreciated thanks!

"post-text" itemprop = "text">

Model object (object that changes everybody) to the central "model" orbit. You can pass through that there can be a method like currentRecord or like this, all your view controllers may have a weak reference to the current record, Can demand the model. Controllers should never "auto" data objects

This means that the visual controller can use KVO to see the currentRecord changes. Alternatively, it gives you an object that can provide notifications when things change. Your model object can potentially control network or disk access (Alternatively, you can keep a separate controller which also uses the model and provides network or disk access) The key here is MVC and you can see Moderate classes from the controlling classes want to separate.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -