Archive for the ‘Development’ Category

 

App Dev Tips – App directories change after every update

July 8, 2011
Share

I learned this the hard way and wanted to share my experience.

Every time a user updates your app from the App Store, the default document directory changes. The best practice in this case would be to save a relative path to your files instead of the fully-qualified path. If you do this, the only thing you have to worry about is getting the current app document directory and appending the path you have saved in previous versions.

The way I have done this is by implementing 2 helper methods as follows:

- (NSString *)applicationDocumentsDirectory {

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;
return basePath;

}

- (NSString *) trueUrl{

NSString *directory = [[self applicationDocumentsDirectory] stringByAppendingString:_relativeDirectory];
return directory;

}

So say for example you have created an images directory and saved a PNG image into that directory. You will have a file path such as:

YourAppDocumentDirectory1.0/images/file.png

When your users upgrade to version 1.1, the new path for the previously saved image will change:

YourAppDocumentDirectory1.1/images/file.png

Since you will not know beforehand what this directory will be, you can use the aforementioned helper methods to do the job for you:

- (NSString *)applicationDocumentsDirectory;

will return your current application document directory:

YourAppDocumentDirectory1.0 or YourAppDocumentDirectory1.1

and

- (NSString *) trueUrl;

will take the relative path you have stored

/images/file.png

and append it to the current application directory, thus giving you the true path you wanted in the first place.

If you have any questions don’t hesitate to ask.

iPhone apps and Polaroid Legal Issues

June 10, 2011
Share

I love vintage style photo frames, I believe they bring a particular character to photographs and they evoke a certain familiarity. That is why initially, I chose to frame the profile image of Kid-Capsule’s main screen in a Polaroid-esque frame and make the caption screen resembled the bottom of the Polaroid where you add handwritten notes to them. Never in my wildest dreams did I think this was going to be the factor that would have my app rejected.

I’ve used several photography apps that have Polaroid style frames and I have also seen other brands of actual film with similar frames. It honestly never occurred to me that it is their Trademark.

This whole issue set my app approval time back about a week even though I submitted my changes the same night it got rejected.

After the app rejection, I found out about others that had the same problem. My reason for posting my experience is to let other developers out there know that this is still an issue with iPhone apps so be cautious and get the appropriate licenses or just change your graphics like I ended up doing.