在 signalR 中调用集线器方法 - Objective C

Invoke a hub method in signalR - Objective C

我是 ios 开发的新手。我正在尝试实施 Signal R。我尝试过并且能够连接到集线器。但我不知道如何调用集线器方法 CheckWebServiceStatus

我遇到了错误

No visible @interface for 'SRHubProxy' declares the selector 'invoke:'

这是我的代码

#import "ViewController.h"
#import "SignalR.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.


    SRHubConnection *hubConnection = [SRHubConnection connectionWithURLString:@"https://MY HUB URL HERE/"];

    // Create a proxy to the chat service
    SRHubProxy *chat = [hubConnection createHubProxy:@"chatHub"];
    [chat on:@"addMessage" perform:self selector:@selector(addMessage:)];

    // [chat on:@"addMessage" perform:self selector:@selector(addMessage:)];

    // Register for connection lifecycle events
    [hubConnection setStarted:^{
        NSLog(@"Connection Started");
      //  [connection send:@"CheckWebServiceStatus"];
        [chat invoke:@"CheckWebServiceStatus"];

    }];
    [hubConnection setReceived:^(NSString *message) {
        NSLog(@"Connection Recieved Data: %@",message);
    }];
    [hubConnection setConnectionSlow:^{
        NSLog(@"Connection Slow");
    }];
    [hubConnection setReconnecting:^{
        NSLog(@"Connection Reconnecting");
    }];
    [hubConnection setReconnected:^{
        NSLog(@"Connection Reconnected");
    }];
    [hubConnection setClosed:^{
        NSLog(@"Connection Closed");
    }];
    [hubConnection setError:^(NSError *error) {
        NSLog(@"Connection Error %@",error);
    }];
    // Start the connection
    [hubConnection start];

}


- (void)addMessage:(NSString *)message {
    // Print the message when it comes in
    NSLog(@"%@", message);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end

谁能告诉我如何使用 objective c 调用集线器方法。

这里有一个调用方法的例子

- (void) sendOperatorMessage :(NSString*) visitorId Message:(NSString*) message OperatorId:(NSString*) operatorid Token:(NSString*) ProfileToken SpinnerId:(NSString*) spinnerId CurrentDateTime:(NSString*) currentDateTime{

    [chat invoke:@"sendMessageOperator" withArgs:[NSArray arrayWithObjects:visitorId, message, operatorid, @"false", @"false", @"false", ProfileToken, currentDateTime, spinnerId, nil]];
}