SHKFacebook shareItem:项目执行异常

时间:2012-12-05 04:15:37

标签: sharekit

当我将以下代码放入TabelViewController的“didSelectRowAtIndexPath”时,它会出现异常。我该如何解决这个问题?

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

异常'NSInvalidArgumentException',原因:'应用程序试图在目标上显示一个nil模态视图控制器。 * 第一次抛出调用堆栈: (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调用抛出异常

1 个答案:

答案 0 :(得分:0)

实际上我只是在RootViewController.m的didSelectRowAtIndexPath中添加了这些代码行,其项目直接来自sharekit2.0而没有其他任何改变。

在模拟器上没问题,但我的iPhone4S上有例外

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

{             SHKItem * item = [SHKItem text:@“我需要你的时尚建议。我正在使用我的iPhone应用程序iFrockUp来帮助我决定我的活动的东西。你能不能评价它并给我你的星星满分5分?你的投票将有助于在应用程序中排名。“];             item.tags = [NSArray arrayWithObjects:@“iFrockUp”,@“share”,@“clothes”,nil];             [SHKFacebook shareItem:item];

}