【实例学习】
在实践Pdf版书中P52的例子中,继续学习:

NSMutableArray类
    The NSMutableArray class declares the programmatic interface to objects that manage a modifiable array of objects. This class adds insertion and deletion operations to the basic array-handling behavior inherited from NSArray.

NSMutableArray类,声明可编程接口,用于管理对象的可变数组。这个类在继承NSArray类的基础数组操作方法上,新增添加和修改操做。

方法:
    insertObject:atIndex:
    removeObjectAtIndex:
    addObject:
    removeObject:
    removeLastObject
    replaceObjectAtIndex:withObject:

NSUserDefaults类
    The NSUserDefaults class provides a programmatic interface for interacting with the defaults system. The defaults system allows an application to customize its behavior to match a user’s preferences. For example, you can allow users to determine what units of measurement your application displays or how often documents are automatically saved. Applications record such preferences by assigning values to a set of parameters in a user’s defaults database. The parameters are referred to as defaults since they’re commonly used to determine an application’s default state at startup or the way it acts by default.

此类为与默认系统交互提供可编程接口。默认系统允许程序定制符合用户呈现的的行为。

方法:
    Getting Default Values
    – arrayForKey:
    – boolForKey:
    – dataForKey:
    – dictionaryForKey:
    – floatForKey:
    – integerForKey:
    – objectForKey:
    – stringArrayForKey:
    – stringForKey:
    – doubleForKey:
    – URLForKey:
    Setting Default Values
    – setBool:forKey:
    – setFloat:forKey:
    – setInteger:forKey:
    – setObject:forKey:
    – setDouble:forKey:
    – setURL:forKey:
    Removing Defaults
    – removeObjectForKey:

- synchronize:此函数是自动执行,用于保存此类的修改数据。手工调用此函数,一般情况都是在退出时候需要及时保存,不再等待自动保存。

类方法:
    standardUserDefaults:返回共享默认对象,类型是NSUserDefaults

UIApplicationDelegate Protocol(UIApplicationDelegate协议接口)

The UIApplicationDelegate protocol declares methods that are implemented by the delegate of the singleton UIApplication object.
    UIApplicationDelegate协议接口声明单件UIApplication对象的委托函数方法。

大部分都是采用默认执行,在实际开发中需要的毕竟是少数,此例子用了applicationWillTerminate,就是说程序中断时触发

罗列下:
    Monitoring Application State Changes
    – application:didFinishLaunchingWithOptions:
    – applicationDidBecomeActive:
    – applicationWillResignActive:
    – applicationDidEnterBackground:
    – applicationWillEnterForeground:
    – applicationWillTerminate:
    – applicationDidFinishLaunching:
    Opening a URL Resource
    – application:handleOpenURL:
    – application:openURL:sourceApplication:annotation:
    Managing Status Bar Changes
    – application:willChangeStatusBarOrientation:duration:
    – application:didChangeStatusBarOrientation:
    – application:willChangeStatusBarFrame:
    – application:didChangeStatusBarFrame:
    Responding to System Notifications
    – applicationDidReceiveMemoryWarning:
    – applicationSignificantTimeChange:
    Handling Remote Notifications
    – application:didReceiveRemoteNotification:
    – application:didRegisterForRemoteNotificationsWithDeviceToken:
    – application:didFailToRegisterForRemoteNotificationsWithError:
    Handling Local Notifications
    – application:didReceiveLocalNotification:
    Responding to Content Protection Changes
    – applicationProtectedDataWillBecomeUnavailable:
    – applicationProtectedDataDidBecomeAvailable:

最后说明下,在测试中没有测试出那段代码~~也就是说没有找到触发那个applicationWillTerminate的方法。

PS:再次说明下,+类方法,-成员方法;:意味此方法带有参数

转载于:https://www.cnblogs.com/GoGoagg/archive/2011/05/19/2051090.html

