如何在 iPhone 应用程序中的 mutableArray 中将三个对象添加到一个对象中?
NSMutableArray * mutableArra = [[NSMutableArray alloc] init];
[mutableArra addObjectsFromArray:myArray];
NSLog(@"=====mutable aarrya ====::%@",mutableArra);
这是前面代码的结果:
2012年12月1日
如何将这三个对象添加到一个对象中,如下所示?
2012年1月12日
预先感谢您。
NSMutableArray * mutableArra = [[NSMutableArray alloc] init];
[mutableArra addObjectsFromArray:myArray];
NSLog(@"=====mutable aarrya ====::%@",mutableArra);
This is the result from the previous code:
01,12,2012
How can I add these three objects into one like the following?
01-12-2012
Thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不确定你想如何将这些可怜的对象“添加”到彼此,但如果你希望它们作为字符串连接起来,请尝试:
I'm not sure how do you want to "add" those poor objects to one another, but if you want them to be concatenated as a string, try:
如果这是针对日期的,我建议您查看 NSDate,它会为您进行格式化。
If this is for dates, I would recommend looking into NSDate which will do the formatting for you.