title: iOS error: No visible @interface for 'xxxx' declares the selector 'alloc'
body: <p>Here is my TextValidator class:</p>
  
  <pre><code>//TextValidator.h
  #import &lt;Foundation/Foundation.h&gt;
  
  @interface TextValidator : NSObject
  - (BOOL) isValidPassword:(NSString *)checkPassword;
  - (BOOL) isValidEmail:(NSString *)checkString;
  - (BOOL) isEmpty:(NSString *)checkString;
  @end 
  
  
  //  TextValidator.m
  #import "TextValidator.h"
  
  @implementation TextValidator
  
  - (BOOL) isEmpty:(NSString *)checkString
  {
      return YES;
  }
  
  - (BOOL) isValidPassword:(NSString *)checkPassword
  {
  return YES;
  }
  
  - (BOOL) isValidEmail:(NSString *)checkString
  {
  return YES;
  }
  
  @end
  </code></pre>
  
  <p>This is the way I try to initialise the TextValidator class in ViewController.m:</p>
  
  <pre><code>//ViewController.h
  #import &lt;Foundation/Foundation.h&gt;
  
  @interface SignUpViewController : UIViewController &lt;UITextFieldDelegate&gt;
  @end
  
  //ViewController.m
  #import "SignUpViewController.h"
  #import "TextValidator.h"
  
  @interface SignUpViewController ()
  
  @property TextValidator *myValidator;
  
  @end
  
  @implementation SignUpViewController
  
  - (void)viewDidLoad
  {
      [[self.myValidator alloc] init]; //iOS error: No visible @interface for 'TextValidator' declares the selector 'alloc'*
      [super viewDidLoad];
  }
  @end
  </code></pre>
  
  <p>When I try to compile the code I get the following error:</p>
  
  <pre><code>No visible @interface for 'TextValidator' declares the selector 'alloc'.
  </code></pre>
  
  <p>TextValidator class inherits from NSObject and as far as I know init and alloc functions are already defined at the base class. So why does the program gives such an error?</p>
  
  <p>Note that, I already checked <a href="https://stackoverflow.com/questions/11949297/ios-error-no-visible-interface-for-project-declares-the-selector-alloc">this</a> topic and it doesn't work for me.</p>