Created
November 12, 2011 02:10
-
-
Save nowsprinting/1359905 to your computer and use it in GitHub Desktop.
ビルドを実行した年をcopyright表記に埋め込む for Objective-C/iOS project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//ビルド年を求める | |
char* date = __DATE__; | |
char* year = date + strlen(date) -4; | |
NSInteger buildYear = atoi(year); | |
//Copyrightの設定 | |
if(COPYRIGHT_FIRSTVERSION_YEAR==buildYear){ | |
copyright_.text = [NSString stringWithFormat:@"%@ %d %@", | |
COPYRIGHT_PREFIX, COPYRIGHT_FIRSTVERSION_YEAR, COPYRIGHT_SUFFIX]; | |
}else{ | |
copyright_.text = [NSString stringWithFormat:@"%@ %d-%d %@", | |
COPYRIGHT_PREFIX, COPYRIGHT_FIRSTVERSION_YEAR, buildYear, COPYRIGHT_SUFFIX]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment