Posted By

oppey on 05/23/11


Tagged


Versions (?)

可変配列の宣言と列挙子によるアクセス


 / Published in: Objective C
 

  1. //可変配列の宣言
  2.  
  3. NSMutableArray* array = [NSMutableArray array];
  4. [array addObject:image];
  5.  
  6. //列挙子による呼び出し
  7.  
  8. NSEnumerator* enumrator;
  9. enumrator = [imageArray objectEnumerator];
  10. UIImage* image;
  11. while (image = [enumrator nextObject]) {
  12. CGRect rect = CGRectMake( 100.0 , 0.0, 100.0 , 100.0 );
  13. UIImageView *imageview = [[UIImageView alloc] initWithFrame:rect];
  14. imageview.image = image;
  15. [window addSubview:imageview];
  16. }

Report this snippet  

You need to login to post a comment.