xcode7

Can't access My Swift classes into Objective-C application

佐手、 提交于 2019-12-10 22:56:57
问题 I have created an application in Objective-C. I wants to use My Classes written in Swift into application for this i have done following things set Defines Module to YES. Defined Product Module Name I created a swift file something like this MyClass.swift import Foundation class MyClass: NSObject { override init() { super.init() print("SwiftClass init") } } @objc class SwiftClass : NSObject { override init() { super.init() print("SwiftClass init") } func sayHello() -> Void { print("hello"); }

Xcode 7 - How to initiate interface recording for UI Testing?

蹲街弑〆低调 提交于 2019-12-10 19:59:32
问题 I'm looking at the WWDC 2015 session 104 "What's new in Xcode" and see that in Xcode 7 I can record interface unit tests to automate clicking on buttons, enter text, etc. I have a new project created with UITests included, but how do I actually start recording interface interactions for UITests? Here's the snippet included in the test: - (void)setUp { [super setUp]; // Put setup code here. This method is called before the invocation of each test method in the class. // In UI tests it is

Xcode UI Testing - Finding element in Webview by id

浪尽此生 提交于 2019-12-10 19:06:39
问题 Our app is hybrid and contains webview. I'm trying to automate our app using Xcode UI Testing. I was able to locate web buttons using: let app = XCUIApplication() app.launch() let button = app.staticTexts["Button's text"] But in one of our tests we test localization - meaning the text changes and the static text query is no longer valid. Couldn't find any documentation how to locate an element by his id (or even class name). Any ideas? 回答1: I have had a similar problem trying to fill in text

After installing Xcode 7, Xcode 6.3 shows errors about converting to Swift 2

时光总嘲笑我的痴心妄想 提交于 2019-12-10 18:52:54
问题 After installing Xcode 7 to play with Swift 2 in Playgrounds, I've got a weird problem: when I open an existing Xcode 6.3 project with Xcode 6.3, it throws lots of errors about conversions to Swift 2. This project was just cloned from the repository and hasn't been opened with Xcode 7 yet. So my guess is that the Xcode 7 install messed up the Xcode 6.3 installed tools or something like that, but I have no idea how I could start to fix this. I certainly don't want to open and upgrade this big

How to convert between vector_float2 and CGPoint*?

情到浓时终转凉″ 提交于 2019-12-10 18:25:50
问题 What's the easiest/fastest way to convert between vector_float2 and CGPoint* in Objective-C? Does Apple provide any built-in functionality for this kind of type conversion? I noticed in 2-3 places in sample apps they just call CGPointMake() etc. to make the conversion Is it possible to simply cast a CGPoint* to vector_float2 and vice versa? Is it safe to do so? Update: obviously the solution is: vector_float2 v = (vector_float2){(float)point.x, (float)point.y}; CGPoint p = CGPointMake(v.x, v

Segmentation fault 11 when code coverage is turned on in Swift

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 17:29:47
问题 While I am running unit tests with XCTest in Swift, they run fine when code coverage is turned off. However once I try to enable code coverage, I have a failed build/test with 4 classes giving the following error message: Command failed due to signal: Segmentation fault: 11 . 回答1: Here is what worked for me (as all the other suggestions did not work in my case). I was getting a segmentation fault 11 on a particular Swift class when trying to run unit tests with code coverage turned ON. It

Xcode 7.2 can't attach to iPhone with iOS 9.2

吃可爱长大的小学妹 提交于 2019-12-10 16:27:27
问题 For development purposes, I already put iOS 9.2 beta on my iPhone 5s. Of course, I also installed Xcode 7.2 beta. When I want to run an app extension (keyboard) on the device, the app builds properly, gets installed on the iPhone and started. Then, however, I'm presented with this message in Xcode: Could not launch "MyApp" process launch failed: failed to get the task for process Does anyone know how to fix this? EDIT : With the final release version if Xcode 7.2, the message changed to Could

Breakpoints not being hit in Xcode 7

烂漫一生 提交于 2019-12-10 16:22:20
问题 I have an Xcode project which includes a sub project. After upgrading to Xcode 7 breakpoints in the sub project are not hit nor can I step into functions calls of the sub project. Some breakpoints do get hit but they just show assembly for the call so it seems the sub-project is not being symbolicated correctly. I've checked all the usual sort of things i.e. is generating debug symbols, build configuration on debug is not release and things of this nature shown in Xcode project settings.

Can't run app on device: iOS 9 frameworks won't codesign

流过昼夜 提交于 2019-12-10 16:16:17
问题 I'm updating an app with deployment target iOS 7 so it can work with iOS 9. Also, I'm adding some cool iOS 8 and 9 features. I've read a lot of article about backwards version compatibility and now that Swift 2.0 makes it easier. The things I've taken care of so far are: Having the Base SDK set at iOS 9 and the deployment target set at version 7 Checking the version at runtime with if #available(iOS 9.0, *) when using the new APIs Linking the only-iOS9 frameworks optionally, as seen here: As

How to remove the grey bottom bar in iPad simulator

喜夏-厌秋 提交于 2019-12-10 15:34:23
问题 I have tried to reset the simulator, to change the keyboard input settings, to rotate the simulator, but it did not change anything. The grey bar covers my ui so that the simulator is not usable. XCode version: 7.1 (7B91b) Simulator version: 9.1 (SimulatorApp-635.5) 回答1: To hide this bar you need to go into the Settings.app within the simulator (tap the gears icon on the home screen), then General->Keyboard, and turn off the 'Shortcuts' toggle. I have this issue in my app constantly, and