Beginning IOS 7 Development Exploring the IOS SDK

目前使用的是Objective-C,用这本书,简单记录一下

第一章,图书简介

第二章,简要介绍使用xcode,建一个HelloWorld工程,并添加app应用图片

第三章,讲解Outlets和Actions是什么,和一些比较细节的内容,比如

1 @interface MyViewController : UIViewController
2 {
3 UIButton *myButton;
4 }
5 @property (weak, nonatomic) UIButton *myButton;
6 @end

当Apple从GCC编译器切换到使用LLVM以后,不需要先声明UIButton *myButton 再赋属性了,因为LLVM可以自动创建

还推荐了objective-c的开发者文档

https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC

1 - (IBAction)doSomething:(id)sender;
2 - (IBAction)doSomething;
3 - (IBAction)doSomething:(id)sender forEvent:(UIEvent*)event;

可以通过sender参数,得知是谁被点击

最后一个 - (IBAction)doSomething:(id)sender forEvent:(UIEvent*)event;没有什么用

书中的实例 Button Fun:

 1 - (IBAction)buttonPressed:(UIButton *)sender {
2 NSString *title = [sender titleForState:UIControlStateNormal];
3 NSString *plainText = [NSString stringWithFormat:@"%@ button pressed.", title];
4 // _statusLabel.text = plainText;
5 NSMutableAttributedString *styledText = [[NSMutableAttributedString alloc]
6 initWithString:plainText];
7 NSDictionary *attributes =
8 @{
9 NSFontAttributeName : [UIFont boldSystemFontOfSize:_statusLabel.font.pointSize]
10 };
11
12 NSRange nameRange = [plainText rangeOfString:title];
13
14 [styledText setAttributes:attributes range:nameRange];
15 _statusLabel.attributedText = styledText;
16 }

基本上,第三章的内容概括来说,把ARC,内存管理这些想要了解的内容都推给了开发者官方文档

http://developer.apple.com/library/ios/#releasenotes/ObjectiveC/RN-TransitioningToARC/

http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/MemoryMgmt/

最后面,

Looking at the Application Delegate

 1 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
2 // Override point for customization after application launch.
3 return YES;
4 }
5
6 - (void)applicationWillResignActive:(UIApplication *)application {
7 // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
8 // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
9 }
10
11 - (void)applicationDidEnterBackground:(UIApplication *)application {
12 // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
13 // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
14 }
15
16 - (void)applicationWillEnterForeground:(UIApplication *)application {
17 // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
18 }
19
20 - (void)applicationDidBecomeActive:(UIApplication *)application {
21 // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
22 }
23
24 - (void)applicationWillTerminate:(UIApplication *)application {
25 // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
26 }

不描述了,可以加断点调试一下

