Thursday, June 30, 2011

Simple NSThread Example


Threading

Sample Format:
Step .1
[NSThread detachNewThreadSelector:@selector(myMethod) toTarget:self withObject:nil];

Step .2
- (void)myMethod { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

*** code that should be run in the new thread goes here ***


[pool release]; }

Step .3
[self performSelectorOnMainThread:@selector(myMethod) withObject:nil waitUntilDone:false];

No comments:

Create a list in SwiftUI with sticky section headers

 Sample Code import SwiftUI struct ContentView : View {     @State var isCustomViewControllerDisplayed = false     @State private va...