Crash from NSMutableDictionary

I have a crashlog from a customer and can't find out what's the problem.

The exception backtrace shows follows:

1   libobjc.A.dylib               	       0x1cf6a6734 objc_exception_throw + 60
2   CoreFoundation                	       0x1b6b4c5d0 -[__NSCFString characterAtIndex:].cold.1 + 0
3   CoreFoundation                	       0x1b6b57858 -[__NSDictionaryM setObject:forKey:].cold.2 + 0
4   CoreFoundation                	       0x1b69f70dc -[__NSDictionaryM setObject:forKey:] + 896
5   MyApp	       0x102995c94 -[ListUITableViewController setImageCell:forbox:forAccount:] + 1612948 (ListUITableViewController.m:305)

In line 305 of setImageCell method I add a NSMutableArray to a NSMutableDictionary:

[self.name2NameCells setValue:nameCells forKey:name.lowercaseString];

Before that the required nil-checks are done.

Any ideas?

Please show more, at least the code of setImageCell:forbox:forAccount: and possibly ListUITableViewController. What is the cause of crash (error description) ?

This is the exception description:

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Application Specific Information:
abort() called

This is the method:

- (void)setImageCell:(nameCell *)nameCell forbox:(box *)box forAccount:(Account *)account {
  NSMutableArray *mailCells = [self.name2NameCells valueForKey:name];

  if (nameCells != nil) {
   [nameCells addObject:nameCell];
  } else {
   nameCells = [NSMutableArray array];
   [nameCells addObject:nameCell];
   [self.name2NameCells setValue:nameCells forKey:name.lowercaseString];
 }

The account is needed for logging, but the method is shortened to post it here.

i answered, thanks!

Here is the complete log:

Here is the complete log:

Sadly it’s not the complete log; it’s missing the stuff before the Exception Type section, which is kinda important. For advice on how to post a crash report, see Posting a Crash Report.

A complete crash report should let me quickly answer the question of why -[__NSCFString characterAtIndex:] is throwing this exception.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Crash from NSMutableDictionary
 
 
Q