English 中文(简体)
名单是空的,无法用清单填写表
原标题:Plist is empty,unable to fill table view using plist
  • 时间:2011-10-24 21:12:16
  •  标签:
  • plist

I am trying to load my table view using plist file. But when i run my app,my table view is empty. I created a plist file,it contains an array.But I am not able to fill the table view with an array. I would appreciate if someone helps me.

最佳回答

我要谈一下解决办法,我们需要把它改成字典,以便从名单上读到:

 NSString *appetizerPath = [[NSBundle mainBundle] pathForResource:@"appetizer" ofType:@"plist"];
 NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:appetizerPath];
问题回答

处理:

NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"PlistName" ofType:@"plist"];
        NSMutableDictionary * propertyDict = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath];




相关问题
Xcode cannnot find my plist file when building

I m trying to build my app and every time I do I get this error: error: The file "Wallpapers-Info.plist" does not exist. Anyone know what causes this error? I have the wallpaper-info.plist file ...

Copying JSON response dictionary to plist

I have a dictionary containing a JSON response and a plist file. I want to update the values in my plist file with the JSON response values. How would I do this?

Use a Plist dictionary for App settings

I want to be able to use a plist for settings Im implementing in my app. I want a dictionary "Settings" to hold my arrays, such as "Debug", "Option 1", Option 2", etc. How would I access "Debug"array ...

How to add an extra plist property using CMake?

I m trying to add the item <key>UIStatusBarHidden</key><true/> to my plist that s auto-generated by CMake. For certain keys, it appears there are pre-defined ways to add an item; ...

Plist Hierarchy and All Option

I have a string of data in a plist, which I ve got to display, hierarchically like this: Menu>Chapter>SubChapter>item>item details This might be super simple, in my initial menu, how would I have ...

热门标签