I\'m running into a strange problem that I haven\'t run into before.
When you do cmd+U to run your Unit Tests (OCUnit for example) does it actually call the main.m,
If you're using Swift (you probably don't have a main.c), you have to do these steps :
1: remove @UIApplicationMain in AppDelegate.swift
2: Create an empty TestingAppDelegate.swift
import UIKit
class TestingAppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
}
3: Create a file called main.swift :
import Foundation
import UIKit
let isRunningTests = NSClassFromString("XCTestCase") != nil
if isRunningTests {
UIApplicationMain(C_ARGC, C_ARGV, nil, NSStringFromClass(TestingAppDelegate))
} else {
UIApplicationMain(C_ARGC, C_ARGV, nil, NSStringFromClass(AppDelegate))
}