Beginning IOS 7 Development Exploring the IOS SDK - Handling Basic Interface Fun的更多相关文章

  1. 翻译Beginning iOS 7 Development中文版

    不会iOS开发好像真的说只是去,来本中文版的Beginning iOS 7 Development吧. 看了Beginning iOS 7 Development这本书,感觉蛮不错的.全英文的,没有中 ...

  2. 李洪强iOS开发之-环信02_iOS SDK 介绍及导入

    李洪强iOS开发之-环信02_iOS SDK 介绍及导入 iOS SDK 介绍及导入 iOS SDK 介绍 环信 SDK 为用户开发 IM 相关的应用提供的一套完善的开发框架.包括以下几个部分: SD ...

  3. 李洪强iOS开发之-环信01_iOS SDK 前的准备工作

    李洪强iOS开发之-环信01_iOS SDK 前的准备工作 1.1_注册环信开发者账号并创建后台应用 详细步骤:  注册并创建应用 注册环信开发者账号 第 1 步:在环信官网上点击“即时通讯云”,并点 ...

  4. 《转》iOS 平台 Cocos2d-x 项目接入新浪微博 SDK 的坑

    最近在做一个 iOS 的 cocos2d-x 项目接入新浪微博 SDK 的时候被“坑”了,最后终于顺利的解决了.发现网上也有不少人遇到一样的问题,但是能找到的数量有限的解决办法写得都不详细,很难让人理 ...

  5. iOS Swift WisdomScanKit图片浏览器功能SDK

    iOS Swift WisdomScanKit图片浏览器功能SDK使用 一:简介      WisdomScanKit 由 Swift4.2版编写,完全兼容OC项目调用. WisdomScanKit的 ...

  6. iOS Swift WisdomKeyboardKing 键盘智能管家SDK

    iOS Swift WisdomKeyboardKing 键盘智能管家SDK [1]前言:    今天给大家推荐个好用的开源框架:WisdomKeyboardKing,方面iOS日常开发,优点和功能请 ...

  7. iOS Mobile Development: Using Xcode Targets to Reuse the Code 使用xcode targets来实现代码复用

    In the context of iOS mobile app development, a clone is simply an app that is based off another mob ...

  8. [Xamarin.iOS] Visual Studio中Xamarin.iOS项目,无法加入PCL项目参考、NuGet组件参考

    [Xamarin.iOS] Visual Studio中Xamarin.iOS项目,无法加入PCL项目参考.NuGet组件参考 解决方案 目前Visual Studio中最新版本的Xamarin.iO ...

  9. iOS 7 教程:定制iOS 7中的导航栏和状态栏

    目录(?)[-] iOS 7中默认的导航栏 设置导航栏的背景颜色 在导航栏中使用背景图片 定制返回按钮的颜 修改导航栏标题的字体 修改导航栏标题为图片 添加多个按钮 修改状态栏的风格 隐藏状态栏 总结 ...

  10. ios开发之OC基础-ios开发学习路线图

    本系列的文章主要来自于个人在学习前锋教育-欧阳坚老师的iOS开发教程之OC语言教学视频所做的笔记,边看视频,边记录课程知识点.建议大家先过一遍视频,在看视频的过程中记录知识点关键字,把把握重点,然后再 ...

随机推荐

  1. Dev Express 框架自定义登录添加短信验证功能

    需求:登录界面改成这样 记录一下过程,以便下次操作类似的步骤有遗忘,也与大伙儿分享下,如有不当之处请指出,感谢. 参考官网文档:https://docs.devexpress.com/eXpressA ...

  2. I2C接口(续一)

    I2C接口共涉及到18个寄存器,下面就来对它们进行具体分析. 先来看I2C配置寄存器CFG,下表是它的全部位结构,其地址分别为0x40050000(I2C0),0x40054000(I2C1),0x4 ...

  3. freeRTOS移植成功

    今天来学习如何移植freeRTOS 也算是走了很多的坑,总算是把系统跑起来了 相关的教程网上也有比较详细的,本文主要说说自己踩的坑 一些汇编文件报错的问题 这个问题的原因是因为网上大部分的移植说明都是 ...

  4. java正则匹配字符串最外层{}里的内容,包含{}

    String s = "start {sffff''{adfaw3ea}wfewrfwef----}";String regex = "(?<=\\{).*(?=\ ...

  5. jQuery-强大的jQuery选择器 (详解)

    jq除常用的选择写法之外的更多方法记录. 原文:jQuery-强大的jQuery选择器 (详解)[转] 1. 基础选择器 Basics 名称 说明 举例 #id 根据元素Id选择 $("di ...

  6. jar包下不下来

    1.maven中的settings.xml文件中的镜像资源配置 <mirror> <id>alimaven</id> <name>aliyun mave ...

  7. k8s 1.20.5(补充)

    1.根据前面1.15.0补充 2.初始化操作 selinux swap firewall关闭防火墙 swapoff -a 禁用交换空间 vim /etc/sysctl.d/k8s.conf net.b ...

  8. Burpsuite 资料整理

    Burpsuite 资料整理, 整到一起比较方便.大家有更多关于Burpsuite的Tip请一起增量.谢谢! 插件 序号 名称 功能 参考文档 1 Turbo intruder 并发 https:// ...

  9. Kubernetes--Pod节点选择器nodeSelector(标签)

    Pod节点选择器是标签及标签选择器的一种应用,它能够让Pod对象基于集群中工作节点的标签来挑选倾向运行的目标节点. Kubernetes的kube-scheduler守护进程负责在各工作节点中基于系统 ...

  10. JQuery 的$.each取值

    原文:https://www.cnblogs.com/zhaixr/p/7069857.html 1.遍历一维数组 var arr1=['aa','bb','cc','dd']; $.each(arr ...