持久化雪花视图实例学习
生活随笔
收集整理的這篇文章主要介紹了
持久化雪花视图实例学习
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
【實(shí)例學(xué)習(xí)】
在實(shí)踐Pdf版書中P52的例子中,繼續(xù)學(xué)習(xí):
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類,聲明可編程接口,用于管理對(duì)象的可變數(shù)組。這個(gè)類在繼承NSArray類的基礎(chǔ)數(shù)組操作方法上,新增添加和修改操做。
方法:
??? 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.
??? 此類為與默認(rèn)系統(tǒng)交互提供可編程接口。默認(rèn)系統(tǒng)允許程序定制符合用戶呈現(xiàn)的的行為。
方法:
??? 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:此函數(shù)是自動(dòng)執(zhí)行,用于保存此類的修改數(shù)據(jù)。手工調(diào)用此函數(shù),一般情況都是在退出時(shí)候需要及時(shí)保存,不再等待自動(dòng)保存。
類方法:
??? standardUserDefaults:返回共享默認(rèn)對(duì)象,類型是NSUserDefaults
UIApplicationDelegate Protocol(UIApplicationDelegate協(xié)議接口)
??? The UIApplicationDelegate protocol declares methods that are implemented by the delegate of the singleton UIApplication object.
??? UIApplicationDelegate協(xié)議接口聲明單件UIApplication對(duì)象的委托函數(shù)方法。
??? 大部分都是采用默認(rèn)執(zhí)行,在實(shí)際開發(fā)中需要的畢竟是少數(shù),此例子用了applicationWillTerminate,就是說(shuō)程序中斷時(shí)觸發(fā)
羅列下:
??? 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:
最后說(shuō)明下,在測(cè)試中沒(méi)有測(cè)試出那段代碼~~也就是說(shuō)沒(méi)有找到觸發(fā)那個(gè)applicationWillTerminate的方法。
PS:再次說(shuō)明下,+類方法,-成員方法;:意味此方法帶有參數(shù)
在實(shí)踐Pdf版書中P52的例子中,繼續(xù)學(xué)習(xí):
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類,聲明可編程接口,用于管理對(duì)象的可變數(shù)組。這個(gè)類在繼承NSArray類的基礎(chǔ)數(shù)組操作方法上,新增添加和修改操做。
方法:
??? 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.
??? 此類為與默認(rèn)系統(tǒng)交互提供可編程接口。默認(rèn)系統(tǒng)允許程序定制符合用戶呈現(xiàn)的的行為。
方法:
??? 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:此函數(shù)是自動(dòng)執(zhí)行,用于保存此類的修改數(shù)據(jù)。手工調(diào)用此函數(shù),一般情況都是在退出時(shí)候需要及時(shí)保存,不再等待自動(dòng)保存。
類方法:
??? standardUserDefaults:返回共享默認(rèn)對(duì)象,類型是NSUserDefaults
UIApplicationDelegate Protocol(UIApplicationDelegate協(xié)議接口)
??? The UIApplicationDelegate protocol declares methods that are implemented by the delegate of the singleton UIApplication object.
??? UIApplicationDelegate協(xié)議接口聲明單件UIApplication對(duì)象的委托函數(shù)方法。
??? 大部分都是采用默認(rèn)執(zhí)行,在實(shí)際開發(fā)中需要的畢竟是少數(shù),此例子用了applicationWillTerminate,就是說(shuō)程序中斷時(shí)觸發(fā)
羅列下:
??? 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:
最后說(shuō)明下,在測(cè)試中沒(méi)有測(cè)試出那段代碼~~也就是說(shuō)沒(méi)有找到觸發(fā)那個(gè)applicationWillTerminate的方法。
PS:再次說(shuō)明下,+類方法,-成員方法;:意味此方法帶有參數(shù)
轉(zhuǎn)載于:https://www.cnblogs.com/GoGoagg/archive/2011/05/19/2051090.html
總結(jié)
以上是生活随笔為你收集整理的持久化雪花视图实例学习的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 如何为 Horizon View 配置
- 下一篇: java对象命名_Java编码规范(命名