pickzy.com

C  |  C++  |  Objective-C  |  VC++  |  Win32  |  MFC  |  Java  |  Php  |  Delphi  |  Visual Basic  |  .Net  |  Networking  |  General  |  Games  |  Jobs  |  Javascript  |  




Menu

pickSourcecode.com


        

 




 

C > Solution

 

Array of UIImageView s



Is is possible to create an array of UIImageView's? If so, how is it declared and implemented?

For example:

UIImageView *oneView
UIImageView *twoView
UIImageView *threeView

rewritten would result in something like: UIImageView *mynumberView[3]


The simplest way is to use arrays like C.
declare it this way :
Code:
UIImageView *imageViewArray[3];
and then call it like this:
Code:
imageView[0] = [UIImageView alloc] initWithSomething];
Or if you want to use some classes, then use NSArray or NSMutableArray.

ie:

Code:
NSMutableArray * imagesArray;

imagesArray = [[NSMutableArray alloc] init];

UIImageView *oneImage = [[UIImageView alloc] initWithSomething];
[imagesArray addObject:oneImage];
[oneImage release];

UIImageView *Imagetwo = ... (do the same as above)
this solved your question?

 
Privacy Policy | About Us