Let me answer you according to your Java Statements for better clarity:
//Java:
JLabel l1=new JLabel();
//Objective C:
UIImageView * l1= [[UIImageView alloc] init];
//Java:
JLabel l2=new JLabel();
//Objective C:
UIImageView * l2 = [[UIImageView alloc] init];
//Java
JLabel [] arrayOfLabels = new JLabel[2];
//Objective C
NSMutableArray * imagesArray = [[NSMutableArray alloc] init];
//Java
arrayOfLabel[0] = l1;
//Objective C
[imagesArray addObject:l1];
//Java
arrayOfLabel[1] = l2;
//Objective C
[imagesArray addObject:l2];
Since you are not using ARC (i guessed it from your comment), so therefore you must release the things manually as part of memory management as:
[l1 release]; //After adding it to imagesArray
[l2 release]; //After adding it to imagesArray
And release the imagesArray
when you don't need it. Normally it is done in dealloc()
, but you can release it at any point where you don't need it further by simply calling:
[imagesArray release];
imagesArray = nil;
Hope so this will help you.