开发者

cannot understand the following code in objective c?

开发者 https://www.devze.com 2023-03-09 05:51 出处:网络
开发者_开发技巧the following is declared inside the @interface of another class... I don\'t understand the syntax and what it is trying to say

开发者_开发技巧the following is declared inside the @interface of another class... I don't understand the syntax and what it is trying to say

@interface someclass:NSObject
....
@end

@interface NSObject (HSRequestClassDelegate)

-(void) finishedWithData:(HSRequest *) request data:(NSMutableData *) data;
-(void) failedWithError:(HSRequest *) request error:(NSError *) error;
-(void) noConnection:(HSRequest *) request;

@end

The name of the above file is someclass.h? what does the line @interface NSObject (HSRequestClassDelegate) mean?

thank you in advance.


This is a definition of an informal protocol. Prior to protocols being introduced, protocols were defined as a category on NSObject.


That's called a "category" in cocoa.

0

精彩评论

暂无评论...
验证码 换一张
取 消