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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:08:03+00:00 2026-05-30T13:08:03+00:00

I am using NSOperation in my application. I am cancelling the previously executing operation

  • 0

I am using NSOperation in my application.
I am cancelling the previously executing operation when create another operation. But the previously created operation’s dealloc method not calling when cancelling that operation.

Pls suggest me.
Thanks.

  • 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-05-30T13:08:04+00:00Added an answer on May 30, 2026 at 1:08 pm

    That’s just fine:

    Responding to the Cancel Command

    Once you add an operation to a queue, the operation is out of your
    hands. The queue takes over and handles the scheduling of that task.
    However, if you decide later that you do not want to execute the
    operation after all—because the user pressed a cancel button in a
    progress panel or quit the application, for example—you can cancel the
    operation to prevent it from consuming CPU time needlessly. You do
    this by calling the cancel method of the operation object itself or by
    calling the cancelAllOperations method of the NSOperationQueue class.

    Canceling an operation does not immediately force it to stop what it
    is doing. Although respecting the value returned by the isCancelled is
    expected of all operations
    , your code must explicitly check the value
    returned by this method and abort as needed. The default
    implementation of NSOperation does include checks for cancellation.
    For example, if you cancel an operation before its start method is
    called, the start method exits without starting the task.

    The dealloc method will be called when the retain count of the object gets to zero alas when no other object is using it.

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

Sidebar

Related Questions

I'm using NSOperationQueue , and NSOperation for running some function on background click. But
I am using MagicalRecord to help with core data operation. I have a NSOperation
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
I'm using an NSOperation to collect data that should be downloaded (takes 2-5 sec.)
When I cancel an NSOperation (when user presses a button) cancel method is called
Currently I'm using NSThread to cache images in another thread. [NSThread detachNewThreadSelector:@selector(cacheImage:) toTarget:self withObject:image];
I am running into an strange behavior when using NSOpeation. I am calling a
I have a NSOperation that downloads some data using NSURLConnection, it looks somewhat like
I'm having difficulty converting some NSOperation code to ARC. My operation object uses a
I am trying to download a file from an FTP server using an NSOperation.

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.