US Visa App for iPhone
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

This repository contains a project called "US Visa App for iPhone".

Technical notes

Progress bar UI on iPhone

Writing iOS 4 Code to Hide the iPhone Keyboard

NSDate formatting

Save/restore context

Getting application directory name

NSString* docPath() { 
    NSArray* pathList =
    NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    return [[pathList objectAtIndex:0] stringByAppendingPathComponent:@"data.dtd"]; 

- (BOOL)application:(UIApplication *)applicationdidFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 
    // Attempt to load an existing to-do dataset from an array stored to disk. 
    NSArray *plist = [NSArray arrayWithContentsOfFile:docPath()]; 
    if (plist) {
        // If there was a dataset available, copy it into our instance variable.
        tasks = [plist mutableCopy];
    } else {
        // Otherwise, just create an empty one to get us started.
        tasks = [[NSMutableArray alloc] init];

- (void)applicationDidEnterBackground:(UIApplication *)application {
    // This method is only called in iOS 4.0+
    // Save our tasks array to disk
    [tasks writeToFile:docPath() atomically:YES];

NSString *pathInDocumentDirectory(NSString *fileName) {
    // Get list of document directories in sandbox
    NSArray *documentDirectories =
    NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    // Get one and only document directory from that list
    NSString *documentDirectory = [documentDirectories objectAtIndex:0];
    // Append passed in file name to that directory, return it
    return [documentDirectory stringByAppendingPathComponent:fileName];