ios - Is the object passed in prepare a singelton ?What's the different? -


i notice object pass between 2 view controllers has same address in 2 controllers. , if change value in controller b, value of object in controller changed automatically. inspire me consider object singelton..for singelton design pattern, advantage using global valuable saving system resource , keep consistency of object.what thinking right? there difference?

  1. an object passed between 2 view controller can same object if use strong property.it can 2 different objects if use copy property.
  2. if use singleton.it same instance of 1 class.when using singleton,you should manage life circle of it.

it design.

when using object pass between viewcontrollers,only 2 viewcontrollers can access object.

but,when using singleton,every place of application can access instance.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -