Question

I'm trying to use SocketRocket for an iOS project, I'm developing... I've been going by the instructions on Socket Rocket - Installing iOS and using the provided chat example as a guide, but when I use:

_webSocket = [[SRWebSocket alloc] initWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"ws://localhost:9000/chat"]]];

It throws two Mach-O Linker error:

1: "_OBJC_CLASS_$_SRWebSocket", referenced from: Objc-class-ref in HTViewController.o Symbol(s) not found for architecture i386

2: Linker command failed with exit code 1 (use -v to see invocation)

As far as I can tell, I've included the correct frameworks/dylibs (as mentioned on the GitHub) and I've added -ObjC to the "other linker flags" option... Any ideas what I might be missing?

Was it helpful?

Solution

You must build the SRWebSocket library with i386 architecture.

You can avoid these kind of erros by using package manager like Cocoapods for XCode. They also have SRWebSocket library in SocketRocket package.

EDIT:

If that version is not what you want, you can fork the Cocoapods Specs repository and upgrade the Pod to latest SocketRocket version.

Then you can also add your forked repo to your local Cocoapods installation using pod repo command.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top