Daily Archives: March 31, 2010

Tomorrow’s April Fools’ Day; Prepare Yourself and Enjoy These Geek Pranks [Reminders]

Tomorrow’s April Fools’ Day, the one day a year that regularly upstanding publications push all sorts of nonsense and pranks are the rule of the day. Aside from offering this as a helpful reminder to take the crazy/exciting/incredible news you hear across the internet tomorrow with a grain of salt, we’d also like to remind you, if you’re the pranking sort, to check out these 10 harmless and awesome geek pranks. Be good, now! More »






How to Whip Your Movie and TV Show Art into Shape for XBMC and Boxee [Media Center]

Media centers like XBMC and Boxee are excellent tools for playing local media on your big screen, but many new (and even experienced) users run into one big stumbling block: How do you get them to correctly identify your media? Here’s how. More »






Understand Your Camera’s Histogram to Take More Balanced Pictures [Photography Tip]

Whether you’ve got a DSLR or you’ve turned your point-and-shoot into a super camera, those fancy features are useless if you don’t understand them. Want to capture a perfectly exposed picture? Learning to use your histogram is a good starting point. More »






Why You Should Never Pay More Than $10 For HDMI Cables [Infographics]

You’ve probably guessed that gold-plated cables for your home theater are entirely unnecessary. Still, there must be some small quality difference for all that price, right? Mint.com‘s blog lays out the answer: No, not at all. More »






Syphir Adds Awesome Advanced Filters to Gmail [Screenshot Tour]

Ever wish you could get even more nit-picky about your Gmail filters? Free Gmail-based webapp Syphir filters messages by arrival time, number of recipients, and whether they “need” replies. It really works, and it might just scratch your last, hard-to-reach inbox itch. More »






Read Files from the Application Bundle

Below are a few lines of code to get you started if you need to open and read a file that is stored in the application bundle. Files could be anything from help text that your application displays to specific content that facilitates testing.

As an example of the later, often times I find it helpful to put json (or xml) content into a file that I know is valid based on a remote server that I will eventually connect with. I add this file to the application bundle and read it into an internal data structure. I can then do various tests with known data, and once that is working, I can then proceed to the networking side of things to connect and retrieve live data.

// Read in and store as string
NSString *file = [[NSBundle mainBundle] pathForResource:@"jsonTest" ofType:@"txt"];
NSString *str = [NSString stringWithContentsOfFile:file
   encoding:NSUTF8StringEncoding error:NULL];
debug(@"str: %@", str);
 
// Do something with the test data...
 
// Read in and store as raw data bytes
NSString *file2 = [[NSBundle mainBundle] pathForResource:@"data" ofType:@"txt"];
NSData *data = [NSData dataWithContentsOfFile:file2];
WP Like Button Plugin by Free WordPress Templates