iphone中格式化字符串的疑问
我有一个包含圣经的经文号和章节号的代码。我将此代码放入 formate Chapterno: withverseno:
中,即我们得到 1.2,这意味着 1 是章节号,2 是节号。
我的代码是:
cell.chapterAndVerse.text = [NSString stringWithFormat:@"%@.%d",delegate.selectedVerse, indexPath.row+1];
chapterAndVerse 是包含诗句和章节编号的 UILabel。
我只想在 UILabel 中显示诗句(我想要 2 而不是 1.2)。如何得到这个? 提前致谢。
I have a code that contains verse number and chapter number of the bible. I put this code to formate chapterno: withverseno:
that is we get 1.2, this means 1 is the chapter number and 2 is the verse number.
my code for this is :
cell.chapterAndVerse.text = [NSString stringWithFormat:@"%@.%d",delegate.selectedVerse, indexPath.row+1];
chapterAndVerse is the UILabel which holds the verse and chapter number.
I want only verse to display in the UILabel (I want 2 instead of 1.2). How to get this ?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这将只显示这节经文。
This will display the verse only.
你可以打电话:
但是在你的问题中有点难以理解为什么你使用indexPath,因为你似乎有章节和节数。
You could call :
But it's a little bit hard to understand in your question why you use an indexPath as you seems to have chapter and verse numbers.