I have an app where one feature is the user can view current newsletter, article etc that are stored on website, and viewed using uiwebview. I have the following code setup with sharekit so the user can email people with whichever document is displayed as an attachment.
The problem is that I have this on 3 different views, corresponding to 3 different documents. I can email any one of them just fine, and it works perfectly, but if I go to a 2nd one and click the action button and then email, nothing pops up. Is the mail composer not dealloc properly? I have the SHKActionSheet dealloc in each of the void dealloc of each view, but it still won't let me send a 2nd email after successfully sending the first. Any thoughts?
Code:
- (IBAction) share
{ NSString *urlString = @"http://www.maulroad.com/OnetoGrowon.doc";
NSURL *url = [NSURL URLWithString:urlString];
NSData *file = [NSData dataWithContentsOfURL:url];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *pdfPath = [documentsDirectory stringByAppendingPathComponent:@"OnetoGrowon.doc"];
[file writeToFile:pdfPath atomically:YES];
SHKItem *item = [SHKItem file:file filename:@"OnetoGrowon.doc" mimeType:@"application/doc" title:@"One to Grow On By Johnny Hobbie"];
SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];
[actionSheet showInView:self.view];
}