标签: xcode8

无法在横向模式下点击 (x,y) 坐标

在 Xcode 8 / Swift 3 中,使用坐标(withNormalizedOffset: CGVector)函数与 XCUIElement 交互似乎只能在纵向模式下工作。

为了测试此功能,我创建了一个单屏项目,其中一个按钮位于视图中央。然后我运行了以下 UI 测试:

func testExample() {

    XCUIDevice.shared().orientation = .portrait

    let window = XCUIApplication().windows.element(boundBy: 0)

    let centerPoint = window.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5))

    centerPoint.tap()
}
Run Code Online (Sandbox Code Playgroud)

这成功地点击了按钮。但是,如果我在 LandscapeLeft 或 LandscapeRight 中运行相同的测试,则不会点击该按钮。打印坐标的屏幕点显示它在纵向和横向模式下都位于按钮的框架内。

对于 Xcode 7 / Swift 2 中的所有方向,相同的逻辑都是成功的:

func testExample() {

    XCUIDevice.sharedDevice().orientation = .LandscapeLeft

    let window = XCUIApplication().windows.elementBoundByIndex(0)

    let centerPoint = window.coordinateWithNormalizedOffset(CGVectorMake(0.5, 0.5))

    centerPoint.tap()
}
Run Code Online (Sandbox Code Playgroud)

我是否遗漏了什么,或者这是一个合法的框架错误?它与从 Swift 2 中的 CGVectorMake 到 Swift 3 中的 CGVector(dx: dy:) 的转换有关吗?

ios-ui-automation xcode-ui-testing swift3 xcode8

6
推荐指数
1
解决办法
2008
查看次数

我想将输入节点的采样率从 44100 更改为 8000

我想将麦克风中的缓冲区读入一个数组,44.1khz 工作正常,但采样率为 8khz 时出现错误

ERROR:    >avae> AVAudioIONodeImpl.mm:884: SetOutputFormat: required condition is false: format.sampleRate == hwFormat.sampleRate
2016-11-26 19:32:40.674 Atem[5800:1168274] *** Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'required condition is false: format.sampleRate == hwFormat.sampleRate'
Run Code Online (Sandbox Code Playgroud)

