zoukankan      html  css  js  c++  java
  • Swift 遇到的报错信息

    1. 第一个,没看懂。一开始还以为是不支持iOS7的缘故。
    dyld: Library not loaded: @rpath/libswiftCore.dylib
      Referenced from: /var/mobile/Applications/9D80DFDC-2568-4328-B0BF-6418C3702DE4/swift02_project.app/swift02_project
      Reason: no suitable image found.  Did find:
    /private/var/mobile/Applications/9D80DFDC-2568-4328-B0BF-6418C3702DE4/swift02_project.app/Frameworks/libswiftCore.dylib: code signature invalid for '/private/var/mobile/Applications/9D80DFDC-2568-4328-B0BF-6418C3702DE4/swift02_project.app/Frameworks/libswiftCore.dylib'
    

      未解决。第二次运行,就没有这个报错了。

    • 在安装CocoaPods的时候提示的。
    [!] Pods written in Swift can only be integrated as frameworks; add `use_frameworks!` to your Podfile or target to opt into using it. The Swift Pod being used is: SwiftyModel
    

      意思是说:CocoaPods在Swift里面,只能以framework的形式使用,所以要加这句话。那么这句话在哪里加呢?在Podfile里面,在写完所有的语句之后,加上这句,示例如下:

    platform :ios ,'8.0'
    pod 'SwiftyModel', '~> 0.1.0'
    use_frameworks!         
    

      再重新install就可以了。  

    • can't convert value of type 'AnyObject' to specified type 'NSMutableArray'

      

      报这个错的原因,我认为是因为,这个字典不想让乱七八糟的东西,成为自己的关键字。所以在后面,要加个类型说明。

    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
            let cell = self.tableView!.dequeueReusableCellWithIdentifier("cell")
            let sectionArr:NSArray = self.dataDic.allKeys
            let sectionText:String = sectionArr.objectAtIndex(indexPath.section) as! String
            let rowArr:NSMutableArray = self.dataDic.objectForKey(sectionText) as! NSMutableArray
            let rowDic:NSDictionary = rowArr.objectAtIndex(indexPath.row) as! NSDictionary
            let cityName:String  = rowDic.objectForKey("city") as! String
            cell?.textLabel?.text = cityName
            return cell!
        }
    

      这样就可以了。在后面标明被取出来的数值,将会以什么样的形式显示,就可以了。

  • 相关阅读:
    Android之旅 刷机 前言
    流程管理的售前意识
    站在企业角度来审视K2
    Android之旅 ROM定制 美化 默认屏的下方操作菜单
    在非K2服务器上部署基于K2的Web Application
    java拦截器与过滤器(转载)
    windows安装rediscluster集群
    SpringBoot使用Nacos配置中心(转载,可用)
    SpringBoot+Dubbo+MybatisPlus整合Seata分布式事务踩坑集合
    转载RabbitMQ教程
  • 原文地址:https://www.cnblogs.com/tanglimei/p/5129556.html
Copyright © 2011-2022 走看看