• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Swift遇到的报错信息

原作者: [db:作者] 来自: [db:来源] 收藏 邀请
  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!
    }

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

 


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Swift-使用arc4random()、arc4random_uniform()取得随机数发布时间:2022-07-13
下一篇:
Swift快速入门(一)第一个Swift程序发布时间:2022-07-13
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap