当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - How to hide the class' properties and methods when defining and using one protocol in the .h file for Objective-C?

问题描述:

For example: my .h file is like below:

// .h file

@protocol pageUpdateDelegate

-(void)pageUpdateMethod2;

@end

@interface ClassA

@property (nonatomic) NSInteger page;

-(void)pageUpdateMethod1;

@end

I want to provide this pageUpdateDelegate protocol to other people.

However, I don't want my ClassA's property and method been revealed and used by others.

But I will definitely use the ClassA a lot.

Then how can I do to protect my property and methods in the .h file?

I just want others to use the protocol part. Thanks.

分享给朋友:
您可能感兴趣的文章:
随机阅读: