Apple Mach-O链接器错误(APActivityIcon) [英] Apple Mach-O Linker error (APActivityIcon)

查看:82
本文介绍了Apple Mach-O链接器错误(APActivityIcon)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有问题!抱歉,我是编程新手,我不知道该怎么做。我实现了一些代码,以自定义ActivitiViewController。我创建了一个新类,并链接到我的代码:

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];


          }}];

.........但是,我运行了代码,但仍然得到了错误!我创建的两个文件名为APActivityProvider。因此,现在我得到了该错误,并且不知道该如何处理。我的体系结构有什么错误?

.........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?

谢谢

推荐答案

APActivityIcon.m 可能不应该与您的应用一起编译。

APActivityIcon.m is probably not being compiled with your app, when it probably should be.

如果它是库的一部分,则必须将该库配置为Xcode中的依赖项,然后将您的应用程序链接到该静态库。

If it's part of a library, then you will have to configure that library as a dependency in Xcode, then link your app to that static library.

这篇关于Apple Mach-O链接器错误(APActivityIcon)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