我從JSON查詢返回10,000條記錄,並將其分成102頁,每頁大約有100個對象。前100個項目加載正常,但它停止加載更多。我如何才能進入下一頁?這通常如何完成?這個代碼以前只適用於sqlite。現在我已經完成了使用核心數據將其轉換爲新應用程序的工作,但它陷入了第一頁。我做錯了什麼?JSON頁面只訪問第一頁xcode
這裏是JSON的NSLog(最後幾行)
"PageNo":1,"TotalPages":102,"RecordCount":10163}
-(void) serverDidFinishSending: (NSData *)responseData manager:(WebServiceCommunicator*)aManger requestURL:(NSURL *) url
{
//Added the code below just to test out apple's JSON serializer
NSError *error;
NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:responseData options:kNilOptions error:&error];
NSLog(@"dictionary %@",dictionary);
// Create the base object from factory.
//currently JSON serializer happens here
ReturnObjectFactory *aFactory = [[[ReturnObjectFactory alloc] init] autorelease];
id object = [aFactory createObjectWithClassName:_className fromData:responseData];
// Pass on the object to the target class and let that class deal with this object
if(_target && [_target respondsToSelector:@selector(didRecieveObject:sender:)])
[_target didRecieveObject:object sender:self];
謝謝!
可以請你發表一些代碼你已經試過了嗎? –
當然,添加了一些代碼 –
你有沒有機會嘗試我的代碼? –