我收到以下错误,我该怎么办?
2012-02-02 16:12:15.873 iPadAlertPrototype [16574:fb03] * 终止 应用程序由于未捕获的异常'NSInternalInconsistencyException', 原因:'试图将装载数减少到零以下'
头等舱
+(void)loadTaskGroups
{
[[RKObjectManager sharedManager].requestQueue
setConcurrentRequestsLimit:1];
[[RKObjectManager sharedManager].requestQueue setDelegate:self];
[[RKObjectManager sharedManager].requestQueue
setShowsNetworkActivityIndicatorWhenBusy:YES];
RKObjectLoader* loader = [[RKObjectManager sharedManager]
objectLoaderWithResourcePath:TASKGROUPURL delegate:self];
loader.backgroundPolicy = RKRequestBackgroundPolicyRequeue;
[loader sendSynchronously];
[loader setTimeoutInterval:60];
[loader setBackgroundPolicy:RKRequestBackgroundPolicyRequeue];
[[RKObjectManager sharedManager].requestQueue addRequest:loader];
[[RKObjectManager sharedManager].requestQueue start];
}
-(void)objectLoaderDidFinishLoading:(RKObjectLoader *)objectLoader
{
[TaskGroup loadTasks];
}
TaskGroup类
+ (void)loadTasks
{
for (TaskGroup *taskGroup in [TaskGroup allObjects])
{
if ([[taskGroup class]isSubclassOfClass:[TaskGroup class]])
{
RKObjectLoader* loader = [[RKObjectManager sharedManager] objectLoaderWithResourcePath:TASKURL delegate:taskGroup];
[loader sendSynchronously];
[loader setTimeoutInterval:60];
[loader setBackgroundPolicy:RKRequestBackgroundPolicyRequeue];
[[RKObjectManager sharedManager].requestQueue addRequest:loader];
}
}
}
答案 0 :(得分:0)
RestKit中存在一个错误,影响同步请求和超时的组合。已在拉取请求553中修复:https://github.com/RestKit/RestKit/pull/553