使用我的以下代码:

 var engine = AVAudioEngine()
    func setup() {

    print("new")
    let input = engine.inputNode!
    let bus = 0

    let mixer = AVAudioMixerNode()
    engine.attach(mixer)

    engine.connect(input, to: mixer, format: input.outputFormat(forBus: 0))
    //pcmFormatFloat64 -- pcmFormatFloat32
    print(engine.isRunning)
    let fmt = AVAudioFormat(commonFormat: .pcmFormatFloat32, sampleRate: 12000, channels: 1, interleaved: true)

    do {
        try …
Run Code Online (Sandbox Code Playgroud)

audio buffer avfoundation swift3 xcode8

6
推荐指数
1
解决办法
5571
查看次数

如何在应用程序名称中添加空格

我正在尝试为我的应用程序名称添加空格,即使我的 Bundle 显示名称包含空格,它们也不会显示在模拟器上。

有谁知道如何做到这一点?

非常感谢

ios xcode8

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

将 URL 转换为 AVAsset - Swift

我正在尝试将音频播放器中的 url 转换为 AVAsset,以便我能够根据自己的喜好操纵音轨。(我只想能够修剪文件)。不幸的是,我遇到了资产未正确转换的问题。当我在转换之前打印音频 url 的持续时间时,它会正确打印出持续时间。不幸的是,当我将其转换为 AVAsset 时,它说持续时间为 0。这是怎么回事?任何指导将不胜感激!

func trimmingFunc() {

        try? audioPlayer = AVAudioPlayer(contentsOf: audioURL!)
        passingTime = audioPlayer.duration
        audioPlayer.delegate = self


        let currentDuration = audioPlayer.duration
        print(currentDuration) //correctly prints duration
        let filePath = URL(fileURLWithPath: (("\(String(describing: audioPlayer.url!))")))
        print(filePath) //correctly prints filePath


        let currentAsset = AVAsset(url: filePath)
        print(CMTimeGetSeconds(currentAsset.duration) //This is printing 0

}
Run Code Online (Sandbox Code Playgroud)

string avaudioplayer swift swift3 xcode8

6
推荐指数
1
解决办法
5904
查看次数

iOS 如何添加配置文件

我正在使用Xcode Version 8.3.3 (8E3004b). 我开发了一个应用程序,我想将其部署到 Apple 的 App Store。

为了存档和部署,我知道我首先需要一个配置文件。所以,在开发者控制台中,我设置了一个iOS Distribution Provisioning Profile

在此处输入图片说明

我还有以下证书:

在此处输入图片说明

在我的 MacBook 上,我在钥匙串中添加了以下证书:

在此处输入图片说明在此处输入图片说明

然后当我去 Xcode 时,我希望有一个 Provisioning Profile:

在此处输入图片说明

但正如你所看到的,它Failed to create provisioning profileNo profiles for 'com.ionicframework.thewhozoo912107' were found.

我显然缺少一些步骤来创建配置文件,以便将应用程序分发到 Apple App Store。

如果有人可以建议我需要做什么才能创建工作配置文件以分发应用程序,我将不胜感激。

更多信息:

在此处输入图片说明

mobile xcode itunes ios xcode8

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

当应用程序在前台 ios 10 swift 时禁用一个信号推送通知

我在 onesignal 启动选项中禁用了聚焦、自动提示、启动 url 和应用程序警报,但是当应用程序处于前台时仍然显示横幅,是缺少某些东西还是我写了一些额外的东西,这是我的代码,请查看下面的代码和帮帮我。

    //For One Signal
    let notificationReceivedBlock: OSHandleNotificationReceivedBlock = { notification in

        print("Received Notification: \(notification!.payload.notificationID)")
    }

    let notificationOpenedBlock: OSHandleNotificationActionBlock = { result in
        // This block gets called when the user reacts to a notification received
        let payload: OSNotificationPayload = result!.notification.payload

        var fullMessage = payload.body
        print("Message = \(String(describing: fullMessage))")
        if payload.additionalData != nil {
            if payload.title != nil {
                let messageTitle = payload.title
                print("Message Title = \(messageTitle!)")
            }

            let additionalData = payload.additionalData
            if additionalData?["actionSelected"] != nil { …
Run Code Online (Sandbox Code Playgroud)

ios onesignal swift3 ios10 xcode8

6
推荐指数
1
解决办法
1948
查看次数

有没有办法在Xcode 8 beta上获得iOS 7模拟器

我刚刚将我的Xcode更新为测试版(8.0),我丢失了之前版本中的iOS8先前模拟器.我仍然需要iOS 7 SDK和iOS 8.感谢任何帮助

xcode ios ios-simulator ios7 xcode8

5
推荐指数
1
解决办法
2665
查看次数

无法打开文档"Main.Storyboard".无法识别的文件内容

从xcode 7更新到xcode 8之后,我面对的是没有故事板.任何人都可以提供帮助.里面没有显示任何错误.

storyboard ios xcode8

5
推荐指数
3
解决办法
6726
查看次数

Xcode 8需要永远登陆断点

我只是将我的Xcode升级为Version 8.0 (8A218a),当我插入一些断点并运行一个项目时,它只停留了两分钟然后转到一个断点然后再转两个转到下一个断点.

更新:Step over行为也相同(非常慢).

使用8.0的其他人是否遇到此问题?

xcode8

5
推荐指数
1
解决办法
853
查看次数

苹果评论崩溃-iOS

我已经提交了几次申请进行审查。但是每次苹果测试人员说应用程序崩溃时。我在IPV4环境中测试了我的应用程序。完全没有崩溃,但苹果测试仪表示,启动时崩溃如下。这是IPV6的问题吗?我无法在IPV6环境中进行测试。

感谢您的重新提交。由于您的应用在启动时崩溃,因此我们无法对其进行审核。我们已附上详细的崩溃日志,以帮助解决此问题。

重现步骤:

1)在设备上启动应用程序2)应用程序尝试启动并崩溃

下一步

请修改您的应用程序并在连接到IPv6网络的设备上对其进行测试(所有应用程序都必须支持IPv6),以确保其启动不会崩溃。

Date/Time:           2016-10-25 13:02:41.6759 -0700
Launch Time:         2016-10-25 13:02:40.6012 -0700
OS Version:          iPhone OS 10.0.2 (14A456)
Report Version:      104

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000010014c3fc
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [0]
Triggered by Thread:  0

Filtered syslog:
None found

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   BBBApps                         0x000000010014c3fc 0x1000e4000 + 427004
1   BBBApps                         0x0000000100149420 0x1000e4000 + 414752
2   UIKit                           0x000000018d0a342c …
Run Code Online (Sandbox Code Playgroud)

crash ios9 ios10 xcode8

5
推荐指数
1
解决办法
490
查看次数