持久化雪花视图实例学习

【实例学习】
在实践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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/435059.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

ubuntu12.04samba服务器配置

系统平台:VMware Workstation9.0 ubuntu12.04 首先要解决windows和linux网络连接问题: 在VMware Workstation9.0 “设置” 选项中,设置"网络" 网络连接1 选中“启用网络连接” 方式:NAT 网络连接2 选中“启用网络连…

arcgis字段计算器利用python按不同两列数据进行编号

示例 代码 # -*- coding: utf-8 -*- A=1 B=1 C=1 A1=1 B1=1 C1=1 A2=1 B2=1 C2=1 A3=1 B3=1 C3=1 A4=1 B4=1 C4=1 def a(name,bianhao):name=name.encode(utf-8);global A,B,C,A1,B1,C1,A2,B2,C2,A3,B3,C3,A4,B4,C4if(name==老虎洞村):if(bianhao==4):end="A"+str(A…

python抽卡游戏_【python爬虫】原神公测预抽卡活动自动化抽卡脚本(一小时免登陆)...

[Python] 纯文本查看 复制代码import requestsimport jsonimport time#pyinstaller -D -i favicon.ico crawl.pyclass Crawl():#初始化cookiesdef __init__(self):self.login_ticket "";self.account_id"";self.login_uid"";self.cookie_token&…

vs2010 sp1 安装 Silverlight4_Tools 提示 错误 解决办法

vs2010 sp1 在安装 Silverlight4_Tools 时提示我未安装相应版本的 vs 解决办法: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\Setup\VS\BuildNumber 将 "2052" 的值修改为 "10.0.30319",然后安装Silverlight4Tools程序…

VMware Workstation网络连接的三种模式

经常要使用VMWare Workstation来在本地测试不同的操作系统&#xff0c;以前也搞不清楚网络连接三种模式&#xff0c;最近看了几篇文章才算明白。现总结如下&#xff1a; 1. VMware Workstation的虚拟网络组件 虚拟<网卡/网络适配器>&#xff1a;见下图。安装一个虚拟PC…

arcgis字段计算器利用python按两列要求编号

示例 代码 # -*- coding: utf-8 -*- A1 B1 C1 A11 B11 C11 A21 B21 C21 A31 B31 C31 A41 B41 C41 def a(name,bianhao):namename.encode(utf-8);global A,B,C,A1,B1,C1,A2,B2,C2,A3,B3,C3,A4,B4,C4if(namea):if(bianhao4):end"A"str(A)AA1elif(bianhao3):end"B…

python获取文件读写权限_Python 查看文件的读写权限方法

实例如下&#xff1a;# -*- coding: utf-8 -*-# author flynetcnimport sys, os, pwd, stat, datetime;LOG_FILE /var/log/checkDirPermission.log;nginxWritableDirs [/var/log/nginx,/usr/local/www/var,];otherReadableDirs [/var/log/nginx,/usr/local/www/var/log,];di…

dd , /dev/zero和/dev/null

dd 命令 功能&#xff1a;把指定的输入文件拷贝到指定的输出文件中&#xff0c;并且在拷贝过程中可以进行格式转换。可以用该命令实现 DOS 下的 diskcopy 命令的作用。先用 dd 命令把软盘上的数据写成硬盘的一个寄存文件&#xff0c;再把这个寄存文件写入第二张软盘上&#xf…

netpbm

netpbm是一款图形转换的工具。netpbm工具库格式转换命令.Netpbm是一个很好用的&#xff0c;很强大的命令方式图像处理程序&#xff0c;支持WINDOWS、LINUX及部分UNIX系统。将一幅png图像转成bmp格式。命令序列为&#xff1a;pngtopnm test.png > a.pnmppmtobmp -bpp24 a.pnm…

利用anaconda prompt打开jupyter notebook

切换盘符 到指定文件夹下 查看改文件夹下的文件夹 再其文件夹下打开jupyter notebook 或者 结果&#xff1a; 创建python3文件 编写代码&#xff08;运行代码快捷键ctrl enter​​​​​​​&#xff09;

rest接口_深度干货 | 测试REST服务接口

openEA开源社区开源&#xff0c;我们是认真的&#xff01;这里每天给大家呈现有价值的开源资讯&#xff0c;欢迎您的来稿与推荐&#xff0c;点击上方蓝色字&#xff0c;加入我们吧&#xff01;摘要&#xff1a;较新的BPM版本中&#xff0c;提供了SOAP和REST两种接口&#xff0c…

asp。net中常用的文件操作类

**文件操作类 **/ #region 引用命名空间 using System; using System.Collections.Generic; using System.Text; using System.IO; #endregionnamespace CommonUtilities { /// <summary> /// 文件操作类 /// </summary> public class FileHelper { #region 检测指…

修改linux开机画面

制作开机Logo方法一:Drivers/video/logo/logo_linux_clut224.ppm是默认的启动Logo图片&#xff0c;把自己的Logo图片&#xff08;png格式&#xff09;转换成ppm格式&#xff0c;替换这个文件&#xff0c; 同时删除logo_linux_clut224.c logo_linux_clut224.o文件 &#xff0c;重…

列表反向组成数字相加,并输出数组反向组成列表

# Definition for singly-linked list. #在节点ListNode定义中&#xff0c;定义为节点为结构变量。 #节点存储了两个变量&#xff1a;value 和 next。value 是这个节点的值&#xff0c;next 是指向下一节点的指针&#xff0c;当 next 为空指针时&#xff0c;这个节点是链表的最…

公众号jdk 获取手机号_如何获取公众号推文封面图

曾经有一张好看的图片摆在我的眼前&#xff0c;我却没能保存&#xff0c;等到失去的时候我才后悔莫及。如果上天能够给我一个再来一次的机会&#xff0c;我会对那张图片说三个字&#xff1a;我&#xff0c;要&#xff0c;你……现在大部分使用智能手机的小伙伴们&#xff0c;一…

container_of深入理解

container_of在linux头文件kernel.h中定义&#xff0c;如下&#xff1a; 14#ifndef offsetof15#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)16#endif1718#ifndef container_of19/**20 * container_of - cast a member of a structure out to the co…

正在读取软件包列表... 有错误!

正在读取软件包列表... 有错误&#xff01;E: Encountered a section with no Package: headerE: Problem with MergeList /var/lib/apt/lists/cn.archive.ubuntu.com_ubuntu_dists_natty_main_i18n_Translation-enE: 无法解析或打开软件包的列表或是状态文件。问题&#xff1a…

2021-10-19

下载的工具箱 找到下载工具箱位置 打开工具箱属性 出现错误1 无法启动配置 RasterCommander.ImageServer 解决方法

python自动控制库_Python最为神奇的库,可控制你的鼠标键盘自动运行!

Python最为神奇的库&#xff0c;可控制你的鼠标键盘自动运行&#xff01;这个库让你可以控制和监控输入设备。喜欢我还有更多干货入门知识&#xff0c;来公众号『程序员中文社区』聊聊吧。Python最为神奇的库&#xff0c;可控制你的鼠标键盘自动运行&#xff01;对于每一种输入…

iframe 自适应高度 跨域

window.navigator.Allframesnull;window.navigator.Allframes { iframe1: window }; //根据页面name属性查找到子页面所在Ifame对象 window.navigator.getFrameByNamefunction(oName){ return this.Allframes[oName] }; //将一个Iframe对象注册到window.navigator.Al…