标签: xcode7

xcrun:有没有办法通过“xcrun simctl”cli 设置环境变量

我正在寻找一种在使用 xcrun 时设置环境的方法。我们可以通过xcrun simctl setenvXcode 7.0之前的版本来设置环境。现在我们只能使用 来查看环境xcrun simctl getenv <device> <variable name>

我看过SIMCTL_CHILD_的参考,但我不知道如何使用它。

xcrun simctl spawn
Usage: simctl spawn [-w | --wait-for-debugger] [-a <arch> | --arch=<arch>] <device> <path to executable> [<argv 1> <argv 2> ... <argv n>]
If you want to set environment variables in the resulting environment, set them in the calling environment with a SIMCTL_CHILD_ prefix.
Run Code Online (Sandbox Code Playgroud)

我知道这是一件简单的事情,但我在这里遗漏了一小部分。

如果有人能帮助我,我真的很感激。

ios-simulator xcrun simctl xcode7

4
推荐指数
1
解决办法
3259
查看次数

Swift playground:获取ViewController来调用presentViewController

我想在Playground玩UIAlertController.是否有可能从XCPlaygroundPage获取ViewController - 能够调用presentViewController?

xcode ios uialertcontroller swift-playground xcode7

4
推荐指数
2
解决办法
2731
查看次数

带有页眉和页脚的 NSCollectionView

我需要这样的东西:

在此处输入图片说明

但我的代码是这样做的:

在此处输入图片说明

