//
Zbmainviewcontroller.m
TestProject
//
Created by Zhang Xianxin on 14/12/5.
Copyright (c) 2014 Zhibin. All rights reserved.
//
#import "ZBMainViewController.h"
@interface Zbmainviewcontroller ()
@property (Nonatomic,strong) Calayer *mylayer;
@end
@implementation Zbmainviewcontroller
BOOL Isopen=no;
-(void) Viewdidload {
[Super Viewdidload];
[Self initcontrols];
}
-(void) initcontrols{
Nsthread *thread=[nsthread CurrentThread];
NSLog (@ "%@", thread);
Nsthread *mainthread=[nsthread Mainthread];
NSLog (@ "%@", Mainthread);
Nsthread *tempthread=[[nsthread alloc] initwithtarget:self selector: @selector (run:) object:@ "Thread 1"];
[Email protected] "thread1";
[Tempthread start];
[Nsthread detachnewthreadselector: @selector (run:) totarget:self withobject:@ "Thread 2"];
[Self Performselectorinbackground: @selector (run:) withobject:@ "Thread 3"];
}
-(void) Run: (NSString *) str{
NSLog (@ "%@", str);
}
@end
Nsthread Multi-Threading three different ways