如何将NSMutableArray的元素转换为NSString [英] How to convert elements of NSMutableArray to NSString

查看:833
本文介绍了如何将NSMutableArray的元素转换为NSString的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有1 NSMutableArray,我想转换数组中的任何数据将在NSString。
告诉我代码。数组只是NSMutableArray类的对象。

I have 1 NSMutableArray and I want to convert whatever data in array will be in NSString. tell me code for that. Array is nothing but object of NSMutableArray class.

推荐答案

这取决于你想如何使用那个字符串。

It depends on how do you want to use that string.

将对象转换为字符串的方法之一是调用 -description (或 -descriptionWithLocale:)。对于 NSArray (或 NSMutableArray )--description方法返回一个表示接收器内容的字符串,格式化为属性列表。您将获得的结果还取决于在数组中的对象中如何实现 -description 方法。

One way to convert an object to a string is to call -description (or -descriptionWithLocale:) on that object. For NSArray (or NSMutableArray) -description method returns a string that represents the contents of the receiver, formatted as a property list. The result you'll get will also depend on how -description method implemented in objects in array.

这篇关于如何将NSMutableArray的元素转换为NSString的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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