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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:12:52+00:00 2026-06-10T23:12:52+00:00

i am using if else to see the condition but it always execute else

  • 0

i am using if else to see the condition but it always execute else

int mytestcount=rowCount;
NSLog(@"My Test ROw Count IS %d",mytestcount);


if (mytestcount=0) {


    NSLog("No Data To Upload");

}


else {


    [Coffee getInitialDataToDisplay:[self getDBPath]];



}

my if is true then also it excutes else i do not know why when rowCount is 0

  • 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-10T23:12:54+00:00Added an answer on June 10, 2026 at 11:12 pm

    = is the assignment operator, == is the comparison operator.
    So your code fragment:

    • assigns 0 to mytestcount
    • uses mytestcount in the if-condition, and since mytestcount equals 0 and C-based languages treat 0 as false, your if condition always evaluates to false, and your else branch is always executed
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

using stdout library it will maybe pass data to logcat or somewhere else which
I know if/else works, but I needed an alternative. I am using B =
I'm using jQuery in my web application. I've been using .bind() but I see
I am using if else statements in awk . Everytime when I use it
I am working on an Outlook add-in written by someone else using VSTO 4.0.
I am writing an if/else alternative using a table driven method. I have the
Does using the computer for something else while benchmarking ( with the Benchmark module
There is some code that I am using written by someone else that I
I wrote a form using the Form API in Drupal 6. Everything else works
i am trying to validate someone else's code here and they are using the

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.