Search code examples
iosuiactionsheetsharekit

Assertion failure in -[SHKActionSheet _presentSheetFromView:above:]


i am trying to implement an app which uses sharekit framework,i am getting 2 exceptions when i use the code provided by the sharekit,basically my program just shares an image on facebook

i have a button on which performs the following action

  -(IBAction)share:(id)sender
 {
UIImage *img=[UIImage imageNamed:@"eg.png"];
SHKItem *item=[SHKItem image:img title:@"Look"];
SHKActionSheet *actionsheet=[SHKActionSheet actionSheetForItem:item];

[actionsheet showFromToolbar:navigationController.toolbar];
}

when i used the breakpoints,i figured out that the last line has a problem

exceptions: 1)Assertion failure in -[SHKActionSheet _presentSheetFromView:above:]

2)Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: view != nil'

i dont have a navigationController so i just declared it in the header file,is it the reason for the following errors? have i done it the correct way? i couldnt find any good tuts on sharekit online


Solution

  • try self.view on the last line..it should work