The Shape of Everything
A website mostly about Mac stuff, written by August "Gus" Mueller
» Acorn
» Retrobatch
» Mastodon
» Instagram
» Github
» Maybe Pizza?
» Archives
» Feed
» Micro feed
December 5, 2002
(This post is from my old, old, super old site. My views have changed over the years, hopefully my writing has improved, and there is now more than a handful of folks reading my site. Enjoy.)

Wow. This is my 700th post. Neat.

Anyway, I think I came up with a decent solution to being able to do xml-rpc a bit more smoothly in Cocoa - I created a class called "XMLRPCServer" which has a couple of methods like:

-(id)call:(NSString *)method withArg:(id)arg; -(id)call:(NSString *)method withArg1:(id)arg1 withArg2:(id)arg2;

... and so on.

So now I can make calls with a bit more ease like this:

XMLRPCServer *server = [XMLRPCServer serverWithURL:@"" handler:@"examples"]; NSString *state; = [server call:@"getStateName" withArg:[NSNumber numberWithInt:5]];

Which isn't too shabby.

I also added a method that'll call the xmlrpc server asynchronously... you just set a callback method and bang- it all works.

Cool, and close enough dangit.

I gotta make sure I don't have any memory leaks in it, and then I'll post up an example app showing this guy.