How to decleare custom protocol in iPhone

Posted by iPhoneDev on Stack Overflow See other posts from Stack Overflow or by iPhoneDev
Published on 2010-05-10T12:30:47Z Indexed on 2010/05/10 12:34 UTC
Read the original article Hit count: 312

Filed under:

Hi,

I want to use a protocol, how can we implement it in iPhone.

 @protocol BasicAPI
 -(NSString*)hello;
 @end

// In Some method
NSURL* url = [NSURL URLWithString@"http://www.caucho.com/hessian/test/basic"];
 id<BasicAPI> proxy = (id<BasicApi>)[CWHessianConnection proxyWithURL:url protocol:@protocol(basicAPI)];
 NSLog(@"hello: %@", [proxy hello]);

Please help me how I can implement above code?

© Stack Overflow or respective owner

Related posts about iphone