cyy:自我理解,不保证正确,但亲自试验确实可行:若用 stringByAppendingString  则需要手动在名称前加 “/”符号,而stringByAppendingPathComponent则不需要,它会自动添加

stringByAppendingPathComponent和stringByAppendingString的区别:

 NSString *imagePath = [skinPath stringByAppendingString:[NSString stringWithFormat:@"/%@",imageName]];//stringByAppendingString是在skinPath加后缀的意思
NSString *imagePath = [skinPath stringByAppendingPathComponent:imageName];//stringByAppendingPathComponent是在skinPath后面加上“/”号连接imageName让它成为完整的路径
NSLog(@"imagePath:%@",imagePath);

打印:

2013-11-27 14:44:30.052 Willing[2757:70b] imagePath:/Users/will/Library/Application Support/iPhone Simulator/7.0.3/Applications/DA5B603D-4D07-4425-B7CC-5D49232189BE/Willing.app/tabbar_home.png

最新文章

  1. Android 开发快速导引:Android程序框架【草】
  2. GenomicRangeQuery /codility/ preFix sums
  3. java抽象类与接口 详解
  4. Linux命令(1)-创建文件
  5. Android实现SharePreferences和AutoCompletedTextView
  6. android moveTaskToback 应用退到后台,类似最小化
  7. 《深入理解linux内核架构》第二章 进程管理和调度
  8. 茴香豆的第五种写法---设置ExpandableListView系统自带图标按下效果
  9. java内存模型6-final
  10. 【53】java的多线程同步剖析
  11. layout 的应用
  12. BZOJ2282 SDOI2011消防/NOIP2007树网的核(二分答案+树形dp)
  13. ML: 降维算法-LE
  14. CSS样式----css样式表和选择器(图文详解)
  15. fedora arm-linux-gcc4.4.3编译u-boot-2010.3
  16. jquery插件导出word:jquery.wordexport.js
  17. iOS 折线图、柱状图的简单实现
  18. BZOJ3834 [Poi2014]Solar Panels 【数论】
  19. 14、Java中用浮点型数据Float和Double进行精确计算时的精度问题
  20. IOS -执行时 (消息传递 )

热门文章

  1. 【BZOJ】2675: Bomb
  2. 【BZOJ】2277: [Poi2011]Strongbox
  3. [FMS]FMS流媒体服务器onStatus介绍说明
  4. Redis在windows下的安装使用
  5. Android事件处理
  6. mysql远程连接提示无法连接,报1130错误
  7. Oracle rac集群环境中的特殊问题
  8. 解决PHP下导出csv乱码小记
  9. Bootstrap css栅格 + 网页中插入代码+css表格
  10. Latex 页面样式