Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7772241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:50:39+00:00 2026-06-01T16:50:39+00:00

I have two NSMutableArrays(arrayContainsGoodClicks and arrayContainsBadClicks). I am initializing these Arrays with some NSTimeInterval

  • 0

I have two NSMutableArrays(arrayContainsGoodClicks and arrayContainsBadClicks). I am initializing these Arrays with some NSTimeInterval values when the relevant Good and Bad buttons are clciked. Now my requirement is, i am getting responses from a webservice call with some TimeIntervals. Now, i want compare the NSTimeInterval values that i am getting from the Webservice responses with the values that i have stored in the two arrays. Please find below the code.

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"

I am getting the response in the above mentioned format. I am parsing my file and storing the relevant details of NSTimeInterval Values. Now i want to compare the timeIntervals between 71 and 73 seconds(74 and 77,78 and 83 respectively). I have my arrays which contains all the timeInterval values at which the user has clicked the Good and Bad buttons.

    -(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);}

My arrays contains the following sample details…

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"

)

Can someone please help me on how to compare the NSTimeIntervals in my arrays and the received responses?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T16:50:41+00:00Added an answer on June 1, 2026 at 4:50 pm

    Seems quite trivial if you have the data in the correct format. NSTimeInterval is a typedef double so you can do comparisons using basic operators

    for(NSNumber* click in arrayContainsGoodClicks) {
        NSTimeInterval clickTimeInterval = [click doubleValue];     
        if(clickTimeInterval > 71.0 && clickTimeInterval < 73.0 ) {
           ...
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have two actionsheet buttons and one modalviewcontroller on mainviewcontroller in application. Now for two
I have two NSMutableArrays: NSMutableArray* currentMessages NSMutableArray* items I am trying to copy the
I have a method that accepts three NSMutableArrays, one as Input and two as
i have a UItableView and i have two buttons on each cell. You can
I have two arrays used in a small game. If the player gets a
I have two arrays, an NSMutableArray and an NSArray. The NSMutableArray is the store,
Possible Duplicate: deep copy NSMutableArray in Objective-C ? I have two arrays of length
i have two mutable arrays that i am looping through when the objects are
I have two NSMutableArrays(initialized from plist file contents) that contains Dictionary objects. Could anyone
I have two nsmutablearrays array1: searchedStores = [[NSMutableArray alloc] init]; array2: allStores; ///it holds

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.