IPhone ios 5, recreate database on each simulator run?
How can i replace the database (with the one i am working on) in my app on each simulator run? (Still adding data and want to check that it looks good)

I tried this but it doesn't seem to be working, still using the old database:

    - (void) checkAndCreateDatabase{
        BOOL success;
        NSFileManager *fileManager = [NSFileManager defaultManager];
        success = [fileManager fileExistsAtPath:dbpath];
        if (success) {
         //return;
            [fileManager removeItemAtPath:dbpath error:nil];
        }
        
        NSString *dbPathFromApp = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:dbname];
        [fileManager copyItemAtPath:dbPathFromApp toPath:dbpath error:nil];
    }


Also where is the location for the iphone database? When my app copies the database into the iphone, where does it end up?
IPhone ios 5, recreate database on each simulator run?
===

How can i replace the database (with the one i am working on) in my app on each simulator run? (Still adding data and want to check that it looks good)

I tried this but it doesn't seem to be working, still using the old database:

    - (void) checkAndCreateDatabase{
        BOOL success;
        NSFileManager *fileManager = [NSFileManager defaultManager];
        success = [fileManager fileExistsAtPath:dbpath];
        if (success) {
         //return;
            [fileManager removeItemAtPath:dbpath error:nil];
        }
        
        NSString *dbPathFromApp = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:dbname];
        [fileManager copyItemAtPath:dbPathFromApp toPath:dbpath error:nil];
    }


Also where is the location for the iphone database? When my app copies the database into the iphone, where does it end up?