我從NSDictionary
從SQLite獲取數據,並將其轉換爲NSMutableArray
。現在我需要在UITableViewCell
標籤中添加該數組對象的值。如何從嵌套數組的NSmutablearray中獲取對象值。
arraydata (
{
UUID = 995443;
"group_id" = 41917;
name = "Maninderveer Kaur";
"roll_no" = 1;
"session_token" = bHKkctTPPyULIEy6rh4UKKTO9;
status = present;
"user_guid" = 995789;
},
{
UUID = 995445;
"group_id" = 41917;
name = "Manjot Kaur";
"roll_no" = 2;
"session_token" = bHKkctTPPyULIEy6rh4UKKTO9;
status = present;
"user_guid" = 995789;
},
{
UUID = 995447;
"group_id" = 41917;
name = "Prabhjot Sharma";
"roll_no" = 3;
"session_token" = bHKkctTPPyULIEy6rh4UKKTO9;
status = present;
"user_guid" = 995789;
},
{
UUID = 995449;
"group_id" = 41917;
name = "Prabhjot Singh";
"roll_no" = 4;
"session_token" = bHKkctTPPyULIEy6rh4UKKTO9;
status = present;
"user_guid" = 995789;
},
{
UUID = 995451;
"group_id" = 41917;
name = "Prince Parbhakar";
"roll_no" = 5;
"session_token" = bHKkctTPPyULIEy6rh4UKKTO9;
status = present;
"user_guid" = 995789;
},
{
UUID = 995453;
"group_id" = 41917;
name = "Puneet Kaur";
"roll_no" = 6;
"session_token" = bHKkctTPPyULIEy6rh4UKKTO9;
status = present;
"user_guid" = 995789;
},
{
UUID = 995455;
"group_id" = 41917;
name = "Rajveer Kaur";
"roll_no" = 7;
"session_token" = bHKkctTPPyULIEy6rh4UKKTO9;
status = present;
"user_guid" = 995789;
},
{
UUID = 995457;
"group_id" = 41917;
name = "Sahajpreet Kaur";
"roll_no" = 8;
"session_token" = bHKkctTPPyULIEy6rh4UKKTO9;
status = present;
"user_guid" = 995789;
},
{
UUID = 1824273;
"group_id" = 41933;
name = Ankit;
"roll_no" = 1104;
"session_token" = 9Ea6FqaIKgr9gZ5Gh6UWhVQTj;
status = present;
"user_guid" = 995789;
},
{
UUID = 1824271;
"group_id" = 41933;
name = Anuj;
"roll_no" = 1103;
"session_token" = 9Ea6FqaIKgr9gZ5Gh6UWhVQTj;
status = present;
"user_guid" = 995789;
},
{
UUID = 995695;
"group_id" = 41933;
name = "Anureet Kaur";
"roll_no" = 14;
"session_token" = 9Ea6FqaIKgr9gZ5Gh6UWhVQTj;
status = present;
"user_guid" = 995789;
},
)
我已經在此行上添加了有關單元外部標籤的數據。
cell.stdntName.text = [array valueForKey:@"name"];
當我電池標籤上添加一個值,我收到此錯誤:
終止應用程序由於未捕獲的異常「NSInvalidArgumentException」,原因是:「 - [__ NSArrayI長]:無法識別的選擇發送到實例0x7ffcab275550'。
我覺得上面的細節都可以。請給我一些建議,讓我出錯。
爲什麼你認爲一個數組將有一個名爲'name'屬性?你明白數組是什麼嗎? – Avi
對不起,先生,但我也試圖讓價值根據指數值 –