Darko888
Darko888

Reputation: 11

tableView:accessoryTypeForRowWithIndexPath : the app crash

I know that is an old question and I've read other posts.. but I've find no solution to my problem!

I've an app that (only with the iPad version) when I try to share an article by email, the app crash. This is the logs text:

2013-02-13 02:10:31.281 FlipBlogForWordpress[2281:907] WARNING: Using legacy cell layout due to delegate implementation of tableView:accessoryTypeForRowWithIndexPath: in . Please remove your implementation of this method and set the cell properties accessoryType and/or editingAccessoryType to move to the new cell layout behavior. This method will no longer be called in a future release. 2013-02-13 02:10:32.400 FlipBlogForWordpress[2281:907] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nil modal view controller on target .' * First throw call stack: (0x319742a3 0x3980d97f 0x33868159 0x3398a3ef 0xeed09 0x3383e28d 0x338c0f81 0x32282277 0x319495df 0x31949291 0x31947f01 0x318baebd 0x318bad49 0x3546d2eb 0x337d0301 0x9c759 0x9c6e0) libc++abi.dylib: terminate called throwing an exception (lldb)

and this is the code I find in sharePopViewController.m :

    - (UITableViewCellAccessoryType)tableView:(UITableView *)tv accessoryTypeForRowWithIndexPath:(NSIndexPath *)indexPath {

return UITableViewCellAccessoryDisclosureIndicator;

}

now... what have to do?? I've tried everything...

Thank you very much people!! :)

( sorry for my bad english! :P )

Upvotes: 1

Views: 485

Answers (1)

rmaddy
rmaddy

Reputation: 318854

You have two problems.

1) The use of tableView:accessoryTypeForRowWithIndexPath: was deprecated in iOS 3.0 - four years ago. Get rid of that method. Instead you need to set the cell's accessoryType property in the cellForRowAtIndexPath: method.

2) The real problem is the crash caused by trying to display a modal view controller. This crash has nothing to do with the first problem.

Run your app in the debugger and see where it crashes. The problem appears to be from calling something like:

[self presentViewController:someController animated:YES completion:nil];

and someController is nil.

Upvotes: 2

Related Questions