I've a problem! Sorry I'm new to programming and I dont know what to do. I implemented some code, to customize my ActivitiViewController. I created a new class, which I linked to my code:
- (IBAction)share:(id)sender
{
Class avcClass = NSClassFromString(@"UIActivityViewController");
if (avcClass) {
APActivityProvider *ActivityProvider = [[APActivityProvider alloc] init];
UIImage *ImageAtt = [UIImage imageNamed:@"MyApp Icon 512x512.png"];
NSArray *Items = @[ActivityProvider, ImageAtt];
APActivityIcon *ca = [[APActivityIcon alloc] init];
NSArray *Acts = @[ca];
UIActivityViewController *ActivityView = [[UIActivityViewController alloc]
initWithActivityItems:Items
applicationActivities:Acts];
[ActivityView setExcludedActivityTypes:
@[UIActivityTypeAssignToContact,
UIActivityTypeCopyToPasteboard,
UIActivityTypePrint,
UIActivityTypeSaveToCameraRoll,
UIActivityTypePostToWeibo]];
[self presentViewController:ActivityView animated:YES completion:nil];
[ActivityView setCompletionHandler:^(NSString *act, BOOL done)
{
NSString *ServiceMsg = nil;
if ( [act isEqualToString:UIActivityTypeMail] ) ServiceMsg = @"Mail sended!";
if ( [act isEqualToString:UIActivityTypePostToTwitter] ) ServiceMsg = @"Post on twitter, ok!";
if ( [act isEqualToString:UIActivityTypePostToFacebook] ) ServiceMsg = @"Post on facebook, ok!";
if ( [act isEqualToString:UIActivityTypeMessage] ) ServiceMsg = @"SMS sended!";
if ( done )
{
UIAlertView *Alert = [[UIAlertView alloc] initWithTitle:ServiceMsg message:@"" delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil];
[Alert show];
}}];
.........However, I run the code, but I still get an error! My two files I created are named APActivityProvider. So now I get that error and dont know how to treat this. Whats the error of my architecture?
Any tipps, suggestions or solutions?
Thanks