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!
        }
    

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

  • 相关阅读:
    C++对象模型
    Session、Application、Cache
    JavaScript事件的几个细节
    algorithm(算法)
    【REST WCF】30分钟理论到实践
    实践Scrum
    调试PostSharp DEMO 遇到的问题
    6.8 按字符串中的部分内容排序
    QObject就有eventFilter,功能很强(随心所欲的进行处理,比如用来QLineEdit分词)
    QPainter就是手里的作图工具,只需要三洋东西:笔(颜色,宽度,样式),字体(写字),刷子(大面积作画),这里有三个典型例子
  • 原文地址:https://www.cnblogs.com/tanglimei/p/5129556.html
Copyright © 2011-2022 走看看