相关疑难解决方法(0)

Restkit .20请求超时间隔

尝试在Restkit上设置请求超时间隔.

这篇文章提到了HTTClient,但HTTPClient似乎没有办法设置超时间隔.在restkit 0.20.0中请求超时

有谁知道如何设置间隔?

timeout objective-c ios restkit

6
推荐指数
2
解决办法
2542
查看次数

如何设置RESTKIT对象管理器的超时间隔

我正在使用RESTKIT对象管理器从我的服务器获取信息.我的实现代码的片段如下:

-(void)getObjects
{
    //Instantiate the RestKit Object Manager
    RKObjectManager *sharedManager = [RKObjectManager sharedManager];

    //show the spinner
    [self showLoading];

    //call server with the resourcepath
    [sharedManager loadObjectsAtResourcePath:self.resourcePath delegate:self];
}

- (void)objectLoader:(RKObjectLoader*)objectLoader didLoadObjects:(NSArray*)objects 
{

    // handling in scenarios of empty arrays
    if ( [objects count]==0 ){
        [self hideLoading];
        if (emptyHandler){
            emptyHandler();
        }else{
            [self standardEmptyHandling];            
        }
        return;
    }

    // planned failure
    if ( [[objects objectAtIndex:0] isKindOfClass:[Failure class]]){
        NSAssert([objects count]==1,@"object returned is type failure, but there are more than one object in it");
        failureObject=[objects objectAtIndex:0]; …
Run Code Online (Sandbox Code Playgroud)

objective-c settimeout ios restkit

4
推荐指数
1
解决办法
6572
查看次数

标签 统计

ios ×2

objective-c ×2

restkit ×2

settimeout ×1

timeout ×1