2012-02-16 7 views
3

私のアプリケーションの1つは、テスト中にすべてのことがうまくいけば、画像とセルの高さはコードで正確にテストされていましたが、アップロードされたときiphone、ipadで数回ダウンロードしようとしましたが、セルが伸びていて、テストが完全に異なっていて、画像が全くわからないとき、アプリケーションに2つのサイズの画像が含まれていました(もう1つは網膜サイズ@ 2xです)。問題は、または何、そのアプリ内購入は、多くのアルバムが含まれている、よく、あなたの迅速な応答を感謝 をXCodeの4.2、 してくださいアドバイス、UITableViewセルの画像

を使用していないのです、これらのアルバムはとuitableのビューのセルにそれらのそれぞれに位置しています画像がダウンロードされたとき、画像が変更とのUITableView自動的にリフレッシュ、最初のすべての画像の(のviewDidLoad)の配列に設定されているであろう

'

UIImage *awwal = [UIImage imageNamed:@"album-01.png"]; 
    UIImage *teni = [UIImage imageNamed:@"album-02.png"]; 
    UIImage *telet = [UIImage imageNamed:@"album-03.png"]; 
    UIImage *rabee = [UIImage imageNamed:@"album-04.png"]; 
    UIImage *akhir = [UIImage imageNamed:@"album-05.png"]; 
    UIImage *ba3do = [UIImage imageNamed:@"album-zaman.png"]; 
    UIImage *aatiha = [UIImage imageNamed:@"album-tarab.png"]; 
    UIImage *j3ala = [UIImage imageNamed:@"album-monawaa.png"]; 

    NSMutableArray *images = [[NSMutableArray alloc] initWithObjects: awwal, teni, telet, rabee, akhir, ba3do, aatiha, j3ala, nil]; 
self.AlbumsImages = images; 
    [images release];' 

とのtableViewが

-(UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    static NSString *CellIdentifier = @"CellIdentifier"; 
    // NSLog(@"%@",AlbumsImages); 
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 

    if (cell == nil) { 

     cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; 
    } 
    NSUInteger row = [indexPath row]; 
    NSArray *myPathList = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); 
    NSString *myPath = [myPathList objectAtIndex:0]; 
    NSString* storagePath = [myPath stringByAppendingPathComponent:@"purchasedAlbums.plist"]; 
    NSArray* valueList = [[NSArray alloc] initWithContentsOfFile:storagePath]; 

    UIImage *change1 = [UIImage imageNamed:@"playalbum-06.png"]; 
    UIImage *change2 = [UIImage imageNamed:@"playalbum-07.png"]; 
    UIImage *change3 = [UIImage imageNamed:@"playalbum-08.png"]; 
    UIImage *change4 = [UIImage imageNamed:@"playalbum-09.png"]; 
    UIImage *change5 = [UIImage imageNamed:@"playalbum-11.png"]; 
    UIImage *change6 = [UIImage imageNamed:@"playalbum-12.png"]; 
    UIImage *change7 = [UIImage imageNamed:@"playalbum-10.png"]; 
    UIImage *change8 = [UIImage imageNamed:@"playalbum-13.png"]; 

    int i; 
    for (i = 0; i <= [AlbumsImages count]; i++) { 


    if ([[valueList objectAtIndex:i+1] intValue]) { 
     if (i == 0) { 
      [AlbumsImages replaceObjectAtIndex:0 withObject:change1]; 
     } 
     if (i == 1) { 
      [AlbumsImages replaceObjectAtIndex:1 withObject:change2]; 
     } 
     if (i == 2) { 
      [AlbumsImages replaceObjectAtIndex:2 withObject:change3]; 
     } 
     if (i == 3) { 
      [AlbumsImages replaceObjectAtIndex:3 withObject:change4]; 
     } 
     if (i == 4) { 
      [AlbumsImages replaceObjectAtIndex:4 withObject:change5]; 
     } 
     if (i == 5) { 
      [AlbumsImages replaceObjectAtIndex:5 withObject:change6]; 
     } 
     if (i == 6) { 
      [AlbumsImages replaceObjectAtIndex:6 withObject:change7]; 
     } 
     if (i == 7) { 
      [AlbumsImages replaceObjectAtIndex:7 withObject:change8]; 
     } 

    } 
} 
     //cell.textLabel.text = [AlbumsView objectAtIndex:row]; 
    cell.imageView.image = [AlbumsImages objectAtIndex:row]; 
    cell.tag=row+1; 
    return cell; 
} 

ロードさ厥change1,2,3 .....は、アルバムがダウンロードされたときに置き換えられたイメージです。

+0

あなたのコードを教えてください。ここで画像を設定します。 – Shubhank

+0

アップロードして何度もダウンロードしようとしたらどういう意味ですか?何が問題を引き起こす可能性があるかを確認するために、いくつかのコードも提供してください。 – Mark

+0

拝啓、非常にありがたいです、 コードで質問が修正されました。できるだけ親切にチェックとアドバイスを受けました。 –

答えて

-1

使用名前だけではない拡張子

UIImage * change1 = [UIImage imageNamed:@ "playalbum-06"];

関連する問題