Note that there are some explanatory texts on larger screens.

plurals
  1. POIphone : unrecognized selector sent to instance & viewDidLoad isn't running
    primarykey
    data
    text
    <p>I'm developing an application. I used a TabBar and every tab have its Class (FirstViewController, SecondViewController, ... ) There is one AppDelegate too.</p> <p>When I launch the program, the first Class is running. When i select the second tab, the <code>Secondview</code>.xib 's running but the "<code>viewDidLoad</code>" isn't working. When I select the third Tab, that's the same.</p> <p>I've put some buttons on the third tab, and when I push it, I have a </p> <pre><code> &gt; -[UIViewController testAuthentication:]: unrecognized selector sent to instance 0x5f16920 2011-04-08 13:46:42.511 e-mars[19501:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController testAuthentication:]: unrecognized selector sent to instance 0x5f16920' </code></pre> <p>Here's the code of my classes</p> <p><strong>SecondViewController.h</strong></p> <pre><code>#import &lt;UIKit/UIKit.h&gt; @interface SecondViewController : UIViewController { } @end </code></pre> <p><strong>SecondViewController.m</strong></p> <pre><code>#import "SecondViewController.h" @implementation SecondViewController - (void)viewDidLoad { [super viewDidLoad]; NSLog(@"viewDidLoad de SecondViewController"); NSURL *url = [NSURL URLWithString: @"http://iosdevelopertips.com/images/logo-iphone-dev-tips.png"]; UIImage *image = [UIImage imageWithData: [NSData dataWithContentsOfURL:url]]; [self.view addSubview:[[UIImageView alloc] initWithImage:image]]; } - (void)dealloc { [super dealloc]; } @end </code></pre> <p><strong>ThirdViewController.h</strong></p> <pre><code>#import &lt;UIKit/UIKit.h&gt; @interface ThirdViewController : UIViewController { IBOutlet UITextField *login; IBOutlet UITextField *motdepasse; NSMutableData *responseData; } @property (retain, nonatomic) UITextField *login; @property (retain, nonatomic) UITextField *motdepasse; @property (retain, nonatomic) NSMutableData *responseData; - (IBAction) testAuthentication: (id)sender; - (IBAction) saveAuthentication: (id)sender; @end </code></pre> <p><strong>ThirdViewController.m</strong></p> <pre><code>#import "ThirdViewController.h" @implementation ThirdViewController @synthesize login; @synthesize motdepasse; @synthesize responseData; - (id)initWithFrame:(CGRect)frame { //if ((self = [super initWithFrame:frame])) { // Initialization code //} return self; } -(IBAction) testAuthentication: (id)sender { //NSLog(@"testAuthentication"); } - (IBAction) saveAuthentication: (id)sender { NSLog(@"saveAuthentication"); } - (void)dealloc { [login dealloc]; [motdepasse dealloc]; [responseData dealloc]; [super dealloc]; } @end </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload