2

I try to make avtivity view controller. Everything is fine on simulators and iPhone, but on iPad I see this:

enter image description here

Here is my code:

NSArray *activityItems = @[@"Text to share"];

UIActivityViewController *activityController =
[[UIActivityViewController alloc] initWithActivityItems:activityItems
                                  applicationActivities:nil];

NSMutableArray *activityTypes = [NSMutableArray new];

//TODO: handle this array for iOS7 only
[activityTypes addObjectsFromArray:@[UIActivityTypeAddToReadingList,
                                     UIActivityTypePostToFlickr,
                                     UIActivityTypePostToVimeo,
                                     UIActivityTypePostToTencentWeibo,
                                     UIActivityTypeAirDrop]];
activityController.excludedActivityTypes = activityTypes;

//TODO: handle this for both iOS7 and iOS6
[activityTypes addObjectsFromArray:@[UIActivityTypePostToWeibo,
                                     UIActivityTypePrint,
                                     UIActivityTypePrint,
                                     UIActivityTypeAssignToContact,
                                     UIActivityTypeSaveToCameraRoll]];
activityController.excludedActivityTypes = activityTypes;

[self presentViewController:activityController
                                    animated:YES
                                  completion:nil];

It's not iPad version, it's iPhone version which I launch on iPad. But still it should works properly. What am I doing wrong?

UPD: also I have this in logs:

Mar 31 18:25:58 Marias-iPad SharingExample[713] : CGContextSetFillColorWithColor: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

Mar 31 18:25:58 Marias-iPad SharingExample[713] : CGContextSetStrokeColorWithColor: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

Mar 31 18:25:58 Marias-iPad SharingExample[713] : CGContextGetBlendMode: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

Mar 31 18:25:58 Marias-iPad SharingExample[713] : CGContextSetBlendMode: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

Mar 31 18:25:58 Marias-iPad SharingExample[713] : CGContextFillRects: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

Mar 31 18:25:58 Marias-iPad SharingExample[713] : CGContextSetBlendMode: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.

Maria
  • 755
  • 1
  • 11
  • 29
  • 1
    I have the same issue. I think this controller is just extremely buggy on iPad running iPhone apps. See also http://stackoverflow.com/questions/21922369/twitter-icon-not-showing-in-uiactivityviewcontroller-in-ios-7-on-the-device – Maiaux May 10 '14 at 11:50

1 Answers1

-1

Did you read the UIActivityViewController documentation? Because there is states that on a iPad you must present the UIActivityViewController in a UIPopoverController:

On iPad, you must present the view controller in a popover. On iPhone and iPod touch, you must present it modally.

rckoenes
  • 69,092
  • 8
  • 134
  • 166
  • Of course I read it. The problem is: it is not iPad app, it is the same iPhone app And it should looks exactly like on iPhone. – Maria Mar 31 '14 at 14:49