Here is my code where I use to share an image vaia facebook:
NSArray *array = [NSKeyedUnarchiver unarchiveObjectWithData:archive];
UIActivityViewController *activityVC =
[[UIActivityViewController alloc] initWithActivityItems:array
applicationActivities:nil];
activityVC.excludedActivityTypes = @[UIActivityTypeAssignToContact,
UIActivityTypePrint,
UIActivityTypePostToTwitter,
UIActivityTypePostToWeibo,
UIActivityTypeMail,
UIActivityTypeCopyToPasteboard,
UIActivityTypeSaveToCameraRoll];
[self presentViewController:activityVC animated:YES completion:nil];
this is working fine in simulator, but when I am testing it on real ipad 3, it force closes saying the error
exc_bad_access code=1 address=0*0
in this line
activityVC.excludedActivityTypes = @[UIActivityTypeAssignToContact,
UIActivityTypePrint,
UIActivityTypePostToTwitter,
UIActivityTypePostToWeibo,
UIActivityTypeMail,
UIActivityTypeCopyToPasteboard,
UIActivityTypeSaveToCameraRoll];
can any one find me out what I have missed here?
edited part:
I have checked everything and array
is not nil. if I comment out the line activityVc.exclude....
then it force closes and says
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nil modal view controller