Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- static NSString *cellName = @"RandomCELL";
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellName];
- //cell=nil;
- if (cell == nil)
- {
- [[NSBundle mainBundle] loadNibNamed:@"RandomCell" owner:self options:nil];
- randomCell.imageView.image=nil;
- cell=randomCell;
- self.randomCell=nil;
- }
- int suitTag=1;
- int digitCounter=CURRENTROWFORIMAGES;
- for (int tagNumber=5;tagNumber<=8;tagNumber++)
- {
- if(digitCounter<=userDigit-1)
- {
- Evaluation *currentEvaluate=[randomDigitArray objectAtIndex:digitCounter];
- NSInteger currentCard=currentEvaluate.correctNumber;
- UIImage *currentImage=[[UIImage alloc]initWithContentsOfFile:[cards objectAtIndex:currentCard]];
- UIView *cellView = [randomCell viewWithTag:tagNumber];
- if([cellView isMemberOfClass:[UIImageView class]])
- [(UIImageView *)cellView setImage:currentImage];
- [currentImage release];
- digitCounter++;
- if (suitOn)
- {
- NSInteger currentSuit=currentEvaluate.correctNumberSuit;
- UIImage *currentImageSuit=[[UIImage alloc]initWithContentsOfFile:[suits objectAtIndex:currentSuit]];
- UIView *cellView = [randomCell viewWithTag:tagNumber];
- if([cellView isMemberOfClass:[UIImageView class]])
- [(UIImageView *)cellView setImage:currentImageSuit];
- [currentImageSuit release];
- suitTag++;
- }
- }
- }
- return cell;
- }
Add Comment
Please, Sign In to add comment