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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:51:08+00:00 2026-06-02T16:51:08+00:00

if I have a UILabel: label1.text (maximum length 6 character) In this example GARAGE

  • 0

if I have a UILabel: label1.text (maximum length 6 character) In this example GARAGE is the word in it.

is it possible to have code that would make

label1a: G
label1b: A
label1c: R
label1d: A
label1e: G
label1f: E

I need this so I can compare every character in a word with every character in a other word.

Been struggling with this for a couple of days now :S

edit

I got a random word generator that generates word with a length of 6 like ‘GARAGE’ or ‘SAILOR’ it generates it into a label for this We’ll call the label: ‘randomword.text’

now We got a input label where the character display that we put in with our own made keyboard. this label is ‘input.text’

now we can compare those 2 labels with if (randomword.text == input.text’) { NSLog: @’these words are the same’ };

What I want to do is to seperate every letter in random.text: so have label1 say G, label2 say A, label3 say R, label4 say A, label5 say G, label6 say E.

If I separate my input.text in the same way like I did above with random.text I got another 6 UILabel for example have this one separated in label7,8,9,10,11,12. Now I can compare label 1 to label 7, label 2 to 8. etc That way I can see if Letters are on the place they should be even if the entire word do not equal each other.

  • 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-02T16:51:09+00:00Added an answer on June 2, 2026 at 4:51 pm

    Still confused by all that stuff about labels. I don’t think your question has anything to do with labels, but with comparing strings or parts of them. So if you wan’t to check if to strings are equal use

    [aString isEqualToString:anotherString]; (not ==).

    If you want to extract a letter from a string use

    [aString characterAtIndex:i]; or [aString substringWithRange:NSMakeRange(i, i+1)] .

    If you want to check if a letter is on a certain position (say i) in a string use:

    NSString *aLetter;
    [[aString substringWithRange:NSMakeRange(i, i+1)] isEqualToString:aLetter];
    

    or

    unichar aLetter;
    [aString characterAtIndex:i] == aLetter;
    

    If you want to get ‘what’s shown on a UILabel‘ as NSString use aLabel.text .

    Hope that helps.

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

Sidebar

Related Questions

I have a UILabel with right-aligned text that may vary from between three to
I have a label of length 100. This is the maximum label size i
I have a UILabel with space for two lines of text. Sometimes, when the
I have a UILabel that displays some chars. Like x, y or rpm. How
I have added a UILabel to my view programmatically like this: myLabel = [[UILabel
I have an application that has a UILabel displaying the current date and time,
i have a problem, i want set text of a UILabel or UItextView or
I have IBOutlet UILabel *label; and I want to do this UILabel *label =
I would expect this code to produce the label test 5 times however it
I have an UILabel that I want to contain a preview of a long

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.