NSBundle简介

一个NSBundle代表一个文件夹,利用NSBundle能访问程序对应的文件夹, 利用mainBundle就可以访问软件资源包中的任何资源.

bundle中文意思是”包裹”,这些资源包含了如图像,声音,编译好的代码,nib文件(用户也会把bundle称为plug-in). 对应bundle,cocoa提供了类NSBundle.

Read More

Share Comments

UIImageView和UIButton的区别

1> 使用场合

  • UIImageView: 如果仅仅是显示图片,不需要监听图片的点击
  • UIButton: 既要显示图片,又要监听图片的点击

2> 相同:能显示图片

3> 不同点

  • UIButton能处理点击事件, UIImageView不能处理点击事件
  • UIButton既能显示图片, 又能显示文字
  • UIButton能同时显示两张图片
  • UIButton继承自UIControl, 因此默认就能处理事件
Share Comments

centos 搭建vpn (pptpvpn)

1、检查服务器是否有必要的支持。如果检查结果没有这些支持的话,是不能安装pptp的。命令:

modprobe ppp-compress-18 && echo ok

这条执行执行后,显示“ok”则表明通过。不过接下来还需要做另一个检查,输入指令:

cat /dev/net/tun

如果显示如下信息,说明通过,如果不支持,可以给vps商发ticket开通tun,大部分美国vps商都可以支持:

cat: /dev/net/tun: File descriptor in bad state

上面的两个只要一条通过,就能安装VPN(pptp)

1、准备环境

Read More

Share Comments

swift入门视频教程

这个是swift发布第二天,就收藏了的视频,一直懒得发出来,今天发出分享给来吧~

链接:http://pan.baidu.com/s/1o6jZ8Au 密码:2337

Share Comments

Xcode6中使用eclipse快捷键方法

原创文章,转载请标明作者@邢程的微博

写惯了JAVA用惯了Eclipse,换到Xcode 上写代码,没这几个快捷键感觉还真不适应。

首先找到Xcode中的自带的配置文件

/Applications/Xcode6-Beta.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/IDETextKeyBindingSet.plist

打开它(需要root权限)。

把下面这段配置放到上面提到的IDETextKeyBindingSet.plist里,放在文件的最后的这两行“

</dict>

</plist> ”之前。

Read More

Share Comments

ios 下创建,删除文件夹的方法

创建文件夹:

NSString *imageDir = [NSString stringWithFormat:@”%@/Caches/%@”, NSHomeDirectory(), dirName];

BOOL isDir = NO;

NSFileManager *fileManager = [NSFileManager defaultManager];

Read More

Share Comments

swift中文手册(完整版)

没错,请相信你的眼睛9天时间,1317个 Star,310个 Fork,超过30人参与翻译和校对工作,项目最高排名GitHub总榜第4。

Read More

Share Comments

Swift 教程、视频、资料、项目、网站 集合

Swift 介绍

Swift 介绍

来自 Apple 官方

Swift 简介 (@peng_gong)

一篇不错的中文简介

[译] Swift 首席架构师 Chris Lattner 简介(黄利民)

Swift 背后的男人,他的个人主页

Read More

Share Comments

系列教程:使用 Swift 开发 iOS 应用

Apple recently announced a pretty major change to the way iOS apps have been developed in the past, an entirely different programming language called Swift which replaces Objective-C. In my efforts to learn the new language, I’ve decided I will be posting regularly as I step through the learning process, sharing everything I find. This is the first post of many on the topic, and I hope you decide to follow along!

Read More

Share Comments

swift发布第3天,200个开源项目,学习资料大集合

里是github上使用Swift语言的开源项目列表,目测已经有200多个了!

Read More

Share Comments