Hi Rush. I wrote the Thrift Cocoa library code and generators so (hopefully) I can help you out.

The code in lib/cocoa/src is well suited for a framework but I never got around to making one. Patches welcome, as they say. ;)

If you're going to be running a server in Cocoa one thing to keep in mind is, well, that code's never really been used yet...

For a client, that stuff is in pretty good shape except for the complete lack of comments. If you wanted to create a client using the binary protocol on the HTTP transport you would start with something like this:

// create a new thrfit HTTP client transport for each URL
THTTPClient * myTransport = [[THTTPClient alloc] initWithURL: [NSURL URLWithString: @"http://myserver.example.com";]];

// create thrift binary protocol on top of transport
TBinaryProtocol * myProtocol = [[TBinaryProtocol alloc] initWithTransport: myTransport];

// and lastly but not leastly, create actual thrift service client on top of protocol MyThriftServiceClient * client = [[MyThriftServiceClient alloc] initWithProtocol: myProtocol];

[client doSomething];


Hope this helps.

- a

On Jun 19, 2008, at 3:37 PM, Rush Manbert wrote:

We have generated a Cocoa services interface and the objects it uses. Now I'm trying to use them. How am I supposed to use the code in lib/cocoa/src? It seems intended to be used to make a framework or library, but there is neither Makefile nor Xcode project to accomplish this.

Can anyone offer some guidance?

Thanks,
Rush

Reply via email to