drawRect method of UIVew is called when a view needs to redraw itself
we usually add drawing code in this function
- (void)performSelectorOnMainThread:(SEL)aSelector withObject:(id)arg waitUntilDone:(BOOL)wait;
create new thread to do something
- (void)performSelectorInBackground:(SEL)aSelector withObject:(id)arg;
sleep
[NSThread sleepForTimeInterval:0.5]
lock:
ex:
NSLock *testLock = [[NSLock alloc] init];
[testLock lock];
[testLock unlock];
[testLock release];