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

  • Home
  • SEARCH
  • 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 713411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:57:30+00:00 2026-05-14T04:57:30+00:00

I have a small app, where user can make some calculations and solve equations.

  • 0

I have a small app, where user can make some calculations and solve equations. For example, if in a square equation discriminant is less than zero, the x1 and x2 values are “nan”, so when I assign x1 and x2 values to UILabels they show “nan” as well. Writing a lot of if’s like

if(D<0) [label setText:[NSString stringWithFormat: @"No solutions"]];

Doesn’t help-there are too many cases. I want to check if after

[label setText:[NSString stringWithFormat: @"%f", x]];

label’s value is “nan”, the label’s value will be set to @”No solutions”.

Doing simple

if(label==@"nan") {
 //code
}

doesn’t help.

Thanks in advance!

  • 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-14T04:57:30+00:00Added an answer on May 14, 2026 at 4:57 am

    There are two errors in your following code block:

    if(label==@"nan") {
     //code
    }
    
    1. You are referring to label instead of [label text] (or label.text if you prefer dot notation).
    2. In Cocoa/Cocoa-Touch, you need to do string comparisons using NSString‘s isEqualToString method.

    Instead, try:

    if ([[label text] isEqualToString:@"nan"]) {
     // Code
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small tab on an app that allows user to lookup a
I'm trying to build a small testing app with erlang+mnesia. I have a user
I have a small app that downloads some files from a remote (HTTP) server
I have a small app that allows the user to draw on the screen
I have a small app that a client uses to manually update some data.
I did a small app to make shipping bills, where a user enters the
I have a small ASP.net web app for sales, when the Make New Sale
I have small test app: Socket socket = new Socket(jeck.ru, 80); PrintWriter pw =
I have small web app that generate PDF files as a report. I'm trying
I have a small app I'm working on where I'm trying to use Django's

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.