异步处理:GCD 与 NSOperationQueue 实现
1. 基础异步处理代码
1.1 代码结构
在进行异步处理时,我们需要创建几个关键的类文件,以下是具体的代码结构:
- AppDelegate.h
#import <UIKit/UIKit.h>
@class ViewController;
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) ViewController *viewController;
@end
- AppDelegate.m
#import "AppDelegate.h"
#import "ViewController.h"
@implementation AppDelegate
@synthesize window = _window;
@synthesize viewController = _viewController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)lau
超级会员免费看
订阅专栏 解锁全文
23

被折叠的 条评论
为什么被折叠?



