CoreFoundation vs Foundation

In a technical sense, yes, it is faster, for exactly that reason. In a practical sense, no, it’s not faster. For one thing, the speed difference is tiny. We’re talking milliseconds saved over the life of the entire process. The savings might be bigger on the iPhone, but it’s still pretty much the tiniest speed … Read more

Testing file existence using NSURL

NSURL does have this method: – (BOOL)checkResourceIsReachableAndReturnError:(NSError **)error Which “Returns whether the resource pointed to by a file URL can be reached.” NSURL *theURL = [NSURL fileURLWithPath:@”/Users/elisevanlooij/nonexistingfile.php” isDirectory:NO]; NSError *err; if ([theURL checkResourceIsReachableAndReturnError:&err] == NO) [[NSAlert alertWithError:err] runModal];

iOS start Background Thread

If you use performSelectorInBackground:withObject: to spawn a new thread, then the performed selector is responsible for setting up the new thread’s autorelease pool, run loop and other configuration details – see “Using NSObject to Spawn a Thread” in Apple’s Threading Programming Guide. You’d probably be better off using Grand Central Dispatch, though: dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ … Read more