字符串不会结合-目标C [英] Strings wont combine - Objective C

查看:86
本文介绍了字符串不会结合-目标C的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Ik在.H文件中具有以下字符串,当它们收集数据时,我希望它们在应用程序的末尾合并为一个字符串.

Ik have the following strings in the .H file, and i want them to merge into one string at the end of the app when the have collected their data.

它将无法正常工作,为什么不正确,我又该如何纠正,以便将这些字符串中收集的数据合并到一个字符串中?

It wont work, why not and how must i do it correct so the data collected in these strings will be merged into one string ??

NSString *dataHML; 
NSString *dataHML2;
NSString *dataHML3;
NSString *dataHML4;
NSString *dataHML5;
NSString *dataHML6;
NSString *dataHMLtotal = *dataHML + *dataHML2 + *dataHML3 + *dataHML4 + *dataHML5 + *dataHML6;

推荐答案

NSString *dataHtmlTotal = [NSString stringWithFormat:@"%@%@%@%@%@%@", dataHtml, dataHtml2, dataHtml3, dataHtml4,dataHtml5,dataHtml6];

这篇关于字符串不会结合-目标C的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