??μ?????????л?App Delegate??
?????Jon Reid ???????[ 2016/10/19 11:01:25 ] ??????????????? App Delegate
???????????????????????????п?????? ???????????????????????£??????????????????????????????????????????????????? TDD Ч??????????????????÷?????
?????????? iOS ?????????????????????????????????????????е?????Σ?????????????? development??????????????Σ????????? production????????????????????????????? Development?? testing?? acceptance and production ???? app delegate????????????Ч???????
?????????? app delegate ???????????????????????
???????????????????????????????????????——?????????????????????飬??????????????????Щ?????????????????????????????????
?????????????α??????????
????????????
????Apple ???????????????????ò?????????????????????????????????????????ò?????????豸?????У??????????????????????????????
???????????????????????????? Apple ???????????????????????ò????Apple ??????????????????????????????μ? Xcode???? ????????????????Apple ??????? “app tests” ?? “library tests”???????????????????????????????????? Xcode ??????????????????? target ??????????????????
?????????????????????????????????????????????????????????ò?????????? ???????????????????????? ?????????? Xcode ??????????е?????????????????????ò????????????????????
????1??????????
????2??????????У???????
????3???????? bundle ??????е????
????4?????в???
??????????????????????????????????????????????????£?????t????????????
????????? app delegate
??????????????£???????????????????Ole Begemann ?? Revisiting the App Launch Sequence on iOS ?н???????????????????????? UIApplicationMain() ?????? app delegate???? application:didFinishLaunchingWithOptions: ???????????????????????????????????????????????
????1?????? Core Data??
????2????????????????
????3??????????????
????4????????????????????????????????????????????????????????????
??????????????????????????顣?????????????????????????????????????????????????????
??????????????????????????????巽????
??????? main ????
????????????????? main ???????????????
????#import <UIKit/UIKit.h>
????#import "AppDelegate.h"
????int main(int argc?? char *argv[])
????{
????@autoreleasepool {
????return UIApplicationMain(argc?? argv?? nil?? NSStringFromClass([AppDelegate class]));
????}
????}
???????????????????????????????в????????????????????????????????????????? app delegate????????????????
???????汾
????#import <UIKit/UIKit.h>
????#import "AppDelegate.h"
????#import "TestingAppDelegate.h"
????int main(int argc?? char *argv[])
????{
????@autoreleasepool {
????BOOL isTesting = NSClassFromString(@"XCTestCase") != Nil;
????Class appDelegateClass = isTesting ? [TestingAppDelegate class] : [AppDelegate class];
????return UIApplicationMain(argc?? argv?? nil?? NSStringFromClass(appDelegateClass));
????}
????}
??????????????????? XCTestCase ???????????????? TestingAppDelegate ?????????????????????????? app delegate???????????????????????????????? app delegate???????TestingAppDelegate ???????????????? target ?У?
??????????Щ?????????????????л????????????????????????????????????????????????????????е???飬???????????
????@autoreleasepool {
????Class appDelegateClass = NSClassFromString(@”XYZTestingAppDelegate”);
????if( appDelegateClass == nil ) {
????appDelegateClass = [DOAAppDelegate class];
????}
????return UIApplicationMain(argc?? argv?? nil?? NSStringFromClass(appDelegateClass));
????}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11