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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:39:21+00:00 2026-05-22T14:39:21+00:00

The following sets an NSString to the StringValue of a textfield. Then, the strings

  • 0

The following sets an NSString to the StringValue of a textfield. Then, the strings are compared in General_combinations

- (IBAction)SendAction:(id)sender
{
    NSString *MyLoggerCommand = [CommandBox stringValue];
    [CommandBox setStringValue:@""];
    [[[MyLogger textStorage] mutableString] appendString: MyLoggerCommand];
    [self General_Combinations];
}

- (void)General_Combinations
{
    NSLog(@"General Combinations called..");
    if([MyLoggerCommand isEqualToString:@"this"])
    {
        NSLog(@"Matched..");
    }

}

However, no matter what the strings are, they are never equal.
the snippet

[CommandBox setStringValue:@""];

shouldn’t affect anything because the NSString is set first before the actual box is cleared.

  • 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-22T14:39:23+00:00Added an answer on May 22, 2026 at 2:39 pm

    The problem is you’re comparing MyLoggerCommand when the second method doesn’t know what that is. Try this code:

    -(IBAction)SendAction:(id)sender {
    
        NSString *myLoggerCommand = [CommandBox stringValue];
        [[[MyLogger textStorage] mutableString] appendString: myLoggerCommand];
        [self General_Combinations:myLoggerCommand];
        [CommandBox setStringValue:@""];  
    }
    
    -(void)General_Combinations:(NSString *)aString {
    
        NSLog(@"General Combinations called..");
        if([aString isEqualToString:@"this"])
        {
            NSLog(@"Matched..");
        }
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code that sets a background if user has uploaded to
I have the following function which sets up the GUI. public void go() {
I want to do the following: The user sets 3 parameters in MVC3 view:
Following are two pieces of code I used to compute power sets of elements
Following Ryan Bates' instructions on creating a before_filter that sets a time_zone like so
I have tried the following MySQL update but it only sets the first field
Following up to this question , it seems like Select-Object sets its input to
Executing the following sql: USE [WSS_Content] EXEC sp_helplogins returns two result sets, and within
I have a table with sets of settings for users, it has the following
Say you had the following two constructors: - (id)initWithTitle:(NSString *)title; - (id)initWithTitle:(NSString *)title page:(NSString

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.