SHKFacebook shareItem:item execution exception

一笑奈何 提交于 2019-12-25 01:54:06

问题


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];

}



来源:https://stackoverflow.com/questions/13716185/shkfacebook-shareitemitem-execution-exception

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!