現在要創建NSMutableArray ,像下面的例子一樣。不知道怎麼實現?
(
{
businessName = "IBM Business Continuity & Recovery Service";
city = "Costa Mesa";
phone = "(714) 668-6900";
state = CA;
street = "600 Anton Blvd";
zip = 92626;
},
{
businessName = "IBM Sanno";
city = Lomita;
phone = "(310) 626-0613";
state = CA;
street = "25835 Appian Way";
zip = 90717;
},
{
businessName = "Ewert's IBM Typewriter Service";
city = "";
phone = "(559) 732-3215";
state = "";
street = "";
zip = "";
},
)
請指教。
動態添加dictionary。
NSMutableArray *dictionaries = [[NSMutableArray alloc] init];
NSDictionary *exampleDict = [[NSDictionary alloc] initWithObjectsAndKeys:
@"IBM Business Continuity & Recovery Service", @"businessName",
@"Costa Mesa", @"city",
@"(714) 668-6900", @"phone",
@"CA", @"state",
@"600 Anton Blvd", @"street",
@"92626", @"zip", nil];
[dictionaries addObject:exampleDict];