NSString:plist中的换行符转义 [英] NSString: newline escape in plist

查看:228
本文介绍了NSString:plist中的换行符转义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个属性列表,该列表位于应用程序的资源包中. plist中的NSString对象需要在其中包含换行符.我尝试了\n,但这不起作用.如何在plist的字符串中包含换行符?

I'm writing a property list to be in the resources bundle of my application. An NSString object in the plist needs to have line-breaks in it. I tried \n, but that doesn't work. What do I do to have newlines in my string in the plist?

谢谢.

推荐答案

如果要在Xcode的内置plist编辑器中编辑plist,则可以按Option-return键在字符串值内输入换行符.

If you're editing the plist in Xcode's inbuild plist editor, you can press option-return to enter a line break within a string value.

这篇关于NSString:plist中的换行符转义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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