V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
dopcn
V2EX  ›  iDev

stringWithFormat 性能很差,有哪些比较好的替代方案?

  •  
  •   dopcn ·
    dopcn · 2014-11-18 14:45:21 +08:00 · 3156 次点击
    这是一个创建于 3451 天前的主题,其中的信息可能已经有所发展或是发生改变。
    搜到一种sprintf的,似乎是 C++,但是用c++的方法不是意味着要改一些build setting 的东西,有没有其他简易方法?
    7 条回复    2014-11-26 21:21:12 +08:00
    expkzb
        1
    expkzb  
       2014-11-18 15:07:33 +08:00
    stringWithFormat vs sprintf ?
    chmlai
        2
    chmlai  
       2014-11-18 15:13:15 +08:00
    有多差?
    PrideChung
        3
    PrideChung  
       2014-11-18 15:13:52 +08:00
    你要处理多大的字符串?确定stringWithFormat是性能瓶颈?
    robertlyc
        4
    robertlyc  
       2014-11-18 15:17:13 +08:00
    大部分程序还没需要到拼性能的地步 尤其是拼Foundation库的性能
    dorentus
        5
    dorentus  
       2014-11-18 15:36:50 +08:00
    sprintf 是 C 的。
    dopcn
        6
    dopcn  
    OP
       2014-11-18 16:45:00 +08:00
    @chmlai 据说比较差,我自己没测
    @PrideChung 不是,这里只是问问,没计划过早优化,是上周末参加了一个分享
    jox
        7
    jox  
       2014-11-26 21:21:12 +08:00
    ಠ_ಠ ಠ_ಠ ಠ_ಠ ಠ_ಠ ಠ_ಠ
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   979 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 18:54 · PVG 02:54 · LAX 11:54 · JFK 14:54
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.