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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:51:00+00:00 2026-05-24T08:51:00+00:00

I have trouble by doing a sort of concatenation; I receive 4 different datas

  • 0

I have trouble by doing a sort of concatenation;

I receive 4 different datas that I get with “[dico objectForKey:@”alertSerie”]” (for example).
The datas must be shown with a String that introduce datas on the screen.
I have to put those datas in one UITextField.

Example :

[dico objectForKey:@"alertfriend"] = Beth
[dico objectForKey:@"alertmom"] = Lise
[dico objectForKey:@"alertgirlf"] = Angela


text for Beth will be "This is my friend :"
text for Lise will be "This is my mom :"
text for Angela will be "This is my girlfriend :"

and in the UITextField, I want to show:

This is my friend :Beth
This is my mom : Lise
This is my girlfriend : Angela

Until now it’s OK, the code looks like :

field.text = [NSString stringWithFormat:@"NThis is my friend : %@\nTHis is my mom : %@\nThis is my girlfriend : %@\n",[dico objectForKey:@"alertfriend"], [dico objectForKey:@"alertmom"], [dico objectForKey:@"alertgfriend"] ];

Now, it could be possible that one person have no friend or no mom or no girlfriend…

How can I do???

I tried a lot of possibilities but the fact that we cannot concatenate object isn’t usual for me and it cause me a problem in this situation…

Thanks a lot for your attention!!!

EDIT:

I tried that code but there are mistakes of ; ] or something else…

    if ([dico objectForKey:@"alertSerie"]) {
        NSString *serie = [NSString stringWithFormat:@"Numéro de série : %@\n", [dico objectForKey:@"alertSerie"] ];}
    else {
        NSString *serie = [NSString stringWithFormat:@" "] ];}

    if ([dico objectForKey:@"alertDate"]) {
        NSString *date = [NSString stringWithFormat:@"Date de mise en service : %@\n", [dico objectForKey:@"alertDate"] ];}
    else {
        NSString *date = [[NSString stringWithFormat:@" "] ];}

    if ([dico objectForKey:@"alertCli"]) {
        NSString *cli = [NSString stringWithFormat:@"Nom du client associé : %@\n", [dico objectForKey:@"alertCli"] ];}
    else {
        NSString *cli = [NSString stringWithFormat:@" "] ];}
  • 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-24T08:51:00+00:00Added an answer on May 24, 2026 at 8:51 am

    You need to check wether the person has a friend, girlfriend and mom. This means that you must use conditions. This could be done by using some simple if-statements.

    NSMutableString *text = [[NSString alloc] init];
    
    if([dico objectForKey:@"alertmom"] != nil)
    {
       [text appendFormat:@"This is my Mom: %@ \n", [dico objectForKey:@"alertmom"]];
    }
    if([dico objectForKey:@"alertfriend"]!= nil)
    {
       [text appendFormat:@"This is my friend: %@ \n", [dico objectForKey:@"alertfriend"]];
    }
    if([dico objectForKey:@"alertgirlf"] != nil)
    {
       [text appendFormat:@"This is my girlfriend: %@ \n", [dico objectForKey:@"alertgirlf"]];
    }
    
    field.text = text;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have trouble doing this... You may want to get the same result as
I am having trouble doing something that is probably pretty simple! I have a
I'm having some trouble doing a very simple task. I have a rich textbox
I am having trouble doing a reverse URL lookup for Django-generated feeds. I have
I have trouble accessing filestream via SqlFileStream. Sql server and IIS7 are on different
I am having trouble with a template that has to check 3 different nodes
I am trying to create a 'sort by status' function that shows, for example
So I have an app where I'm implementing a universal tool bar that sort
I have trouble figuring out why a simple division like this one always returns
We have trouble implementing a nice session mechanism in JSP. One of our requirement

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.