Я довольно новичок в Objective-C, и у меня есть проблемы, которые я не могу исправить!
Когда я запускаю свое приложение, у меня есть 4 кнопки! Каждая из этих кнопок должна перенаправить в другой файл XIB (и каждый из этих файлов XIB будет иметь кнопку для возврата)
Однако, когда я пытаюсь нажать одну из кнопок, мое приложение "вылетает"!
Это то, что консоль показывает мне:
[Session started at 2011-03-07 14:15:38 +0100.]
2011-03-07 14:15:42.169 Google Calendar[1332:207] -[UIApplication gettingStarted:]: unrecognized selector sent to instance 0x4c17fa0
2011-03-07 14:15:42.173 Google Calendar[1332:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[UIApplication gettingStarted:]: unrecognized selector sent to instance 0x4c17fa0'
*** Call stack at first throw:
(
0 CoreFoundation 0x0124bbe9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x013a05c2 objc_exception_throw + 47
2 CoreFoundation 0x0124d6fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x011bd366 ___forwarding___ + 966
4 CoreFoundation 0x011bcf22 _CF_forwarding_prep_0 + 50
5 UIKit 0x00502a6e -[UIApplication sendAction:to:from:forEvent:] + 119
6 UIKit 0x005911b5 -[UIControl sendAction:to:forEvent:] + 67
7 UIKit 0x00593647 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
8 UIKit 0x005921f4 -[UIControl touchesEnded:withEvent:] + 458
9 UIKit 0x005270d1 -[UIWindow _sendTouchesForEvent:] + 567
10 UIKit 0x0050837a -[UIApplication sendEvent:] + 447
11 UIKit 0x0050d732 _UIApplicationHandleEvent + 7576
12 GraphicsServices 0x01968a36 PurpleEventCallback + 1550
13 CoreFoundation 0x0122d064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
14 CoreFoundation 0x0118d6f7 __CFRunLoopDoSource1 + 215
15 CoreFoundation 0x0118a983 __CFRunLoopRun + 979
16 CoreFoundation 0x0118a240 CFRunLoopRunSpecific + 208
17 CoreFoundation 0x0118a161 CFRunLoopRunInMode + 97
18 GraphicsServices 0x01967268 GSEventRunModal + 217
19 GraphicsServices 0x0196732d GSEventRun + 115
20 UIKit 0x0051142e UIApplicationMain + 1160
21 Google Calendar 0x00002304 main + 102
22 Google Calendar 0x00002295 start + 53
)
terminate called after throwing an instance of 'NSException'
И вот что я пытаюсь сделать:
ч-файл
#import <UIKit/UIKit.h>
@interface FirstViewController : UIViewController {
}
-(IBAction)gettingStarted:(id)sender;
-(IBAction)appointments:(id)sender;
@end
м-файл
#import "FirstViewController.h"
#import "AppointmentViewController.h"
#import "GettingStartedViewController.h"
@implementation FirstViewController
-(IBAction)gettingStarted:(id)sender {
GettingStartedViewController *gettingStartedVC = [[GettingStartedViewController alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:gettingStartedVC animated:YES];
}
-(IBAction)appointments:(id)sender {
AppointmentViewController *appointmentVC = [[AppointmentViewController alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:appointmentVC animated:YES];
}
-(void)dealloc {
[super dealloc];
}
@end
P.S .: Оба viewController (GettingStartedViewController & AppointmentViewController) созданы!
Если вам, ребята, нужно больше кода (просто оставьте комментарий)
Thx
Кевин