title: How to update an object's image in NSMutableArray?
body: <p>I am trying to set the image of the face down card to the image that the value of the card is. The method in KCCard, image:, returns the image of the card.</p>
  
  <pre><code>- (UIImage *)image:(BOOL)yesOrNo
  {
      if (!yesOrNo) {
          return [UIImage imageNamed:@"back-blue-150-3.png"];
      } else {
          return [UIImage imageNamed:[NSString stringWithFormat:@"%@-%@-150", [self suitAsString], [self valueAsString]]];
      }
  }
  </code></pre>
  
  <p>The code I am using in the deal method is as follows.</p>
  
  <pre><code>    int lastDealerX = 437;
      //int lastDealerY = 49;
  
      int lastDealerTag = 0;
  
      for (KCCard *aCard in dealerHand) {
          if (lastDealerTag == 0) {
              KCCardView *cardView = [[KCCardView alloc] initWithFrame:CGRectMake(lastDealerX, 49, 150, 215)];
              cardView.backgroundColor = [UIColor blackColor];
              cardView.image = [aCard image:NO];
              cardView.tag = lastDealerTag;
              [self.view addSubview:cardView];
  
              lastDealerTag = lastDealerTag + 1;
  
              lastDealerX = lastDealerX + 42;
          } else {
              KCCardView *cardView = [[KCCardView alloc] initWithFrame:CGRectMake(lastDealerX, 49, 150, 215)];
              cardView.backgroundColor = [UIColor blackColor];
              cardView.image = [aCard image:YES];
              cardView.tag = lastDealerTag;
              [self.view addSubview:cardView];
  
              lastDealerTag = lastDealerTag + 1;
  
              lastDealerX = lastDealerX + 42;
          }
      }
  </code></pre>
  
  <p>The KCCardView with tag 0 shows the card face down and the other card is face up. The problem is that when I want the face down card to show, it won't. Here is the show code.</p>
  
  <pre><code>- (IBAction)showCard:(id)sender {
      for (UIView *view in self.view.subviews) {
          for (KCCard *aCard in dealerHand) {
              KCCardView *cardView = (KCCardView *)view;
              if (cardView.tag == 0) {
                  cardView.image = [[dealerHand objectAtIndex:0] image:YES];
              }
          }
      }
  }
  </code></pre>
  
  <p>KCCard is an NSObject, KCCardView is a UIImageView, and dealerHand is an NSMutableArray.</p>
  
  <p>Here is a video showing the build and run: <a href="http://aleckazarian.com/misc/Blackjack.mov" rel="nofollow">http://aleckazarian.com/misc/Blackjack.mov</a>
  Here is the XCode project: <a href="http://aleckazarian.com/misc/Blackjack.zip" rel="nofollow">http://aleckazarian.com/misc/Blackjack.zip</a></p>