-->

SHKFacebook shareItem:item execution exception

2019-09-13 19:34发布

问题:

When I put the following codes into "didSelectRowAtIndexPath" of TabelViewController, it comes out an exception. How can I resolve this?

SHKItem *item = [SHKItem text:@"I need your fashion advice. I am using my iPhone app iFrockUp to help me decide on stuff for my event. Could you pretty please rate it and give me your stars out of 5? Your vote will help rank it in the app."];
item.tags = [NSArray arrayWithObjects:@"iFrockUp", @"share", @"clothes", nil];
[SHKFacebook shareItem:item];

exception 'NSInvalidArgumentException', reason: 'Application tried to present a nil modal view controller on target .' * First throw call stack: (0x3be1e2a3 0x35d0d97f 0x3503c139 0x2a1d25 0x2a1b8b 0x2bd149 0x23634d 0x2aa207 0x233b95 0x2aa207 0xc4153 0xc572d 0x3501226d 0x35094ea1 0x36c19a6f 0x3bdf35df 0x3bdf3291 0x3bdf1f01 0x3bd64ebd 0x3bd64d49 0x3a1322eb 0x34fa42f9 0xc266b 0xc2610) libc++abi.dylib: terminate called throwing an exception

回答1:

Actually I just add those lines of code in didSelectRowAtIndexPath of RootViewController.m whose project is directly from sharekit2.0 and nothing else changed.

It's OK on simulator, but do got an exception on my iPhone4S

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 

{ SHKItem *item = [SHKItem text:@"I need your fashion advice. I am using my iPhone app iFrockUp to help me decide on stuff for my event. Could you pretty please rate it and give me your stars out of 5? Your vote will help rank it in the app."]; item.tags = [NSArray arrayWithObjects:@"iFrockUp", @"share", @"clothes", nil]; [SHKFacebook shareItem:item];

}



标签: sharekit