Is it possible to store dynamically created UIViews into an NSMutableArray? This question suddenly occurred to me. Have any one done it before?
A:
Is possible, Why wouldn't work? ;)
All views are objects. NSObject>UIResponder>UIView But why would you need to store your views in an array? You can get all subviews of a certain view by doing:
NSArray *arrayOfView = [view subviews];
//also:
NSMutableArray *mutableArrayOfView = [[view subviews] mutableCopy];
You actually don't need to store them, they are already stored for you ;)
nacho4d
2010-10-06 08:06:21
Is UIView considered an object?
Melvin Lai
2010-10-06 08:12:33
Cos I wanna store all actions I have done on that view into an array, and hopefully when I call it back. Those actions done will remain.
Melvin Lai
2010-10-06 09:38:49
A:
everything that inherits from NSObject can be stored in NS(Mutable)Array.
use the class browser in the Project Menu to see that literally everything inherits from NSObject.
fluchtpunkt
2010-10-06 08:16:24