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 · 5296 views
    This topic created in 4280 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
        1
    san3ye  
       Oct 2, 2014   ❤️ 1
    我在等10.10
    zjupigeon
        2
    zjupigeon  
    OP
       Oct 2, 2014
    @san3ye 也快了,没有几天了
    zjupigeon
        3
    zjupigeon  
    OP
       Oct 2, 2014
    那现在直接在 xcode 6.0.1下面得commandlinetool的language也没有swift选项
    Cofyc
        4
    Cofyc  
       Oct 2, 2014
    装 xcode 6 后,可以这样写:

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

    xcrun swift -sdk whatever


    whatever可以是任何东西,然后就进repl了
    Cofyc
        9
    Cofyc  
       Oct 2, 2014
    @jakwings
    嗯,现在的确不行了。这样试下: xcrun --sdk iphoneos swift (refer: https://twitter.com/swiftLDN/status/509434104291790849)
    dorentus
        10
    dorentus  
       Oct 2, 2014
    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
        11
    aisk  
       Oct 2, 2014
    @livid 楼上的gist贴上去页面全乱了。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2824 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 78ms · UTC 13:22 · PVG 21:22 · LAX 06:22 · JFK 09:22
    ♥ Do have faith in what you're doing.