Long had i pondered on getting a unique stamp in every build xcode makes, so i could more easily distinguish between builds when failures occur. Today i made a nice discovery. In your project right click on the name of…
Long had i pondered on getting a unique stamp in every build xcode makes, so i could more easily distinguish between builds when failures occur. Today i made a nice discovery. In your project right click on the name of…
I know this one has been depreciated in 10.5 to but i never found a nice replacement until now: message = [NSString stringWithCString:(buffer + 4) length:(arg2 -5)]; becomes: message = [[[NSString alloc] initWithBytes:(buffer + 4) length:(arg2 -5) encoding:NSASCIIStringEncoding] autorelease];
I am porting MacTrek to OS X 10.6 native (from 10.4) and i got the “Format not a string literal and format arguments” error a couple of hundred times. Source of the problem is: #define LLLog if([[NSUserDefaults standardUserDefaults]boolForKey:@”LLLogDisabled”]!=YES)NSLog Apparently NSLog…
So you are writing the next great iPhone app and you pull some data from a server using TCP, but what happens in the unhappy scenario? TCP timeout takes about 30 seconds, if in the main loop, your app freezes,…
Debugging (auto)release errors It’s quite easy to release an object twice, causing Objective-C programs to crash somewhere else. Quite difficult to detect, therefore create the following .gdbinit file in your home folder: fb -[NSException raise] fb objc_exception_throw() fb -[_NSZombie release]…
The NSSound class is great for playing simple sounds, yet it lacks control over a more flexible way to play sounds. MacTrek plays sounds louder when they happen closer to the players position and balances them left or right when…
If you are a lazy coder like me (or you don’t like to code version numbers all over the place) you should use the version number that Apple wants you to specify (in the Info.plist file) whenever you need to…
NSXMLParser is a great parser, but what if you are reading XML from, say a socket. You may not have the complete message right away, and there may be multiple root tags (or you can close and open a socket…