Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.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
无法从iOS中的信号服务器接收数据_Ios_Objective C_Signalr - Fatal编程技术网

无法从iOS中的信号服务器接收数据

无法从iOS中的信号服务器接收数据,ios,objective-c,signalr,Ios,Objective C,Signalr,嗨,我是信号集成的新手。信号器连接已成功启动,但有时我能够接收数据,而有时我无法从服务器接收数据(未调用connection.received方法)。请检查下面我使用的代码,并给出您的建议 SRHubConnection *connection = [SRHubConnection connectionWithURL:@"http://strandd-dev.azure-mobile.net/signalr"]; //connection.delegate = self; [connectio

嗨,我是信号集成的新手。信号器连接已成功启动,但有时我能够接收数据,而有时我无法从服务器接收数据(未调用connection.received方法)。请检查下面我使用的代码,并给出您的建议

SRHubConnection *connection = [SRHubConnection connectionWithURL:@"http://strandd-dev.azure-mobile.net/signalr"];
//connection.delegate = self;

[connection addValue:token forHTTPHeaderField:@"X-ZUMO-AUTH"];
[connection addValue:@"Basic TElWRTpKRHVrZnFGZmZNcXV3bVlnYm9Wd05ibWRoVEZuemY4" forHTTPHeaderField:@"Authorization"];

//TElWRTpKRHVrZnFGZmZNcXV3bVlnYm9Wd05ibWRoVEZuemY4
//REVWOnZPdGZOVHBnYlNxZ3RtZFZ2VENLVGVYTkxvek9CeDE2

myHub = [connection createHubProxy:@"IncidentHub"];

NSLog(@"Goutham");

connection.error = ^(NSError *error)
{
    NSLog(@"error ====%@",error);
};

connection.started = ^{

    NSLog(@"Connection Started");

    [myHub invoke:@"GetMobileCustomerClientIncidentStatusRequest" withArgs:[NSArray arrayWithObjects:incidentGUID, nil]];
    [self.delegate signalrConnectionDidStarted];

};

connection.received = ^(NSString * data)
{
    NSLog(@"data ====%@",data);

    [self.delegate didReceivedDataFromSignalR:data];
};

@try
{
    [connection start];
}
@catch (NSException *exception)
{
    NSLog(@"exception ----%@",exception);
}
@finally {
    NSLog(@"------------");
}

它在浪费我的时间,请帮助我。

看到这个链接可能会帮助你@GouthamI我也面临同样的问题,你能帮我一下吗。