zoukankan      html  css  js  c++  java
  • Bug及其解决方法

     
    1、Unsupported compiler 'com.apple.compilers.llvmgcc42' selected for architecture 'armv7'
      XCode5  编译出错的问题:
      解决方法:
      Change your compiler for C/C++/ObjectiveC Go to Build Settings->Build OPtions->compiler for C/C++/ObjectiveC; select Default(Apple LLVM5.0)
     

      2、iphone开发,真机调试报The executable was signed with invalid entitlements错误.

      真机器上部署测试,在点击Build And Run后,提示The executable was signed with invalid entitlements.(The entitlements specified in your application’s Code Signing   Entitlements file do not match those specified in your provisioning profile.)错误,没有发布成功。在网上查询资料后,按照其中一个方法成功解决了此问题,具体如下:

    第一步:在工程中添加文件new file,选择Code Signing 中的Entitlements,添加后名称为Entitlements.plist。

    第二步:点击Entitlements.plist进行编辑,删除所有Root下的Key,然后添加一个Boolean类型,名称为get-task-allow的Key,状态为CHECKED

    第三步:在Targets中的Info中的Build选项卡中的Code Signing Entitlements的值设为Entitlements.plist,重新Build即可解决

    3、 reason: '-[UIPopoverController dealloc] reached while popover is still visible.'

      这是因为popover是一个局部变量,我们只需把它做成全局变量即可

     

    4、linker command failed with exit code 1 (use -v to see invocation)

      4.1.以如下错误为例,如果是多人开发,你同步完成后发现出现如下的错误。

     

    [html] view plaincopy
     
    1. Undefined symbols for architecture armv7:  
    2.   clang: error: linker command failed with exit code 1 (use -v to see invocation)  


      错误中出现了“MyPageLogViewController”这个类,你可以找到这个类的.m文件, 查看他的Target Membeship, 如下图

     

    如果没有勾选上,点击勾选。然后编译查看。


     4.2. 如果是新添加的第三方库,且不是静态库

    先重复第一步过程,然后找到 Build settings->Linking->Other Linker Flags


    将此属性修改成-all_load  或者 -ObjC ,这个视情况而定。总之可以多试几次。


    4.3.如果添加的是第三方静态库(.a文件)

     

    [html] view plaincopy
     
    1. Undefined symbols for architecture armv7:  
    2. clang: error: linker command failed with exit code 1 (use -v to see invocation)  


    在用到这个库的所有文件中都出现了错误, 如上 BaiduMobStatAppDelegate 类和 MyPageLogViewController类

     

    这种情况就可能是这个静态库路径混乱导致的链接错误

    解决方法:Build settings->Search Path->Library Search Paths  添加静态库的相应路径。如下图



    如果上面的所有方法都不管用。你可以再试试一下几个方法:

    1,看看是不是有新添加的文件跟之前文件同名

    2,错误信息中出现了某个类的名字,去原文件中看看#import了哪些第三方库,把这些库挨个注释排除,找到出错的那个库,然后按照官方提供的步骤重新添加一遍。

    注意:还有可能是因为Valid architectures 设置的指令集不对(指令集相应笔记见xcode5时代如何设置Architectures和Valid Architectures

     

     5、'UICollectionView must be initialized with a non-nil layout parameter'

      在初始化控制器的时候用:initWithCollectionViewLayout方法初始化

      UICollectionViewFlowLayout *layout= [[UICollectionViewFlowLayout alloc] init];

          TGDealListController *deal = [[TGDealListController alloc] initWithCollectionViewLayout:layout];

     


     
     
  • 相关阅读:
    PHP实现bitmap算法
    c++高性能web框架drogon入门教程五:实例小项目,web和api实例代码
    c++高性能web框架drogon入门教程四,orm使用,csp使用
    c++高性能web框架 drogon入门教程三 控制器和数据库客户端使用
    c++高性能web框架drogon入门教程二 windows10下安装drogon,配合vscoede搭建开发环境
    关于tiobe编程语言排行榜的开发语言排名有什么实际作用吗?
    Effective C++的50条建议
    php-cli命令行选项
    php调用kafka消息队列
    php调用rabbitmq实现订单消费队列,和延时消费队列
  • 原文地址:https://www.cnblogs.com/huangh/p/4118035.html
Copyright © 2011-2022 走看看