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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:33:40+00:00 2026-05-31T07:33:40+00:00

I am using the below code for assigning values to my labels and imageviews

  • 0

I am using the below code for assigning values to my labels and imageviews but its not working properly. I am not getting the issue

if ([child11 length] != 0) {
    [childButton1 setAlpha:1];
    [childButton2 setAlpha:0];
    [childButton3 setAlpha:0];
    [childButton4 setAlpha:0];
    [childButton5 setAlpha:0];
    [childButton6 setAlpha:0];
    //label1.text = child11;
    NSLog(@"here we are");

    if ([child11image isEqualToString:@"Fajar"]) {
        image1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Blue-Jaanamaz-Small"]];
        NSLog(@"child11image::: %@", child11image);
        label1.text = child11;
    } else if ([child11image isEqualToString:@"Zuhr"]) {
        image1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Orange-Jaanamaz-Small"]];
        label1.text = child11;
    } else if ([child11image isEqualToString:@"Asr"]) {
        image1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Pink-Jaanamaz-Large"]];
        label1.text = child11;
        NSLog(@"child11image::: %@", child11image);
    } else if ([child11image isEqualToString:@"Maghrib"]) {
        image1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Green-Jaanamaz-Small"]];
        label1.text = child11;
    } else if ([child11image isEqualToString:@"Isha"]) {
        image1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Purple-Jaanamaz-Small"]];
        label1.text = child11;
    }
} else if ([child22 length] != 0){
    [childButton1 setAlpha:1];
    [childButton2 setAlpha:1];
    [childButton3 setAlpha:0];
    [childButton4 setAlpha:0];
    [childButton5 setAlpha:0];
    [childButton6 setAlpha:0];  
    label2.text = child22;

    if ([child22image isEqualToString:@"Fajar"]) {
        image2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Blue-Jaanamaz-Small"]];
    } else if ([child22image isEqualToString:@"Zuhr"]) {
        image2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Orange-Jaanamaz-Small"]];
    } else if ([child22image isEqualToString:@"Asr"]) {
        image2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Pink-Jaanamaz-Small"]];
    } else if ([child22image isEqualToString:@"Maghrib"]) {
        image2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Green-Jaanamaz-Small"]];
    } else if ([child22image isEqualToString:@"Isha"]) {
        image2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Purple-Jaanamaz-Small"]];
    }
} else if ([child33 length] != 0){
    [childButton1 setAlpha:1];
    [childButton2 setAlpha:1];
    [childButton3 setAlpha:1];
    [childButton4 setAlpha:0];
    [childButton5 setAlpha:0];
    [childButton6 setAlpha:0];

    label3.text = child33;

    if ([child33image isEqualToString:@"Fajar"]) {
        image3 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Blue-Jaanamaz-Small"]];
    } else if ([child33image isEqualToString:@"Zuhr"]) {
        image3 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Orange-Jaanamaz-Small"]];
    } else if ([child33image isEqualToString:@"Asr"]) {
        image3 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Pink-Jaanamaz-Small"]];
    } else if ([child33image isEqualToString:@"Maghrib"]) {
        image3 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Green-Jaanamaz-Small"]];
    } else if ([child33image isEqualToString:@"Isha"]) {
        image3 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Purple-Jaanamaz-Small"]];
    }
} else if ([child44 length] != 0) {
    [childButton1 setAlpha:1];
    [childButton2 setAlpha:1];
    [childButton3 setAlpha:1];
    [childButton4 setAlpha:1];
    [childButton5 setAlpha:0];
    [childButton6 setAlpha:0];

    label4.text = child44;

    if ([child44image isEqualToString:@"Fajar"]) {
        image4 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Blue-Jaanamaz-Small"]];
    } else if ([child44image isEqualToString:@"Zuhr"]) {
        image4 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Orange-Jaanamaz-Small"]];
    } else if ([child44image isEqualToString:@"Asr"]) {
        image4 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Pink-Jaanamaz-Small"]];
    } else if ([child44image isEqualToString:@"Maghrib"]) {
        image4 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Green-Jaanamaz-Small"]];
    } else if ([child44image isEqualToString:@"Isha"]) {
        image4 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Purple-Jaanamaz-Small"]];
    }
} else if ([child55 length] != 0) {
    [childButton1 setAlpha:1];
    [childButton2 setAlpha:1];
    [childButton3 setAlpha:1];
    [childButton4 setAlpha:1];
    [childButton5 setAlpha:1];
    [childButton6 setAlpha:0];

    label5.text = child55;

    if ([child55image isEqualToString:@"Fajar"]) {
        image5 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Blue-Jaanamaz-Small"]];
    } else if ([child55image isEqualToString:@"Zuhr"]) {
        image5 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Orange-Jaanamaz-Small"]];
    } else if ([child55image isEqualToString:@"Asr"]) {
        image5 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Pink-Jaanamaz-Small"]];
    } else if ([child55image isEqualToString:@"Maghrib"]) {
        image5 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Green-Jaanamaz-Small"]];
    } else if ([child55image isEqualToString:@"Isha"]) {
        image5 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Purple-Jaanamaz-Small"]];
    }
} else if ([child66 length] != 0) {
    [childButton1 setAlpha:1];
    [childButton2 setAlpha:1];
    [childButton3 setAlpha:1];
    [childButton4 setAlpha:1];
    [childButton5 setAlpha:1];
    [childButton6 setAlpha:1];

    label6.text = child66;

    if ([child66image isEqualToString:@"Fajar"]) {
        image6 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Blue-Jaanamaz-Small"]];
    } else if ([child66image isEqualToString:@"Zuhr"]) {
        image6 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Orange-Jaanamaz-Small"]];
    } else if ([child66image isEqualToString:@"Asr"]) {
        image6 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Pink-Jaanamaz-Small"]];
    } else if ([child66image isEqualToString:@"Maghrib"]) {
        image6 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Green-Jaanamaz-Small"]];
    } else if ([child66image isEqualToString:@"Isha"]) {
        image6 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Purple-Jaanamaz-Small"]];
    }
} else ([child11 length] == 0) {
    [childButton1 setAlpha:0];
    [childButton2 setAlpha:0];
    [childButton3 setAlpha:0];
    [childButton4 setAlpha:0];
    [childButton5 setAlpha:0];
    [childButton6 setAlpha: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-05-31T07:33:41+00:00Added an answer on May 31, 2026 at 7:33 am

    You don’t say what the actual problem is but the if statement has to be wrong. The first two conditions are

    if ([child11 length] == 0)
    {
        // do stuff
    }
    else if ([child11 length] != 0)
    {
        // do stuff
    }
    else  // nothing else matters
    

    You will always go through one of the first two cases because (x == 0 || x != 0) == true by definition. All of the stuff to do with child22, child33 etc never gets done.

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

Sidebar

Related Questions

I am using the below code to block the taskbar which is working perfectly.
I am using below code to query changes to users/OUs in AD. But it
I know using below code to ignore a certain exception, but how to let
Using below code, I am getting this error: NSTask: Task create for path '/Users/media/Library/Developer/Xcode/DerivedData/Manager-gnixeptcszdoubbnfcncumzypwge/Build/Products/Debug/lib'
I am using below code to get calendar events in my application. It's working
I using below code to insert new sms in inbox, but when i click
I am using below code to get uninstall package broadcast receiver but I don't
I am using below code for for saving the username password, credentials saved properly
I am using below code to play youtube shared videos but I want user
Using gcc 4.4.3 c89: I am just working on the following code below: I

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.