【发布时间】:2012-03-06 06:20:28
【问题描述】:
我的 Sqlite 表中有 2 列 1.DetailsID & 2.Detailstype
我已经存储了值 id: int 和 detailstype :varchar。
在sqlite select查询中用字符串设置id为
while(sqlite3_step(selectPrefer) == SQLITE_ROW)
{
NSString *detailsString = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectPrefer, 1)];
int detailsId = (int)sqlite3_column_int(selectPrefer, 0);
[detailsData setObject:detailsString forKey:[NSNumber numberWithInt:detailsId ]];
}
我有一个这样的 NSmutable 字典:
(
0 = "˚F";
12 = Activity;
11 = BM;
7 = "Heart Rate";
6 = "Nose Problem";
2 = Rx;
1 = BP;
10 = Food;
9 = "Stress Level";
8 = Glucose;
5 = "Pain Level";
4 = Weight;
3 = Events;
}
i can get arrays using allKeys & allValues but these are not in order
现在我想要单独的数组,例如
{
0
1
2
3
4
5
6
7
8
9
10
11
12
)
值和键都按键的升序排列
(
"˚F";
Activity;
BM;
"Heart Rate";
"Nose Problem";
Rx;
BP;
Food;
"Stress Level";
Glucose;
"Pain Level";
Weight;
Events;
)
在 sqlite 查询中没有任何修改 - 怎么做提前谢谢
【问题讨论】:
标签: iphone objective-c nsmutablearray nsarray nsdictionary