2 つの NSMutableArrays (arrayContainsGoodClicks と arrayContainsBadClicks) があります。関連する Good ボタンと Bad ボタンがクリックされたときに、いくつかの NSTimeInterval 値でこれらの配列を初期化しています。今私の要件は、いくつかの TimeIntervals を使用して Web サービス呼び出しから応答を取得していることです。ここで、Webservice 応答から取得した NSTimeInterval 値を、2 つの配列に格納した値と比較したいと思います。コードの下を見つけてください。
question answer="t" qno="1" tin="71" title="Greet" tout="73"
question answer="t" qno="2" tin="74" title="Have Name Tag" tout="77
question answer="t" qno="3" tin="78" title="Greet" tout="83"
上記の形式で応答を取得しています。ファイルを解析し、NSTimeInterval 値の関連する詳細を保存しています。ここで、timeIntervals を 71 秒と 73 秒 (それぞれ 74 秒と 77 秒、78 秒と 83 秒) の間で比較したいと思います。ユーザーがGoodボタンとBadボタンをクリックしたすべてのtimeInterval値を含む配列があります。
-(void)onClickOfGood{
//NSLog(@"The current playback time in good:%g",moviePlayerController.currentPlaybackTime);
currentPlaybackTime = moviePlayerController.currentPlaybackTime;
NSNumber *goodTimeIntervals = [NSNumber numberWithDouble:currentPlaybackTime];
[arrayContainsGoodClicks addObject:goodTimeIntervals];
NSLog(@"The total count of Array is: %i",[arrayContainsGoodClicks count]);
NSLog(@"The Array contains : %@",arrayContainsGoodClicks);}
-(void)onClickOfBad{
NSLog(@"The current playback time in bad: %g",moviePlayerController.currentPlaybackTime);
currentPlaybackTime = moviePlayerController.currentPlaybackTime;
NSNumber *goodTimeIntervals = [NSNumber numberWithDouble:currentPlaybackTime];
[arrayContainsBadClicks addObject:goodTimeIntervals];
NSLog(@"The total count of Array is: %i",[arrayContainsBadClicks count]);
NSLog(@"The Array contains Bad Clicks are: %@",arrayContainsBadClicks);}
私の配列には、次のサンプルの詳細が含まれています...
The Array containing Good Clicks are : (
"2.065027933",
"3.153256308",
"4.216946226",
"4.94465584",
"5.688772132",
"6.48904879",
"7.256447126",
"8.000711516000001",
"8.760312588",
"9.537493762",
"10.45637486",
"11.153212146",
"11.880587144",
"12.672884372",
"13.52852395"
)
The Array containing Bad Clicks are: (
"2.70485684",
"3.713548251",
"4.593316639",
"5.353822771",
"6.049754725",
"6.930190204",
"7.592959653",
"8.353438538000001",
"9.074305708000001",
"9.905327347",
"10.809726701",
"11.448938757",
"12.321753456",
"14.106061449"
)
配列内の NSTimeIntervals と受信した応答を比較する方法について誰か助けてもらえますか?