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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:41:18+00:00 2026-05-30T03:41:18+00:00

I write a finance-based application, and I need custom behavior for NSDecimalNumber operations, so

  • 0

I write a finance-based application, and I need custom behavior for NSDecimalNumber operations, so I call [NSDecimalNumber setDefaultBehavior:(MyHandlerSubclass)] on application launch. However, I just found out from the NSDecimalNumber header file that it needs to be called on each thread decimal number calculations might be run on.

I could explicitly call [(NSDecimalNumber *) performOperation:withBehavior:], passing my MyHandlerSubclass each time, but it grows verbose and tiring. Is there any way to eliminate the verbosity, maintain the setDefaultBehavior:, and not have to worry about calculations being done on different threads with the wrong behavior? It sounds like I’d have to write my own wrapper to do so.

  • 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-30T03:41:21+00:00Added an answer on May 30, 2026 at 3:41 am

    I write a finance-based application, and I need custom behavior for
    NSDecimalNumber operations, so I call [NSDecimalNumber
    setDefaultBehavior:(MyHandlerSubclass)] on application launch.
    However, I just found out from the NSDecimalNumber header file that it
    needs to be called on each thread decimal number calculations might be
    run on.

    That seems unmanageable in the context of queues. There is no guarantee what thread any given GCD queue might run on, be it one of your own creation or one of the system provided queues. (Obviously, the main queue is an exception to this rule).

    The documentation says nothing about this limitation. Either the docs are wrong or the header is wrong…

    … and it is the docs (Disassembly is my friend). File a bug.

    There doesn’t seem to be a way to avoid using the more verbose form save for calling +setDefaultBehavior: at the beginning of any scheduled block (to cover the arbitrary thread issue).

    File a bug asking for an enhancement as the current behavior doesn’t make sense in a queue based world (and put the bug # here, please).

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

Sidebar

Related Questions

I'm trying to write an application that gets stock quotes from Google Finance and
I write a C#-application at the moment. For my finance data, I want to
Please write a list of tasks that a copy constructor and assignment operator need
I'm experimenting with a personal finance application, and I'm thinking about what approach to
I was in the process of creating an application for Finance Management.So I am
Trying to write a simple call to google's JSON stock ticker API. I would
Write a class ListNode which has the following properties: int value; ListNode *next; Provide
Write code to determine if a number is divisible by 3. The input to
Write a program to determine whether a computer is big-endian or little-endian. bool endianness()
You write a function and, looking at the resulting assembly, you see it can

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.