1

我收到一个 JSON 响应

apiResponse =
{ Appointment = 4;
Goals = 0;
Holiday = 0;
LessonPlan = 0;
ServiceLevel = 0;
SiteSetup = 0;
Student = 2;
TherapyLog = 0;
Worksite = 0;
};

我曾经获得价值 NSMutableDictionary* resultTables=[result objectForKey:@"apiResponse"];

int countVals=[[result objectForKey:tablename] intValue] ;

当我检查时

if (countVals>=0) 
{
   NSLog(@"Tables Names:%@",tablename);
  [updatedTables addObject:tablename];

}else
{
   NSLog(@"Tables Names:%@",tablename);
   NSLog(@"no data to update");

}

表名未添加到 updateTables ARRAY。我的错是什么...

4

1 回答 1

1
int countVals=[[resultTables objectForKey:tablename] intValue] ;

您应该使用resultTables来获取表名。

于 2013-08-17T08:18:56.390 回答