开发者

storing nsdictionay in nsarray using separator

开发者 https://www.devze.com 2023-02-20 18:03 出处:网络
I want to display an image and some text under that image,, i was thinking of using NSDictionary : NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:

I want to display an image and some text under that image,, i was thinking of using NSDictionary :

NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
                      @"Tree:shajrah", @"1", 
                      @"Milk:haleeb", @"2", 
                      nil];
NSString *sep = @":";

I want to know a开发者_如何学Gofter this step how can I store it in NSArray using separator?

Thank you, Dalal


This isn't very good design. Instead, you should create a new class that contains the UIImage and the text as properties (and anything else you need), and replace your NSDictionary with NSArray of your class.

0

精彩评论

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