持久化雪花视图实例学习相关推荐

  1. android桌面雪花效果代码,Android营造雪花和雨滴浪漫效果

    本文在实现雪花效果的基础上,根据漫天飞舞雪花,实现下雨天场景的效果,使用eclipse android 版本,具体内容如下 雪花效果图: 具体代码: 1.漫天飞舞的雪花主要代码 SnowView pa ...

  2. android 实现漫天飞舞雪花以及下雨天的效果

    前言: 这个效果实现的原作者是国外一位大神.我在其基础上测试,以及在代码上加了不少注释,以及局部修改.后面我有根据漫天飞舞雪花,实现下雨天场景的效果.原作者项目还是android studio版本的. ...

  3. object-ui之动画雪花降落实现

    1.首先设置一下落雪的背景 //创建落雪UIImageView *bgView = [[UIImageView alloc]initWithFrame:[UIScreen mainScreen].bo ...

  4. MySQL 学习笔记-第三篇-索引、存储过程和函数、视图、触发器

    目录 1 索引 1.1 索引简介 1.2 创建索引 1.3 删除索引 1.4 MySQL 8.0 的新特性 1 -支持降序索引 1.5 MySQL 8.0 的新特性 2 -统计直方图 2 存储过程和函 ...

  5. 【JavaScript】阶段性复习

    [JavaScript]阶段性复习 View / MVVM 框架 对比 React .Angular 和 Vue 相同点 不同点 如何实现一个组件,前端组件的设计原则是什么? Vue computed ...

  6. Java Web 三大框架开发资料

    Spring MVC Controller配置方式 Spring MVC 中,配置Controller时使用的是URL对应Bean的方式. 在SpringMVC中,对于Controller的配置方式有 ...

  7. Spring MVC 入门示例讲解

    在本例中,我们将使用Spring MVC框架构建一个入门级web应用程序.Spring MVC 是Spring框架最重要的的模块之一.它以强大的Spring IoC容器为基础,并充分利用容器的特性来简 ...

  8. Spring MVC 完整示例

    在本例中,我们将使用Spring MVC框架构建一个入门级web应用程序.Spring MVC 是Spring框架最重要的的模块之一.它以强大的Spring IoC容器为基础,并充分利用容器的特性来简 ...

  9. 阿里巴巴开源技术汇总:115个软件(二)

    阿里巴巴开源技术汇总:115个软件(二) 摘要: 在上一期阿里开源技术汇总(阿里巴巴开源技术汇总:115个软件)中,我们向大家介绍了一些有趣的强大的开源工具,想必大家阅读完之后还意犹未尽吧!别着急,第 ...

最新文章

  1. 小话设计模式三:发布/订阅模式
  2. python io_Python 的 io.StringIO()
  3. 在 SQLite3 中使用回调函数
  4. 聊聊Elasticsearch RestClient的RequestLogger
  5. Tensorflow 实战 Google 深度学习框架(第2版)---- 10.2.2节 P274 代码
  6. OC省字典的数组摘要集
  7. 局域网内手机访问电脑网站注意几点
  8. python 函数重载_python中有函数重载吗
  9. 命令行模式下导入导出MySQL数据库
  10. 2059 mysql
  11. 如何加声调口诀_拼音顺口溜儿歌和口诀 学拼音的重点难点详解
  12. C++扑克牌随机洗牌抽牌算法
  13. 洛谷 P2142 高精度减法
  14. 将 Keynote 演示文稿导出为 PPT 或其他文件格式
  15. 【HUE】问题汇总(持续更新)
  16. Android视频编码--H264编码
  17. 解决OpenCV读取图片慢的方案
  18. 记录一次Spark小问题的求证过程
  19. 二次型的标准型、规范型
  20. Unity 制作两个按钮分别控制两个声音组件

热门文章

  1. Python3爬虫(十一) 爬虫与反爬虫
  2. phpStudy中Xdebug设置 phpStorm设置
  3. 每个 Linux 用户都应该知道的命令行技巧
  4. 我的github地址
  5. CSUOJ 1196- Staginner 去爬山
  6. mysql 判断质数_java之判断输入的数是否为素数
  7. 中动态路径加载_GOT段在linux系统中实现代码动态加载的作用和其他段的说明
  8. java 实现 常见排序算法(四)基数排序
  9. Android 固定式底部上滑抽屉view
  10. .net 转义包含转义的字符串