iphone - Organizing instance variables in a view hierarchy -


When programming for the iPhone, I think I have to use the same example of an object in many objects is. What is the best way to handle this? My strategy has been prepared to make it as a member of the original scene, and it has been done to pass the later ideas which it retains as a member. However, this does not look like a very good approach because it will be very difficult to update what is being pointed out in the context of each class. I have also seen appletlets used for this purpose along with singleton sections. As an iPhone developer, how do you handle this problem in large apps?

In order to make the application representative representative easy, the downside is that the representative To fetch and then get the shared object. Singletons mean only classes using singleton should be aware of this, but for this it can be difficult to write unit tests. Or cleaned properly in low memory conditions. In addition, you should write Singleton Classes more carefully so that they can work correctly (see Singleton on Applet Docs).

Passing an object can be outdated because sometimes you have only one link to the object for someone else, so I would like to avoid that point of view unless you have a parent Do not go to immediate children.

Due to the simplicity of the dependency graph, between the first two, I lean slightly towards loneliness (according to the sections that only take care of the bunch of a single head with a single head apt delicate ) If you had many things to do then you would have to create a singleton distribution class, which will be organized on single instances of groups of classes, to keep the lip to the lamps and to many such classes There was no need to make who was the true lyricist. / P>

I like using an app representative to catch the root of my real UI, such as a tab bar controller or primary view controller, it seems more natural than filling it elsewhere.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -