Hallo,
Ich habe einen Fehler, den ich nicht verstehe.
Fehlermeldung:
Alles anzeigen
meine Vermutung: setTaskDescription funktioniert nicht. Aber warum?
Meine OATask.h:
Alles anzeigen
Wie ich da reinkommentiert habe, sind das zwei Strings drinne: davon geht einer, der andere aber nicht.
Die Zeile in der das abstürtzt ist in der
OAAddTaskViewController.m
Alles anzeigen
Wieder sieht man, zwischen task.title und task.description ist kaum unterschied.
Wenn ich jetzt eine neue @property erstelle, geht es auch nicht, egal welchen Namen ich nehme, also kann es auch nicht sein, dass es daran liegt, dass es schon ein setTaskDescription gibt.
Wahrscheinlich übersehe ich einfach wieder was
Ich habe einen Fehler, den ich nicht verstehe.
Fehlermeldung:
Quellcode
- 2015-02-02 13:26:56.934 Overdue Assignment 2[1843:513592] -[OATask setTaskDescription:]: unrecognized selector sent to instance 0x7fb6b84277f0
- 2015-02-02 13:26:56.935 Overdue Assignment 2[1843:513592] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[OATask setTaskDescription:]: unrecognized selector sent to instance 0x7fb6b84277f0'
- *** First throw call stack:
- (
- 0 CoreFoundation 0x000000011025af35 __exceptionPreprocess + 165
- 1 libobjc.A.dylib 0x000000010fef3bb7 objc_exception_throw + 45
- 2 CoreFoundation 0x000000011026204d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
- 3 CoreFoundation 0x00000001101ba27c ___forwarding___ + 988
- 4 CoreFoundation 0x00000001101b9e18 _CF_forwarding_prep_0 + 120
- 5 Overdue Assignment 2 0x000000010f9c085a -[OAAddTaskViewController returnTask] + 330
- 6 Overdue Assignment 2 0x000000010f9c06b9 -[OAAddTaskViewController buttonAddPressed:] + 89
- 7 UIKit 0x00000001106488be -[UIApplication sendAction:to:from:forEvent:] + 75
- 8 UIKit 0x000000011074f410 -[UIControl _sendActionsForEvents:withEvent:] + 467
- 9 UIKit 0x000000011074e7df -[UIControl touchesEnded:withEvent:] + 522
- 10 UIKit 0x000000011068e308 -[UIWindow _sendTouchesForEvent:] + 735
- 11 UIKit 0x000000011068ec33 -[UIWindow sendEvent:] + 683
- 12 UIKit 0x000000011065b9b1 -[UIApplication sendEvent:] + 246
- 13 UIKit 0x0000000110668a7d _UIApplicationHandleEventFromQueueEvent + 17370
- 14 UIKit 0x0000000110644103 _UIApplicationHandleEventQueue + 1961
- 15 CoreFoundation 0x0000000110190551 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
- 16 CoreFoundation 0x000000011018641d __CFRunLoopDoSources0 + 269
- 17 CoreFoundation 0x0000000110185a54 __CFRunLoopRun + 868
- 18 CoreFoundation 0x0000000110185486 CFRunLoopRunSpecific + 470
- 19 GraphicsServices 0x00000001138299f0 GSEventRunModal + 161
- 20 UIKit 0x0000000110647420 UIApplicationMain + 1282
- 21 Overdue Assignment 2 0x000000010f9c0533 main + 115
- 22 libdyld.dylib 0x00000001127ea145 start + 1
- 23 ??? 0x0000000000000001 0x0 + 1
- )
- libc++abi.dylib: terminating with uncaught exception of type NSException
- (lldb)
meine Vermutung: setTaskDescription funktioniert nicht. Aber warum?
Meine OATask.h:
Quellcode
Wie ich da reinkommentiert habe, sind das zwei Strings drinne: davon geht einer, der andere aber nicht.
Die Zeile in der das abstürtzt ist in der
OAAddTaskViewController.m
Quellcode
- }
- - (IBAction)buttonAddPressed:(UIButton *)sender {
- [self.delegate didAddTask:[self returnTask]];
- }
- #pragma mark - Helper Method
- -(OATask *)returnTask
- {
- OATask *task = [[OATask alloc] init];
- task.title = self.textView.text;
- task.date = self.datePicker.date;
- task.isCompleted = NO;
- task.taskDescription= self.textView.text;
- return task;
- }
Wieder sieht man, zwischen task.title und task.description ist kaum unterschied.
Wenn ich jetzt eine neue @property erstelle, geht es auch nicht, egal welchen Namen ich nehme, also kann es auch nicht sein, dass es daran liegt, dass es schon ein setTaskDescription gibt.
Wahrscheinlich übersehe ich einfach wieder was