iOS开发--1【Objective-C】
2016-02-09 19:18
525 查看
1、IBAction vs. IBOutlet
2、View Controller
3、iOS9中关于alert的改变
4、Portrait vs. Landscape
5、Slider
修改slider默认样式:
slider.value【UISlider】
6、取整【%d】
7、Local variables vs. instance variables
8、Properties vs. instance variables
9、Generate the random number
10、iOS9 Storyboard Segue
返回上一页:
11、webView,加载htmlFile
12、CATransition【Core Animation】
13、自动布局
屏幕适配:pin–>constraints
永远居中: Align
多元素自动布局: 选中一部分elements–>Editor–>View
之后把view的background color变为clear
用于storyboard或xib的连接。 Not used by the compiler, they are used by Interface Builder. -- use these keywords to parse out the outlets or actions. Interface Builder: can only see methods that are prefaced with IBAction and see variables and properties that are prefaced with IBOutlet. these variables and methods aren't deal with entirely in code, we need to delve into the relevant nib file to see how things are hooked up and used. (weak, nonatomic)
2、View Controller
- job: to manage a single screen from your app. each screen in your app gets its own view controller. - .h: tells the computer what the view controller does - .m: tells the computer how it does those things
3、iOS9中关于alert的改变
4、Portrait vs. Landscape
- Device Orientation: if only landscape, go to Generate to uncheck portrait. iPhone4:320*480 iPhone5:320*568 iPhone6:375*667
5、Slider
修改slider默认样式:
slider.value【UISlider】
- (IBAction)sliderMoved:(UISlider *)slider{ NSLog(@"%f", slider.value); } slider的值是float形式
6、取整【%d】
int(): 取小数点前的整数 round(): 四舍五入取最近的整数
7、Local variables vs. instance variables
local variables: exist very breifly eg: message instance variables: lives on forever, 前面有下划线 eg: _message
8、Properties vs. instance variables
properties: "backed" by an instance variable preperty-->store its value somewhere<--an instance variable is a good place for that properties are always accessed using [self]: - this uses the property: self.slider.value = 50; 【property can be accessed by other objects that are outside of your view controller.】 - this uses the backing instance variable directly: _slider.value = 50; 【are supposed to be used only by the insides of an object, other objects aren't intended to see them or use them.】
9、Generate the random number
arc4random_uniform(N):生成N-1的随机数 一般:arc4random_uniform(N) + 1: 生成1-100随机数
10、iOS9 Storyboard Segue
- show: 把新的内容push到当前view controller stack顶部 - show detail: 把新的内容取代view controller stack顶部 - present modally: 模态展示内容 - present as popover: 在当前的view上出现一个小窗口来展示内容(如:选中文字出现 复制/翻译 的按钮)
返回上一页:
11、webView,加载htmlFile
12、CATransition【Core Animation】
13、自动布局
屏幕适配:pin–>constraints
永远居中: Align
多元素自动布局: 选中一部分elements–>Editor–>View
之后把view的background color变为clear
相关文章推荐
- 峰回路转,Firefox 浏览器即将重返 iOS 平台
- 峰回路转,Firefox 浏览器即将重返 iOS 平台
- 不可修补的 iOS 漏洞可能导致 iPhone 4s 到 iPhone X 永久越狱
- iOS 12.4 系统遭黑客破解,漏洞危及数百万用户
- 每日安全资讯:NSO,一家专业入侵 iPhone 的神秘公司
- [转][源代码]Comex公布JailbreakMe 3.0源代码
- 讲解iOS开发中基本的定位功能实现
- js判断客户端是iOS还是Android等移动终端的方法
- IOS开发环境windows化攻略
- iOS开发之路--微博“更多”页面
- 浅析iOS应用开发中线程间的通信与线程安全问题
- 检测iOS设备是否越狱的方法
- .net平台推送ios消息的实现方法
- 探讨Android与iOS,我们将何去何从?
- Android、iOS和Windows Phone中的推送技术详解
- iOS推送的那些事
- IOS 改变键盘颜色代码
- 举例详解iOS开发过程中的沙盒机制与文件
- Android和IOS的浏览器中检测是否安装某个客户端的方法