title: How to deal same method of two catgeory in base class in Objective-C?
body: <p>I add two category of RegisterViewController. They has same func named djTest. like below:</p>
  
  <p>NewRegisterViewController+TestA.h</p>
  
  <pre><code>@interface NewRegisterViewController (TestA)
  -(void)djTest;
  @end
  </code></pre>
  
  <p>NewRegisterViewController+TestA.m </p>
  
  <pre><code>@implementation NewRegisterViewController (TestA)
  -(void)djTest{
      NSLog(@"djTest call TestA");
  }
  @end
  </code></pre>
  
  <p>NewRegisterViewController+TestB.h</p>
  
  <pre><code>@interface NewRegisterViewController (TestB)
  -(void)djTest;
  @end
  </code></pre>
  
  <p>NewRegisterViewController+TestB.m </p>
  
  <pre><code>@implementation NewRegisterViewController (TestB)
  -(void)djTest{
      NSLog(@"djTest call TestB");
  }
  @end
  </code></pre>
  
  <p>and In  NewRegisterViewController.m</p>
  
  <pre><code>- (void)viewDidLoad {
      [super viewDidLoad];
       if ([self respondsToSelector:@selector(djTest)]) {
          [self performSelector:@selector(djTest)];
      }
  }
  </code></pre>
  
  <p>It output "djTest call TestA" in console every time when I run.</p>
  
  <p>My question is :</p>
  
  <ol>
  <li><p>when I didn't import NewRegisterViewController+TestA.h in NewRegisterViewController.m, also the djTest function can be find and perform. so when does this function added in the NewRegisterViewController instance. When class loaded? or the first time using the cagegory or some other time?</p></li>
  <li><p>I import both NewRegisterViewController+TestA.h and NewRegisterViewController+TestB.h, the compiler did give me any warning of multiple djTest function. So how can I avoid the multiple funtion in different category? Always I don't know whether other imply this function.</p></li>
  </ol>