访问XCTestCase类中的应用程序委托对象导致misaligned_stack_error_ swift
我正在尝试在swift中进行unit testing。
我定义了我的testing用例类,如下所示:
import XCTest import CoreData import UIKit class LazyLoadingCheckTests: XCTestCase { var appDelegate : AppDelegate = UIApplication.sharedApplication().delegate as AppDelegate override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testExample() { // This is an example of a functional test case. XCTAssert(true, "Pass") } }
每当我试图执行一个testing用例时,断点自动停在下面一行:
它显示下面的堆栈跟踪:
当我试图继续它显示这一点:
任何线索?