Iphone 将NSString转换为NSArray

Iphone 将NSString转换为NSArray,iphone,objective-c,xcode,nsstring,nsarray,Iphone,Objective C,Xcode,Nsstring,Nsarray,我从JSON web服务接收数据并将其转换为NSArray。我已将NSArray保存在数据库中,以便以后检索。数据库中的数据如下所示: ( { ResponseCount = 2; ResponseTotal = 8; }, { ResponseCount = 6; ResponseTotal = 8; } ) 现在我要把这些数据转换回NSArray。我试着做一些类似的事情 NSAr

我从JSON web服务接收数据并将其转换为NSArray。我已将NSArray保存在数据库中,以便以后检索。数据库中的数据如下所示:

(
        {
        ResponseCount = 2;
        ResponseTotal = 8;
    },
        {
        ResponseCount = 6;
        ResponseTotal = 8;
    }
)
现在我要把这些数据转换回NSArray。我试着做一些类似的事情

NSArray *responseArray = self.CoreDataTable.ResponseArray; //NSString value

但是当这个运行时,NSArray返回时没有对象。你知道怎么了吗


用于阐明数据保存过程的代码

CoreDataTable *coreDataTable = [NSEntityDescription insertNewObjectForEntityForName:@"CoreDataTable" inManagedObjectContext:self.managedObjectContext];
coreDataTable.CategoryName = [d objectForKey: @"CategoryName"];
coreDataTable.ResponseArray = [d objectForKey: @"ResponseArray"];
[self.managedObjectContext save:nil];

你是否在使用jsonkit?你说“我已经在我的数据库中保存了NSArray”。向我们展示保存它的代码。好问题。我的web服务中的JSON是使用iOS本机NSJSONSerialization来使用的。更新了问题以显示为Rob保存的内容,为什么不存储原始JSON,然后在读取时使用NSJSONSerialization将其转换为NSArray?
CoreDataTable *coreDataTable = [NSEntityDescription insertNewObjectForEntityForName:@"CoreDataTable" inManagedObjectContext:self.managedObjectContext];
coreDataTable.CategoryName = [d objectForKey: @"CategoryName"];
coreDataTable.ResponseArray = [d objectForKey: @"ResponseArray"];
[self.managedObjectContext save:nil];