Hardik Dave's Blog
Wednesday, April 1, 2015
Monday, March 18, 2013
Selling my apartment 2bhk at Bhavnagar, Gujarat
Saturday, July 11, 2009
Deploying iphone application with SQLite database for ad hoc distribution
For Ad hoc distribution, I installed my app on my iphone for testing, app was installed fine but the data was blank. The problem was that the database wasn't copied over. After a little fight, found the solution below.
You need to add the sqlite file to you XCode project, in the resources folder. Then in your app delegate code file, in the appDidFinishLaunching method, you need to first check if a writable copy of the sqlite file has already been created - ie: a copy of the sqlite file has been created in the users document folder on the iphone's file system, if yes, you don't do anything, else you would overwrite it with the default xcode sqlite copy.
See below code example to do this. This method is called from the app delegates appDidFinishLaunching method.
// Creates a writable copy of the bundled default database in the application Documents directory.
- (void)createEditableCopyOfDatabaseIfNeeded {
// First, test for existence.
BOOL success;
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *writableDBPath = [documentsDirectory stringByAppendingPathComponent:@"bookdb.sql"];
success = [fileManager fileExistsAtPath:writableDBPath];
if (success) return;
// The writable database does not exist, so copy the default to the appropriate location.
NSString *defaultDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"bookdb.sql"];
success = [fileManager copyItemAtPath:defaultDBPath toPath:writableDBPath error:&error];
if (!success) {
NSAssert1(0, @"Failed to create writable database file with message '%@'.", [error localizedDescription]);
}
}
Monday, May 18, 2009
System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase
RESOLUTION
Follow the steps given below to fix this error
(1) Go to Start | Control Panel | Add and Remove Programs
(2) Click on the entry titled Microsoft .NET Framework 2.0 and select Change/Remove. The Microsoft .NET Framework 2.0 Setup dialog box opens up.
(3) Select the option titled Repair and the setup automatically performs the required repair work.
(4) You might be prompted to reboot the system after the completion of the process.
(5) Run the affected ASP.NET 2.0 application once again and the application should work fine without any problems.
NOTE : If you have installed Visual Studio 2008 Beta or Visual Web Developer Express Beta or .Net Framework 3.5, you may need to repair the .Net Framework 3.5 (Even though you use ASP.Net 2.X in your IIS). You may also need to go to IIS control panel and re-select the ASP.Net version.
Thursday, February 26, 2009
Error Message When You Run Regsvr32.exe on 64-Bit Windows
I googled and found that 64-bit machine considers SYSTEM32 as a 64-bit dlls folder and SysWOW64 (new folder introduced in the 64-bit machine) considers as 32-bit dll folder. And each of these folder has its own regsvr32.exe. So, if you try using a 64-bit regsvr32.exe, it will give you an error "
CAUSE: This is because on a 64-bit machine, the default behaviour is to use a 64-bit regsvr32.exe(Which is in System32).
RESOLUTION: To solve this problem, put your dll in the C:\Windows\SysWow64 fodler. Then got to your command window(This should be the one opened from the SysWow64 folder's cmd.exe), run the regsvr32.exe from the path "C:\Windows\SysWow64\" and it will work.
Wednesday, February 4, 2009
Wooohoo...I'm a blogger now!!!
It feels great while saying "Hello" to the "World" in real life, rather than in any of the web application! I was thinking to drive-into the blog world since a while now, and I'm finally here!
This blog is about general talk regarding the Technology I come across, any events, incident or about anything that I want to express my thoughts for.
Hope you'll like it.
That's it for today. Keep watching this place for interesting stuff.