func collectionView(collectionView: NSCollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> NSView {
    let a = myView()
    if kind == NSCollectionElementKindSectionHeader {
        a.frame = NSMakeRect(0, 0, 1000, 10)
    }
    else if kind == NSCollectionElementKindSectionFooter {
        a.frame = NSMakeRect(0, 0, 1000, 12)
    }
    return a
}

func numberOfSectionsInCollectionView(collectionView: NSCollectionView) -> Int {
    return 3
}

override func numberOfItemsInSection(section: Int) -> Int {
    if section == 0 {
        return 5
    }
    else if section == 1 {
        return 5
    }
    return …
Run Code Online (Sandbox Code Playgroud)

macos cocoa nscollectionview swift xcode7

4
推荐指数
1
解决办法
3323
查看次数

如何在 UIAlertController 中更改一种 UIAlertAction 文本颜色

如何更改 UIAlertController 中的一个 UIAlertAction 而不是所有操作按钮的文本颜色。

这是我的 UIAlertController 代码:我想将删除 UIAlertAction 文本颜色更改为红色。

//Alert to select more method
func moreAlert()
{           
    let optionMenu = UIAlertController(title: "Mere", message: "", preferredStyle: UIAlertControllerStyle.ActionSheet)

    let Edit = UIAlertAction(title: "Rediger", style: .Default, handler: { action in

    })


    let Delete = UIAlertAction(title: "Slet", style: .Default, handler: { action in

    })

    let cancelAction = UIAlertAction(title: "Annullere", style: .Cancel, handler: { action in        
        print("Cancelled")
    })

    optionMenu.addAction(Edit)            
    optionMenu.addAction(Delete)            
    optionMenu.addAction(cancelAction)


    self.presentViewController(optionMenu, animated: true, completion: nil)
}
Run Code Online (Sandbox Code Playgroud)

swift uialertcontroller uialertaction xcode7

4
推荐指数
1
解决办法
3994
查看次数

Swift:使用未声明的类型

我正在实现一个类,但出现此错误:

使用未声明的类型“myProtocol”

这是我的代码:

class LocalContactService: myProtocol{
Run Code Online (Sandbox Code Playgroud)

你们有人知道为什么我会收到这个错误吗?

protocols ios swift xcode7

4
推荐指数
1
解决办法
3万
查看次数

在 Xcode 7 Instruments 中解释时间分析器

“546x”等究竟是什么意思?单击 (i) 图标会显示“最重回溯”列表,这在 Time Profiler 模板的上下文中意味着什么?文档并没有对此进行太多说明。

在此处输入图片说明

在此处输入图片说明

instruments ios xcode7

4
推荐指数
1
解决办法
646
查看次数

拖动并重新排序 - 带有节的UICollectionview

是否可以从集合视图 - iOS 9中从一个部分拖动并重新排序到另一个部分.

每次从第1部分拖到第4部分下降到下面崩溃,

断言失败 - [UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:

    func collectionView(collectionView: UICollectionView, moveItemAtIndexPath sourceIndexPath: NSIndexPath,toIndexPath destinationIndexPath: NSIndexPath)

        {

        let sequence = ArrayrelatedSequence[sourceIndexPath.section] as! SEQ_Sequence

        relIndexCards = sequence.rel_indexCard

        if relIndexCards.count > 0 {

            ArrayIndexcard = []

            let arr1: NSMutableArray = []

            for item in relIndexCards {

                arr1.addObject(item)
            }

            let descriptor: NSSortDescriptor = NSSortDescriptor(key: "keyP_IndexCard_ID", ascending: false)
            let arrNew:NSArray = arr1.sortedArrayUsingDescriptors([descriptor])

            let i = 0
            for item in arrNew
            {
                ArrayIndexcard.insert(item as! NSManagedObject, atIndex: i)
                i+1
            }

        }

        let temp = self.ArrayIndexcard.removeAtIndex(sourceIndexPath.item) …
Run Code Online (Sandbox Code Playgroud)

uicollectionview uicollectionviewlayout swift ios9 xcode7

4
推荐指数
1
解决办法
3100
查看次数

使用Xcode 7将应用程序提交到应用商店的解决方法

当尝试将使用Xcode 7编译的应用程序提交到iTunes Connect进行审核时,我收到一条错误消息

提交到App Store的应用和应用更新必须使用Xcode 5.1.1或更高版本以及iOS 7 SDK构建.

在此输入图像描述

这有什么解决方法吗?我已经将所有代码更新到Swift 2.0,我不想将它全部转换回Swift 1.2来上传它.

设置Deployment TargetiOS 8.0也不起作用

在此输入图像描述

有没有什么方法可以编译Swift 2.0代码,允许我将其上传到iTunes Connect(可能是其中的东西Build Settings),或者我是否必须将所有代码转换回Swift 1.2?

xcode itunesconnect ios xcode7 swift2

3
推荐指数
1
解决办法
2738
查看次数

Xcode警告:Format指定类型为'long'但参数的类型为'int _Nullable'

我收到以下代码行的警告:

    NSLog(@"selected segment: %li", _segmentControl.selectedSegmentIndex);
Run Code Online (Sandbox Code Playgroud)

该属性selectedSegmentIndex是类型NSInteger.

如果我将格式更改为%ii,请收到以下警告:

Format specifies type 'int' but the argument has type 'long _Nullable'
Run Code Online (Sandbox Code Playgroud)

Nullable类型是否有任何新的格式说明符,或者这只是Xcode 7中的一个错误?

xcode objective-c xcode7

3
推荐指数
1
解决办法
7110
查看次数

应用安装失败:未知错误Xcode 7

我的应用程序在模拟器中运行良好,但当我尝试在我的iPhone上安装它时它说

应用安装失败:发生了未知错误.

我打开了设备日志,得到了这个:

11月12日21时17分19秒伊萨克-iPhone streaming_zip_conduit [5853]:LaunchServices:现有占位符Raritea.FSS应用内安装应用<(NULL)在数据库中找不到 > 11月12日21时17分19秒伊萨克-iPhone streaming_zip_conduit [5853] :LaunchServices:没有为Raritea.FSS-App创建进度<(null)在数据库中找不到 >因为它不是占位符.11月21日21:17:19 Isaacs-iPhone installd [4549]:0x16e1bb000 - [MIClientConnection installPath:withOptions:completion:]:安装"/ var/mobile/Media/PublicStaging/FSS App.app"类型Developer(LSInstallType =(空))由streaming_zip_conduit请求(PID 5853)11月12日21时17分十九秒伊萨克-iPhone INSTALLD [4549]:0x16e12f000 - [MIInstaller performInstallationWithError:]:安装11月12日21时17分二十秒伊萨克-iPhone异形[4644]:(注)MC:供应配置文件已更改11月12日21:17:20 Isaacs-iPhone配置文件[4644] :(注)MC:更新MIS信任... 11月12日21:17:20 Isaacs-iPhone安全[4588]:secTaskDiagnoseEntitlements MISSING钥匙扣权利:没有存储taskRef发现11月12日21时17分二十秒伊萨克-iPhone securityd [4588]:secTaskDiagnoseEntitlements MISSING钥匙扣权利:没有存储taskRef发现11月12日21时17分二十秒伊萨克-iPhone INSTALLD [4549]:SecTrustEvaluate [叶IssuerCommonName SubjectCommonName] 11月12日21:17:20 Isaacs-iPhone个人资料[4644] :(注)MC:供应资料陈 ged Nov 12 21:17:20 Isaacs-iPhone profiled [4644] :(注)MC:更新MIS信任... 11月12日21:17:20 Isaacs-iPhone installd [4549]:无法识别状态-67049来自codesigning library Nov 12二十一点17分20秒伊萨克-iPhone INSTALLD [4549]:0x16e12f000 + [MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:错误:]:142:无法验证/private/var/mobile/Library/Caches/com.apple.mobile的代码签名.installd.staging/temp.FvOJz0 /提取/ FSS App.app/PlugIns/QuickSched.appex:0xe8008001(已发生未知错误)11月12日21点17分20秒伊萨克-iPhone INSTALLD [4549]:0x16e12f000 - [MIInstaller performInstallationWithError:]:验证阶段失败11月12日21:17:20 Isaacs-iPhone streaming_zip_conduit [5853]:0x16e087000 __MobileInstallationInstallForLaunchServices_block_invoke222:返回错误错误域= MIInstallerErrorDomain代码= 13"无法验证/ private/var/mobile/Library /的代码签名Caches/com.apple.mobile.installd.staging/temp.FvOJz0/extracted/FSS …

iphone xcode ios swift xcode7

3
推荐指数
3
解决办法
1万
查看次数