2012-12-18 23 views
0

返回部分密鑰我有以下的方法,其讀取plist文件[見截圖附]並將其作爲一個可變的數組:arrayWithContentsOfFile用的plist上的5.1的iPad

+(NSMutableArray *)getSharersPlistArray:(NSString*)plist 
{ 
    NSString *AppDetailPlist = [[NSBundle mainBundle] pathForResource:plist ofType:@"plist"]; 
    NSMutableArray* toReturn = [NSMutableArray arrayWithArray:[NSArray arrayWithContentsOfFile:AppDetailPlist]]; 
    NSLog(@"toReturn:%@", toReturn); 
    return toReturn; 
} 

上這樣做的不完全的結果一臺iPad 1/5.1的iOS:

(
     { 
     2 =   { 
      image = "Icon-72.png"; 
      name = Email; 
      type = ShareCell; 
     }; 
    }, 
     { 
     0 =   { 
      image = "Icon-72.png"; 
      name = Share; 
      type = ShareCell; 
     }; 
    } 
) 

在上的5.1或6.0模擬器正確/完整的結果:

(
     { 
     0 =   { 
      image = "Icon-72.png"; 
      name = Facebook; 
      type = ShareCell; 
     }; 
     1 =   { 
      image = "Icon-72.png"; 
      name = Twitter; 
      type = ShareCell; 
     }; 
     2 =   { 
      image = "Icon-72.png"; 
      name = Email; 
      type = ShareCell; 
     }; 
    }, 
     { 
     0 =   { 
      image = "Icon-72.png"; 
      name = Share; 
      type = ShareCell; 
     }; 
     1 =   { 
      image = "Icon-72.png"; 
      name = Follow; 
      type = ShareCell; 
     }; 
    } 
) 

我確認了plist,它看起來沒問題:

找不到。 -name'* plist'-exec plutil {} \;

./Share.plist:好的

任何想法爲什麼?我將不勝感激任何見解)

enter image description here

回答

0

試試這個:

  1. 清潔您的Xcode項目;

  2. 從iPad 1/iOS 5.1設備中刪除應用程序。

重新構建/運行。

希望這能解決它。

+0

是的..這是我第一次嘗試,所以我做了很多次。但是這個問題似乎是一致的。謝謝塞爾吉奧。 – Zsolt

+0

重新啓動設備,它現在似乎工作。真奇怪。 – Zsolt