私は棒グラフを描画するためにcore-plotを使用しています。私はx軸に日付を表示しています。私は次のコードを使用しました:ipad(ios)の日付をフォーマットした後の不明な文字
NSDateFormatter * formatter=[[NSDateFormatter alloc]init];
[formatter setDateFormat:@"dd MMM yy"];
double tickLocation=0.5;
NSMutableArray *customLabels = [NSMutableArray arrayWithCapacity:[valuesArray count]];
for (HistoryIndividualValueBean * value in valuesArray)
{
CPTAxisLabel *newLabel = [[CPTAxisLabel alloc] initWithText:[formatter stringFromDate:value.submittedTime] textStyle:x.labelTextStyle];
newLabel.tickLocation = [[NSNumber numberWithDouble:tickLocation++] decimalValue];
newLabel.offset = x.labelOffset + x.majorTickLength;
newLabel.rotation = M_PI_2;
[customLabels addObject:newLabel];
[newLabel release];
}
[formatter release];
x.axisLabels = [NSSet setWithArray:customLabels];
これは、iPhoneでうまくいきます。しかし、ipad上では、これは私が上にフォーマットした日付で奇妙な文字を表示します。この画像を参照してください:
あなたは中国語または日本語ロケールで実行していますか? '月'は、私が正しく思い出した場合、「月」のシンボルです。 – dasblinkenlight
@dasblinkenlight大変ありがとうございます。私はこれが問題だと思う。実際、クライアントはこのスクリーンショットを送った、私は彼に言う。彼は日本に住んでいるので、これが問題だと思います。再度ありがとう –