ios开发笔记

本文介绍了UIKit的基础知识,包括按钮事件添加方法、设置iPhone方向的两种方式、设备判断及路径获取等实用技巧,并分享了cocos2d-x调试方法、UITextBox用法及JSON数据解析的相关资源。
一、UIKit认识



2、button添加事件的方法
[button addTarget:self Action:@selector(changeView) forControlEvents:UIControlEventTouchUpInside]

3、设置iphone的方向
http://blog.youkuaiyun.com/cococoolwhj/article/details/8208991#

// Only valid for iOS 6+. NOT VALID for iOS 4 / 5.
-(NSUInteger)supportedInterfaceOrientations {
	
	// iPhone only
	if( [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone )
		return UIInterfaceOrientationMaskLandscape;
	
	// iPad only
	return UIInterfaceOrientationMaskLandscape;
}

// Supported orientations. Customize it for your own needs
// Only valid on iOS 4 / 5. NOT VALID for iOS 6.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
	// iPhone only
	if( [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone )
		return UIInterfaceOrientationIsLandscape(interfaceOrientation);
	
	// iPad only
	// iPhone only
	return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}

4、设置iphone的plist
(1)设置Supported interface orentations来设置设备的方向
(2)设置状态栏是否显示Stauts bar is initialy hiden

5、iphone设备的判断

http://blog.youkuaiyun.com/a6472953/article/details/8597146

6、获取iphone路径

[[NSHomeDirectory() stringByAppendingPathComponent:@"Doucuments"]stringByAppendingPathComponent:@"SuccessLevel"]
获取Documents/SuccessLevel文件
7、jos json 数据解析

http://blog.youkuaiyun.com/enuola/article/details/7903632

8、方便调试之cocos2d-x中sprite显示图片边框方法

在ccConfig.h文件中搜索CC_SPRITE_DEBUG_DRAW,将0改为1即可显示ccsprite的图片边框,方便调整和做碰撞判断的一些视觉调整

9.UITextBox用法

http://blog.youkuaiyun.com/wudidalishi/article/details/7975775

转载于:https://my.oschina.net/bugyang/blog/131356

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值