Take the 2-minute tour ×
Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.
+(NSArray *)stampImages{
        UIImage *image1 = [UIImage imageNamed:@"abcd.png"];
        UIImage *image2 = [UIImage imageNamed:@"fron.png"];
        UIImage *image3 = [UIImage imageNamed:@"amule.png"];
        UIImage *image4 = [UIImage imageNamed:@"dog2_trans.png"];
        UIImage *image5 = [UIImage imageNamed:@"dolphin.png"];  
        UIImage *image6 = [UIImage imageNamed:@"hit.png"];  
        UIImage *image7 = [UIImage imageNamed:@"abcd.png"];
        UIImage *image8 = [UIImage imageNamed:@"qw.png"];
        UIImage *image9 = [UIImage imageNamed:@"rewq.png"];
        UIImage *image10 = [UIImage imageNamed:@"rac.png"];
        UIImage *image11 = [UIImage imageNamed:@"gs.png"];  
        UIImage *image12= [UIImage imageNamed:@"acb3.png"];   
        NSMutableArray *stampList = [NSMutableArray arrayWithObjects:image1,image2,image3,image4,image5,image6,image7,image8,image9,image10,image11,image12,nil];
        return stampList;
    }

I guess i made mistake of creating UIImage *image1 too UIImage *image11..... Can any one advice me how to figure it!

share|improve this question

1 Answer 1

up vote 6 down vote accepted

If you have the list of files you want to add to the array, then you can fast enumerate through them


NSArray *fileArray; //List of file name here
NSMutableArray *stampList = [NSMutableArray array];
for (NSString *fileName in fileArray)
{
    [stampList addObject:[UIImage imageNamed:fileName]];
}

share|improve this answer
    
The amateur programmer Thanks a lot! –  user905582 Feb 22 '12 at 22:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.