Latest Articles

Use the navigation at the bottom to see older articles

How to access the iPhone Simulator Directory Structure

You can see the full directory under ~Library/Application Support/iPhone Simulator You’ll be presented with a list of iOS Versions, each of which has several folders to explore. To access data that your apps have written, head over to Applications and see a list of cryptic folders, each one corresponding to one of your apps. In […]

How to test if a file exists

Imagine we had a file that we’ve saved: NSString *myFile = [NSHomeDirectory() stringByAppendingPathComponent:@”Documents/myFile.txt”]; Before accessing it we can determine if it exists or not: BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:[NSHomeDirectory()stringByAppendingPathComponent:myFile]];

How to create an NSTimer

Timers are good if you want to delay executing a method, or if you need to call a method repeatedly. To set a one-off timer without setting a property you can use this: // calls the updateLabel method in 5 seconds [NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(updateLabel) userInfo:nil repeats:NO]; However, you won’t be able to stop it […]

How to update jQuery Mobile in Dreamweaver CS6

Adobe_Dreamweaver_CS6_IconSince the release of Adobe’s Dreamweaver CS6 the jQuery and jQuery Mobile libraries have been updated. This means that when you create a new Mobile Starter page, you’ll get outdated libraries by default.

With a bit of hacking we can change this to the most current version though. Let me show you how it worked for me – many thanks to Greg’s article on how to do this in Dreamweaver CS5.5.

Read more

How to save a UIImage

// let’s save our image as a JPG NSData *imageData = UIImageJPEGRepresentation(chosenImage, 1); // get our home directory and add the save path and file name NSString *imagePath = [NSHomeDirectory() stringByAppendingPathComponent:@”Documents/myImage.jpg”]; // then write the file to disk [imageData writeToFile:imagePath atomically:YES];