开发者

Copy NSArray and replace text items with bool values

I utilize a (nested) plist to populate UITableViews where users can select entries at the deepest levels and set a checkmark (or not). I开发者_如何学编程 want to save these selections in a same structured list where at the deepest level the NSArray contains bool values instead the text strings that are displayed in the UITableView.

So how can i build from a hierarchy like the following:

Root
 - Item 0 (Dictionary)
   - Group (Dictionary)
     - Items (NSArray)
       - Item 0: @"Please check me" (String)

a hierarchy like this?

Root
 - Item 0 (Dictionary)
   - Group (Dictionary)
     - Items (NSArray)
       - Item 0: 0 (NSNumber) // NSNumber for bool values

I'm trying to create a deep mutable copy and replace the items at the deepest levels but have somehow the feeling that this can be done easier.

Thanks for any help with this in advance.

Frank


I've never done iPhone programming, so I don't know if it has the same toll-free bridging between certain Core Foundation and Cocoa classes as the Mac OS has. If so, then you could use CFPropertyListCreateDeepCopy.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