Hi
I'm detecting the number of times my Mac application has being opened using the following code:
However, this only works for detecting the first launch. How would I detect a second and third launch? I did try:
However, I am comparing an NSArray with an Interger there. How should adapt this to detect a second launch?
Thanks in advance for any help,
Sam
I'm detecting the number of times my Mac application has being opened using the following code:
Code:
NSString *currentVersion = (NSString*)[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"];
NSArray *prevStartupVersions = [[NSUserDefaults standardUserDefaults] arrayForKey:@"prevStartupVersions"];
if (prevStartupVersions == nil)
{
}
else {
}
[[NSUserDefaults standardUserDefaults] synchronize];
Code:
if (prevStartupVersions == 1)
Thanks in advance for any help,
Sam