An error occurred during the development in the afternoon, and the result was miserable. The error was found at eleven o'clock A.M. and the cause of the error was not found until two o'clock P.M.. It was really depressing.
The main reason for such a long error is:
1. I am not familiar with IOS development.
2. I don't know how to get the detailed error information. I don't even know how to call the All Output panel to view the error information. It's really bad.
3. If there is an error message, go to stackoverflow to find the answer. There are too few Chinese documents and sharing for IOS developers, so stackoverflow is required for errors.
The following describes the error details:
15:49:43. 476 MyPad [15944: f803] *** Terminating app due to uncaught exception 'nsunknownkeyexception', reason: '[<BenefitItemsTableCell 0x6d9bdd0> setValue: forUndefinedKey:]: this class is not key value coding-compliant for the key.'
*** First throw call stack:
(0x1490022 000000000xd90022 00000000000000000000000000000x60471a 0x1491dea 000000000x475230 00000x65ea1 0x47cc54 0x47d3ce 0x468cbd 0x4776f1 0000000000000x248579 00000000000000000x1464195 0x13c8ff2 0x13c78da 0x13c6d84 0x13c6c9b 0x3e0c65 0x3e2626 0x1a0ad 0x2535)
Terminate called throwing an exception (lldb)
The error code is as follows:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath * NSString *CellIdentifier = MyTableCell *cell =(MyTableCell*
Regarding this strange error, stackoverflow found the following explanation:
There are a couple of options to resolve this-I'll let you decide which is the most appropriate.
The reason it's failing is because the owner is being passed as nil. you're binding the actionText outlet to the file's owner in IB, but then when loading the nib, the owner is nil. I 'd guess that when loading with a nil owner behind the scenes an NSObject is used, which is why you're re getting the key/value error.
My previous advice to pass the cell as the owner wocould also fail as I didn't know how the Nib is constructed; the cell is nil as you 've yet to create it (and dequeue is passing nil back, so even pass cell as the owner is still essential passing nil ).
Two options:
Instantiate a new cell in your-cellForRowAtIndexPath :( NSIndexPath *) indexPath implementation, and pass that new cell as the owner (but I 'd guess that this isn't the best solution for you)
Or, and I 'd suggest this is the better solution, change the binding of actionText in your nib file to the Alert Cell and not the file's owner (You have File's Owner and an Alert Cell-bind the UILabel to the actionText outlet the Alert Cell, and not the File's owner, which is what's being done at present)-I suspect this is what you want. with that in mind file's owner can become an NSObject again.
------- Original answer kept below as the file's owner class is also a common cause for this error -------
It suggests that you 'veve' instantiated 'an AlertCell in InterfaceBuilder, and you're binding something to actiontext, but the class isn' t set to AlertCell, it's still NSObject?
Take a look at the class text box on the identify tab of the tool palette for that object in Interface Builder. the class shoshould be AlertCell, but I 'd guess it's still set to NSObject.
As an aside, and feel free to ignore this advice, but there are a couple of extra things I 'd encourage you to do, purely from an Objective C expectations/conventions point of view:
Name your files after your class (upper case the first character of the filename ).
Prefix your class names; two uppercase characters, typically your initials (I 'd name it DWAlertCell, for example ).