2015-10-09から1日間の記事一覧
NSDate timeIntervalSince1970プロパティを取得する NSDate *now = [NSDate date]; double timeInterval = [now timeIntervalSince1970]; 参考: NSDate Class Reference
C言語の関数 abs などを使う Objective-Cと戦うブログ: NSDateでマイナスの値が返る場合はfabs関数で絶対値を取る fabs(int n) →int型の絶対値を取得する labs(long n) →long型の絶対値を取得する fabs(float n) →double型の絶対値を取得する
objective c - Do NSDouble, NSFloat, or other types than NSInteger exist? - Stack Overflow NSInteger exists because the int type varies in size between 32-bit and 64-bit systems. float and double don't vary in size the same way, so there's …
NSString + (instancetype)stringWithFormat:(NSString *)format を使う double number = 3.14; NSString *numberString = [NSString stringWithFormat:@"%f", number]; 参考:NSString Class Reference
以下のようなコードを書いたところ。。。 hogehoge.h @property NSString *newHoge; Xcodeから以下のようにお叱りが。。。 Property follows Cocoa naming convention for returning 'owned' objects んで、調べてみた objective c - Semantic Issue: Proper…