次のようなものが欲しいです:
int x = arrayX.count;
int y = arrayY.count;
if (x >= y) {
//do something
}
これは可能ですか?
次のようなものが欲しいです:
int x = arrayX.count;
int y = arrayY.count;
if (x >= y) {
//do something
}
これは可能ですか?
-compare: メッセージを多くのタイプのオブジェクトで使用することもできます。
if ([[NSDate date] compare:self.targetDate] == NSOrderedAscending) {
... // targetDate is in the future.
}
else if ([[NSDate date] compare:self.targetDate] == NSOrderedDescending) {
... // targetDate is in the past.
}
else { // NSOrderedSame
... // Dates are exactly the same.
}
サンプルコード。良くないコード。:-)
x
はい、 と がやy
などのプリミティブ値である限り、機能するはずint
ですfloat
。( のようなオブジェクトでは機能しませんNSNumber
。提供されているメソッドのいずれかを使用して、そのオブジェクトからプリミティブ値を取得する必要があります)。