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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:57:59+00:00 2026-05-31T22:57:59+00:00

EDIT: It works but it takes amazingly long to complete. Is this normal, or

  • 0

EDIT: It works but it takes amazingly long to complete.
Is this normal, or is there a way to optimize it?

Thanks

I am using DDUnitConverter in my project to convert currencies.

Everything works perfectly fine on the iOS Simulator but hangs when I try to convert the currencies on my iOS Device (iPhone 4 iOSv5.1). I looked around to find a fix to this issue but could not find anything. Here is the code that I use to exchange the currencies. The code within the DDUnitConverter is available here: https://github.com/davedelong/DDUnitConverter/downloads

if ([Number.text isEqualToString:@""] || [picklable.text isEqualToString:@"no selection"] || [picklable2.text isEqualToString:@"no selection"]) {
    return;
}

if ([Number.text isEqualToString:@"0"]) {
    Result.text = @"0";
    return;
}

int fromType;
int toType;

fromType = [list indexOfObject:picklable.text];
toType = [list indexOfObject:picklable2.text];

NSNumberFormatter * f = [[NSNumberFormatter alloc] init];
[f setNumberStyle:NSNumberFormatterDecimalStyle];
NSNumber * from = [[f numberFromString:Number.text] retain];
[f release];

NSNumber *to = [[[DDUnitConverter currencyUnitConverter] convertNumber:from fromUnit:fromType toUnit:toType] retain];
float toto = [to floatValue];
Result.text = [NSString stringWithFormat:@"%.4f %@", toto, picklable2.text];

if ((toto == 0 || toto == [Number.text floatValue]) && picklable.text != picklable2.text ) {
    Result.text = @"No Internet Connection or Previous Data";
}

[from release];
[to release];

[Result flashScrollIndicators];

Hopefully someone can help me out,
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-31T22:58:01+00:00Added an answer on May 31, 2026 at 10:58 pm

    Your code seems OK to me, but you are using DDUnitConverter. I’ve never used it, but I suppose it needs internet connection to load data from the internet. If the server take long time to answer, your app could hang on connection.

    You can try to connect to the server asynchronously using dispatch_async, this lets your app download data in background.

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

Sidebar

Related Questions

SELECT works, Edit button works, but after editing, when I press Save the Grid
EDIT: This code now works correctly, I only left it in case someone finds
EDIT: I realized that this code compiles and works: #include <iostream> template<class Something> class
EDIT: My main code no longer works, should this function work? <script type=text/javascript src=jquery-1.7.2.js></script>
This works: Entities.WorkOrderSet.Where(MyCustomMethod); This does not: Entities.WorkOrderSet.Where(o => MyCustomMethod(o)); ( [Edit] Even without new
I know their are already some optimize for loop questions, but I think this
This is effectively how i'm using _mssql. Everything works fine, even after i use
The following works: def spam(): print spam exec(spam.__code__) spam But what if spam takes
I'm using a query which generally executes in under a second, but sometimes takes
[edit] So it seems my code works fine, another piece of code + tiredness

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.