2017-05-24 3 views

Répondre

0

Vous pouvez le faire par l'aide des catégories .. Créez un fichier d'en-tête de séparation (en-tête privée) avec une solution de poste comme *_Internal.h. Et définissez toutes les méthodes privées/délégués là-bas.

Exemple

hello.h

@interface Hello : NSObject 
- (void)publicMethod; 
@end 

Hello_Internal.h

@interface Hello (Internal) 
- (void)privateMethod; 
@end 

Hello.m
@implementation Hello 
- (void)privateMethod { 

} 
- (void)publicMethod { 

} 
@end 

Utilisation de la bibliothèque

#import "Hello.h" 
#import "Hello_Internal.h"