开发者

Xcode: Keep order of plist

I have a question depending plists in Xcode. I'm loading images from a plist into a NSDictiona开发者_StackOverflow中文版ry (the paths of the images) and then display the images from that dictionary but they are not shown in the same order like in the plist.

How can I manage that the images are shown in the same order?


You can add "order" parameter in plist so when you take this you will take according to "order" parameter... But actually if you are not use threading or nsoperation it must be work can you share the code snippet?


By definition NSDictionary is not ordered... you should consider using an NSArray of NSDictionaries that contains path to image, and some ordering number, then sort that array after reading it from file with NSSortDescriptor

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