- Registriert
- 21.09.10
- Beiträge
- 342
Hallo zusammen,
Ich teste mich gerade an iPhone-Programmierung heran. Ich werde mal schildern, was ich getan habe:
1. Projekt erstellt, View-Based Application
2. Einen Button in die Mitte des MyProjectViewController.xib geschoben
3. Eine neue Klasse per "File->New->New File->Objective-C Class" erstellt, erbend von NSObject, namens MyController
4. Ein Object in die MyProjectViewController.xib gezogen und den Typ in MyController geändert
5. Mit dem Code-Assistenten vom Knopf mit Rechtsklick in den Code gezogen, eine Action ("- (IBAction)push: (id)sender;") erstellt.
6. Build & Run
Das Programm läuft an, aber sobald ich auf den Knopf klicke, kommt folgendes:
Wo liegt hier das Problem? Das ist doch eigentlich die grundsätzlich richtige Funktionsweise, oder nicht?
Gruß Jackston
Ich teste mich gerade an iPhone-Programmierung heran. Ich werde mal schildern, was ich getan habe:
1. Projekt erstellt, View-Based Application
2. Einen Button in die Mitte des MyProjectViewController.xib geschoben
3. Eine neue Klasse per "File->New->New File->Objective-C Class" erstellt, erbend von NSObject, namens MyController
4. Ein Object in die MyProjectViewController.xib gezogen und den Typ in MyController geändert
5. Mit dem Code-Assistenten vom Knopf mit Rechtsklick in den Code gezogen, eine Action ("- (IBAction)push: (id)sender;") erstellt.
6. Build & Run
Das Programm läuft an, aber sobald ich auf den Knopf klicke, kommt folgendes:
Code:
2011-05-05 10:26:31.668 MyProject[3721:207] -[__NSCFDictionary push:]: unrecognized selector sent to instance 0x68249d0
2011-05-05 10:26:31.672 MyProject[3721:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary push:]: unrecognized selector sent to instance 0x68249d0'
*** Call stack at first throw:
(
0 CoreFoundation 0x00dc05a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f14313 objc_exception_throw + 44
2 CoreFoundation 0x00dc20bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x00d31966 ___forwarding___ + 966
4 CoreFoundation 0x00d31522 _CF_forwarding_prep_0 + 50
5 UIKit 0x000124fd -[UIApplication sendAction:to:from:forEvent:] + 119
6 UIKit 0x000a2799 -[UIControl sendAction:to:forEvent:] + 67
7 UIKit 0x000a4c2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
8 UIKit 0x000a3a1c -[UIControl touchesBegan:withEvent:] + 277
9 UIKit 0x00036d41 -[UIWindow _sendTouchesForEvent:] + 395
10 UIKit 0x00017c37 -[UIApplication sendEvent:] + 447
11 UIKit 0x0001cf2e _UIApplicationHandleEvent + 7576
12 GraphicsServices 0x00ff9992 PurpleEventCallback + 1550
13 CoreFoundation 0x00da1944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
14 CoreFoundation 0x00d01cf7 __CFRunLoopDoSource1 + 215
15 CoreFoundation 0x00cfef83 __CFRunLoopRun + 979
16 CoreFoundation 0x00cfe840 CFRunLoopRunSpecific + 208
17 CoreFoundation 0x00cfe761 CFRunLoopRunInMode + 97
18 GraphicsServices 0x00ff81c4 GSEventRunModal + 217
19 GraphicsServices 0x00ff8289 GSEventRun + 115
20 UIKit 0x00020c93 UIApplicationMain + 1160
21 MyProject 0x00002129 main + 121
22 MyProject 0x000020a5 start + 53
)
terminate called after throwing an instance of 'NSException'
Wo liegt hier das Problem? Das ist doch eigentlich die grundsätzlich richtige Funktionsweise, oder nicht?
Gruß Jackston