Iphone 在5.1版iPad上,带有plist返回部分密钥的arrayWithContentsOfFile的数组

Iphone 在5.1版iPad上,带有plist返回部分密钥的arrayWithContentsOfFile的数组,iphone,objective-c,ios,nsarray,plist,Iphone,Objective C,Ios,Nsarray,Plist,我使用以下方法读取plist文件[参见随附的屏幕截图],并将其作为可变数组返回: +(NSMutableArray *)getSharersPlistArray:(NSString*)plist { NSString *AppDetailPlist = [[NSBundle mainBundle] pathForResource:plist ofType:@"plist"]; NSMutableArray* toReturn = [NSMutableArray arrayWith

我使用以下方法读取plist文件[参见随附的屏幕截图],并将其作为可变数组返回:

+(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/iOS 5.1上的不完整结果:

(
        {
        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,它看起来还可以:

找到-名称'*plist'-exec plutil{}\

/Share.plist:好的

你知道为什么吗?如果您有任何见解,我将不胜感激。)

试试这个:

  • 清理你的Xcode项目

  • 从iPad 1/iOS 5.1设备中删除应用程序

  • 重新构建/运行


    希望这能解决问题。

    是的。。这是我尝试的第一件事,所以我做了很多次。但这个问题似乎是一致的。谢谢Sergio。重新启动设备,现在似乎可以工作了。真奇怪。