Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c RestKit中的请求存在问题_Objective C_Ios_Rest_Ios4_Restkit - Fatal编程技术网

Objective c RestKit中的请求存在问题

Objective c RestKit中的请求存在问题,objective-c,ios,rest,ios4,restkit,Objective C,Ios,Rest,Ios4,Restkit,我是restkit和iphone开发的新手,我有一个关于在restkit中发送请求的问题 我有一个服务器端应用程序在我的服务器上运行,具有真实的IP(比如a.B.C.D)和应用程序侦听端口8001。 现在我想通过resktik从我的ios应用程序向a.B.C.D:8001发送请求,我的移动应用程序代码如下所示: 在我的appdelegate中,我有: [RKClient客户端WithBaseUrlString:@“A.B.C.D”] 在我的viewcontroller中,我有: const bo

我是restkit和iphone开发的新手,我有一个关于在restkit中发送请求的问题

我有一个服务器端应用程序在我的服务器上运行,具有真实的IP(比如a.B.C.D)和应用程序侦听端口8001。 现在我想通过resktik从我的ios应用程序向a.B.C.D:8001发送请求,我的移动应用程序代码如下所示:

在我的appdelegate中,我有:

[RKClient客户端WithBaseUrlString:@“A.B.C.D”]

在我的viewcontroller中,我有:

const bool isNetAvailable=[[RKClient sharedClient]isNetworkReachable]

if (!isNetAvailable)

{
    NSLog(@"Network is not available");
    return;
}
else
{
    NSLog(@"Network is available");
}

[[RKClient sharedClient] get:@"/contacts" delegate:self];
因此,当我仅使用A.B.C.D初始化RKClient时,看起来一切都可以访问,但发送请求失败,因为我无法将请求发送到8001端口,get:@“/contacts”看起来正确,但请求不会发送到8001,在RKClient初始化失败期间,将8001添加到IP地址

您能帮助我理解我应该如何向RestKit中的IP:Port发送请求吗?
可能吗?

伙计们,我发现了问题所在

我需要使用:

[RKClient客户端WithBaseUrlString:@”http://A.B.C.D:port"];

而不是:

[RKClient客户端WithBaseUrlString:@“A.B.C.D”]

http://始终是必需的:)