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 7717583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:56:15+00:00 2026-06-01T02:56:15+00:00

I really need help here. I’m desperate at this point. I have NSOperation that

  • 0

I really need help here. I’m desperate at this point.

I have NSOperation that when added to the NSOperationQueue is not being triggered.
I added some logging to see the NSOperation status and this is the result:

Queue operations count = 1
Queue isSuspended = 0
Operation isCancelled? = 0
Operation isConcurrent? = 0
Operation isFinished? = 0
Operation isExecuted? = 0
Operation isReady? = 1
Operation dependencies? = 0

The code is very simple. Nothing special.

       LoadingConflictEvents_iPad *loadingEvents = [[LoadingConflictEvents_iPad alloc] initWithNibName:@"LoadingConflictEvents_iPad" bundle:[NSBundle mainBundle]];

       loadingEvents.modalPresentationStyle = UIModalPresentationFormSheet;
       loadingEvents.conflictOpDelegate = self;

       [self presentModalViewController:loadingEvents animated:NO];

       [loadingEvents release];

       ConflictEventOperation *operation = [[ConflictEventOperation alloc] initWithParameters:wiLr.formNumber pWI_ID:wiLr.wi_id];

       [queue addOperation:operation];           

       NSLog(@"Queue operations count = %d",[queue operationCount]);
       NSLog(@"Queue isSuspended = %d",[queue isSuspended]);
       NSLog(@"Operation isCancelled? = %d",[operation isCancelled]);
       NSLog(@"Operation isConcurrent? = %d",[operation isConcurrent]);
       NSLog(@"Operation isFinished? = %d",[operation isFinished]);
       NSLog(@"Operation isExecuted? = %d",[operation isExecuting]);
       NSLog(@"Operation isReady? = %d",[operation isReady]);
       NSLog(@"Operation dependencies? = %d",[[operation dependencies] count]);


       [operation release];

Now my operation do many things on the main method, but the problem is never being called. The main is never executed.
The most weird thing (believe me, I’m not crazy .. yet). If I put a break point in any NSLog line or in the creation of the operation the main method will be called and everything will work perfectly.

This have been working fine for a long time. I have been making some changes recently and apparently something screw things up. One of those changes was to upgrade the device to iOS 5.1 SDK (iPad).

To add something, I have the iPhone (iOS 5.1) version of this application that use the same NSOperation object. The difference is in the UI only, and everything works fine.

Oh, and this only fails on the actual device. In the simulator everything works ok.

Any help will be really appreciated.

Regards,

  • 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-01T02:56:16+00:00Added an answer on June 1, 2026 at 2:56 am

    Ok, I finally solve this issue.

    The problem I was having was due to an NSOperation running in the background all the time (but in a different queue). This operation was blocking any other thread (NSOperation) to be executed. This was happening only in iPad 1 because is not dual core.

    My NSOperation was doing something like this on the main method:

    - (void)main 
    {
        while (![self isCancelled]) {
            //Do stuff
        }
    }
    

    And the NSOperation was contantly doing it the whole time

    Silly me, I didn’t give the OS time to work with other threads, so adding a sleep made the trick

    - (void)main
    {
        while (![self isCancelled]) {
            [NSThread sleepForTimeInterval:0.5];
            //Do Stuff
        }
    }
    

    That sleep gives the OS chance to work with other threads.

    Why putting a breakpoint was doing the work? … the debugger stopped all the threads and because the breakpoint was in my other NSOperation, that thread was executed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I really need some help with this as I have been trying to fix
I'm confused about how DQL works, and really need some help here. I have
sorry if you'll find this question stupid, but I really need help. Here's some
I really need help with interfaces in general... Any resources that you guys would
I really need help on this one. I am having a simple login form
Sorry to bother again, but I really need help transforming this Python2 code into
I really need your help for this. I am relatively new to programming and
I've some questions .. and I really need your help. I have an application.
I really need some help as this is driving me nuts! I need to
i really need help, i can't see something that is obvious, and usually then

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.