iOS 开发实用技术导航
NSHipster 中文版
› http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
› http://www.cocos2d-iphone.org/
CocoaPods
› http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
› http://code.google.com/mobile/analytics/
WWDC
› https://developer.apple.com/wwdc/
Design Guides and Resources
› https://developer.apple.com/design/
Transcripts of WWDC sessions
› http://asciiwwdc.com
Cocoa with Love
› http://cocoawithlove.com/
Cocoa Dev Central
› http://cocoadevcentral.com/
NSHipster
› http://nshipster.com/
Style Guides
› Google Objective-C Style Guide
› NYTimes Objective-C Style Guide
Useful Tools and Services
› Charles Web Debugging Proxy
› Smore
zjupigeon
V2EX  ›  iDev

mavericks 10.9 不支持 swift 脚本直接运行么

  •  
  •   zjupigeon · Oct 2, 2014 · 5589 views
    This topic created in 4414 days ago, the information mentioned may be changed or developed.
    用命令行运行*.swift 提示, 没有mavericks 10.9 的sdk ,xcode里面直接创建工程 language也不能选择swift,但是能单独创建swift文件,是要升级beta么?
    11 replies  •  2014-10-02 21:49:00 +08:00
    san3ye
    san3ye
    Oct 2, 2014❤️1
    1
    我在等10.10
    zjupigeon
    zjupigeon
    OP
    Oct 2, 2014
    2
    @san3ye 也快了,没有几天了
    zjupigeon
    zjupigeon
    OP
    Oct 2, 2014
    3
    那现在直接在 xcode 6.0.1下面得commandlinetool的language也没有swift选项
    Cofyc
    Cofyc
    Oct 2, 2014
    4
    装 xcode 6 后,可以这样写:

    ```
    #!/usr/bin/env xcrun swift
    println("Hello World!")
    ```
    goofansu
    goofansu
    Oct 2, 2014
    5
    10.9的xcode6.0.1可以创建swift项目的
    jakwings
    jakwings
    Oct 2, 2014
    6
    @Cofyc <unknown>:0: error: the SDK 'MacOSX10.9.sdk' does not support Swift
    zjupigeon
    zjupigeon
    OP
    Oct 2, 2014
    7
    @jakwings 恩,我的也是这个问题
    aisk
    aisk
    Oct 2, 2014❤️1
    8
    可以这样:

    xcrun swift -sdk whatever


    whatever可以是任何东西,然后就进repl了
    Cofyc
    Cofyc
    Oct 2, 2014
    9
    @jakwings
    嗯,现在的确不行了。这样试下: xcrun --sdk iphoneos swift (refer: https://twitter.com/swiftLDN/status/509434104291790849)
    dorentus
    dorentus
    Oct 2, 2014
    10
    Xcode 6 GM 版和正式版支持的操作系统分别是 iOS 8 和 OS X 10.9,都是已经正式发行的版本。

    Swift on OS X 需要 OS X 10.10 SDK 的支持(不过看起来似乎只是苹果故意加的限制而已),你需要 Xcode 6.1 beta。

    楼上的方法,相当于在 iOS 8 simulator 环境下运行,一些复杂的代码,因为 iOS 和 OS X API 的不同,就没法运行。例如我的这个:

    https://gist.github.com/dorentus/4cd6e80145ea140495f4
    aisk
    aisk
    Oct 2, 2014
    11
    @livid 楼上的gist贴上去页面全乱了。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1285 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 21:08 · PVG 05:08 · LAX 13:08 · JFK 16:08
    ♥ Do have faith in what you're doing.