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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:53:35+00:00 2026-06-15T19:53:35+00:00

Hello below is the code i am using currentCardDisplayed = [NSMutableString stringWithFormat:@%@.png, [[cardsShuffled objectAtIndex:currentCard-1]

  • 0

Hello below is the code i am using

currentCardDisplayed = [NSMutableString stringWithFormat:@"%@.png", [[cardsShuffled objectAtIndex:currentCard-1] substringToIndex:[[cardsShuffled objectAtIndex:currentCard-1] length]-1]];

NSString *rule;

if([[currentCardDisplayed stringByAppendingString:@"e"] isEqualToString:currentCardName]){
    rule = @"drink";
}else if([[currentCardDisplayed stringByAppendingString:@"2"]isEqualToString:currentCardName]){
    rule = @"drink2";
}else if([[currentCardDisplayed stringByAppendingString:@"3"]isEqualToString:currentCardName]){
    rule = @"drink3";
}else if([[currentCardDisplayed stringByAppendingString:@"4"]isEqualToString:currentCardName]){
    rule = @"drink4";
}else if([[currentCardDisplayed stringByAppendingString:@"5"]isEqualToString:currentCardName]){
    rule = @"drink5";
}else if([[currentCardDisplayed stringByAppendingString:@"6"]isEqualToString:currentCardName]){
    rule = @"drink6";
}else if([[currentCardDisplayed stringByAppendingString:@"7"]isEqualToString:currentCardName]){
    rule = @"drink7";
}else if([[currentCardDisplayed stringByAppendingString:@"8"]isEqualToString:currentCardName]){
    rule = @"drink8";
}else if([[currentCardDisplayed stringByAppendingString:@"9"]isEqualToString:currentCardName]){
    rule = @"drink9";
}else if([[currentCardDisplayed stringByAppendingString:@"0"]isEqualToString:currentCardName]){
    rule = @"drink10";
}else if([[currentCardDisplayed stringByAppendingString:@"k"]isEqualToString:currentCardName]){
    rule = @"drinkjack";
}else if([[currentCardDisplayed stringByAppendingString:@"n"]isEqualToString:currentCardName]){
    rule = @"drinkqueen";
}else if([[currentCardDisplayed stringByAppendingString:@"g"]isEqualToString:currentCardName]){
    rule = @"drinkking";
}
NSLog(@" %@ ", currentCardDisplayed);
NSLog(@" %@ ", currentCardName);
NSLog(@"%@", rule);
NSLog(@" %@", [cardsShuffled objectAtIndex:currentCard-1]);
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Rules" message:rule delegate:nil cancelButtonTitle:@"Okay" otherButtonTitles:nil, nil];

[alert show];

the letters i am trying to add to the end are not getting there. i remove a letter at first, but then in my if statement i want to check if i add a different letter to that variable is it equal to the other string.

Can anyone see where i am going wrong

below is the sample output from the nslogs

2012-12-11 20:06:50.853 Kings_1.03[4915:c07]  club.png 
2012-12-11 20:06:50.855 Kings_1.03[4915:c07]  club9.png 
2012-12-11 20:06:50.857 Kings_1.03[4915:c07] (null)
2012-12-11 20:06:50.858 Kings_1.03[4915:c07]  club9

ANy help is appreciated

Thanking YOu

  • 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-15T19:53:36+00:00Added an answer on June 15, 2026 at 7:53 pm

    You have to add the .png after you do the if tests. The way you’re doing in now, using your example, is to append the 9 to club.png, which gives you club.png9 not club9, so your test is never satisfied.

    The easiest way would probably to not append that .png in the first line, and then in your if statements, append both the letter/number and .png, so:

    }else if([[currentCardDisplayed stringByAppendingString:@"9.png"]isEqualToString:currentCardName]){
        rule = @"drink9";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

With the below code when I refresh it (using Jetty/Chrome FYI) I see: Hello
Hello In my android application i am using the below code to make sure
Hello i have the code below <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
Hello everyone I'm currently having 2 issues with the code below: Upon return of
Technology Used:- Asp.Net 2.0 Code:- See Below Description:- hello code given below is working
Hello friends i am running code given below which contains the setLogTimeEntery function and
I have code as below: var s : String = hello world var xml
My code as below, How to remove the white space after add hello. to
Hello friends I am using this code in my view.. Using this code I
I am using the below code to receive the messages from serial port using

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.