In my app, I use a custom NIB to load my UITableViewCells. The NIB's File's Owner is set so the class is my View Controller. I then Link the UITableViewCell to the IBOutlet I put in the header file. It was all working fine, until all of the sudden it stopped working, and gets this error:
uncaught exception 'NSInvalidUnarchiveOperationException', reason: '*** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (UITableViewCellContentView)'
I have traced this exception to line 4 (below) of my code in the cellForRowAtIndexPath
method
1- static NSString *CellIdentifier = @"Cell";
2- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
3- if (cell == nil) {
4- [[NSBundle mainBundle] loadNibNamed:@"SubjectCell" owner:self options:NULL];
5- cell = customSubjectCell;
6- }
What I find weird is that when I restore my whole project from Time Machine from a couple days ago, (when it was working) and I get the same error! I have tried this on two devices and the simulator, but all get the same error. Another issue is the fact that I have no clue what the exception means. If you need more code to help me with my dilemma, or have any questions, just ask. Also, I downloaded the new (today's) SDK, and I think that may have caused this, even though It was working with the New Xcode + SDK before I made changes to my app today.
PLEASE NOTE:
This question is outdated, and the fix below was a temporary fix. Apple has fixed its SDK, so if you have the newest version of the SDK this does not apply to you.