persistence苹果手机中文网

苹果手机中文网  时间:2021-05-19  阅读:()
MediaComputingGroupRWTHAachenUniversityJan-PeterKrmeriPhoneApplicationProgrammingLecture09:DataPersistencehttp://hci.
rwth-aachen.
de/iphoneWinterSemester2013/2014iPhoneApplicationProgrammingProf.
JanBorchersWhatdatadowehaveondevices2HowdowepresentdatatotheuseriPhoneApplicationProgrammingProf.
JanBorchers3iPhoneApplicationProgrammingProf.
JanBorchers4iPhoneApplicationProgrammingProf.
JanBorchers5iPhoneApplicationProgrammingProf.
JanBorchers6"Documents""Settings""Shoebox"iPhoneApplicationProgrammingProf.
JanBorchersDataHandlingOverview7DocumentAppData"Settings""Shoebox"LocalNSUserDefaultsUIDocumentDatabaseSyncediCloudKey/ValueGameCenterUIDocumentwithiCloudDatabaseOnlineCommunicationwithawebserverCoreDataiPhoneApplicationProgrammingProf.
JanBorchersPreferencesandSettings8NSUserDefaultsSingletonKey/valuepairsProvidesstandardvalues(factorydefaults)SettingsBundleDescribespreferencesmanagedinsettingsSamekeysasinNSUserDefaultsiPhoneApplicationProgrammingProf.
JanBorchersPreferencesandSettings8NSUserDefaultsSingletonKey/valuepairsProvidesstandardvalues(factorydefaults)SettingsBundleDescribespreferencesmanagedinsettingsSamekeysasinNSUserDefaultsiPhoneApplicationProgrammingProf.
JanBorchersPreferencesandSettings9NSUserDefaultsApplicationiPhoneApplicationProgrammingProf.
JanBorchersDemo10iPhoneApplicationProgrammingProf.
JanBorchersDataHandlingOverview11DocumentAppData"Settings""Shoebox"LocalNSUserDefaultsUIDocumentDatabaseSyncediCloudKey/ValueGameCenterUIDocumentwithiCloudDatabaseOnlineCommunicationwithawebserveriPhoneApplicationProgrammingProf.
JanBorchersWheretoputles-(NSURL*)localDocumentsDirectoryURL{staticNSURL*localDocumentsDirectoryURL=nil;if(localDocumentsDirectoryURL==nil){//usesystemfunctionNSString*documentsDirectoryPath=[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES)objectAtIndex:0];localDocumentsDirectoryURL=[NSURLfileURLWithPath:documentsDirectoryPath];}returnlocalDocumentsDirectoryURL;}12iPhoneApplicationProgrammingProf.
JanBorchersUIDocument13HighlevelAPIforleaccessAlwaysrepresentsauserdocumentCanhandlelepackagesAutosavingUndoHandlesremotechangesfromiCloudUIManagedDocumentforCoreDataiPhoneApplicationProgrammingProf.
JanBorchersCreatinganewdocument//creatinganewdocumentself.
document=[[UIDocumentalloc]initWithFileURL:fileURL];//documentcreatedinmemory[self.
documentsaveToURL:self.
document.
fileURLforSaveOperation:UIDocumentSaveForCreatingcompletionHandler:^(BOOLsuccess){//filecreatedondiskif(success)[selfdisplayFileContents];}];14//UIDocument-(id)initWithFileURL:(NSURL*)url{self=[superinitWithFileURL:url];if(self)self.
textcontents=@"Helloworld!
";returnself;}iPhoneApplicationProgrammingProf.
JanBorchersSavingaUIDocument//ReturnNSDatarepresentationforsaving-(id)contentsForType:(NSString*)typeNameerror:(NSError**)outError{NSData*data=[self.
contentsdataUsingEncoding:NSUTF8StringEncoding];returndata;}15getssavedwhenleisclosedorautosavedwhenchangesarependingNSUndoManagerorcallupdateChangeCount:iPhoneApplicationProgrammingProf.
JanBorchersDataHandlingOverview16DocumentAppData"Settings""Shoebox"LocalNSUserDefaultsUIDocumentDatabaseSyncediCloudKey/ValueGameCenterUIDocumentwithiCloudDatabaseOnlineCommunicationwithawebserveriPhoneApplicationProgrammingProf.
JanBorchersSQLite17iPhoneApplicationProgrammingProf.
JanBorchersDataHandlingOverview18DocumentAppData"Settings""Shoebox"LocalNSUserDefaultsUIDocumentDatabaseSyncediCloudKey/ValueGameCenterUIDocumentwithiCloudDatabaseOnlineCommunicationwithawebserverCoreDataiPhoneApplicationProgrammingProf.
JanBorchersCoreData19iPhoneApplicationProgrammingProf.
JanBorchersCoreData20HighlevelrelationaldatastorageAutomaticpersistenceHighperformanceaccessGetundo/redoforfreeAvailabledatastoresMemoryBinaryleSQLiteiPhoneApplicationProgrammingProf.
JanBorchersCoreDataStack21CoreDataStackhoneApplicationProgrammingProf.
JanBorchersYourControllerUIApplicationDelegateNSManagedObjectContextNSManagedObjectNSPersistentStoreCoordinatorNSPersistentStoreNSManagedObjectModelNSEntityDescriptionYourModelObjectiPhoneApplicationProgrammingProf.
JanBorchersCustomModelClass//Recipe.
h@interfaceRecipe:NSManagedObject{}@property(retain)NSString*title;//Recipe.
m#import"Recipe.
h"@implementationRecipe@dynamictitle;@end24iPhoneApplicationProgrammingProf.
JanBorchersCreating/DeletingManagedCreate(Insert)NSManagedObjectContextEntityname[NSEntityDescriptioninsertNewObjectForEntityForName:[entityname]inManagedObjectContext:context]DeleteNSManagedObjectContextNSManagedObject[contextdeleteObject:managedObject];Savecontexttomakechangepersistent25iPhoneApplicationProgrammingProf.
JanBorchersRetrievingManagedObjectsNSFetchRequestEntity:NSEntityDescriptionSortingcriteria:NSSortDescriptorsSearchcriteria:NSPredicateNSFetchedResultsControllerTailoredtoprovidedataforUITableViewsRequires:NSFetchRequest,NSManagedObjectContextChangetrackingviadelegate26iPhoneApplicationProgrammingProf.
JanBorchersFetchData//SetupthefetchrequestNSFetchRequest*request=[[NSFetchRequestfetchRequestWithEntityName:@"Recipe"];//ConfigurethefetchrequestNSSortDescriptor*sortDescriptor=[NSSortDescriptorsortDescriptorWithKey:@"creationDate"ascending:NO];[requestsetSortDescriptors:@[sortDescriptor]];//ExecutetherequestNSError*error=nil;NSArray*fetchResults;fetchResults=[managedObjectContextexecuteFetchRequest:requesterror:&error];if(error){//Handletheerror.
}27iPhoneApplicationProgrammingProf.
JanBorchersUndoManager//attachundomanagerundoManager=[[NSUndoManageralloc]init];[self.
managedObjectContextsetUndoManager:undoManager];//performundo[self.
managedObjectContextundo];28iPhoneApplicationProgrammingProf.
JanBorchersDemo29iPhoneApplicationProgrammingProf.
JanBorchersPerformance30[requestsetPropertiesToFetch:@[@"name"]];[requestsetPropertiesToGroupBy:@[@"major"]];UsebatchfetchesJustfetchneededvaluesUsepredicatestolterresultsUseSQLiteforcalculationsUseSQLDebuggingiPhoneApplicationProgrammingProf.
JanBorchersPerformance30request.
predicate=[NSPredicatepredicateWithFormat:@"age>%@ANDname==%i",name,age];UsebatchfetchesJustfetchneededvaluesUsepredicatestolterresultsUseSQLiteforcalculationsUseSQLDebuggingTextcomparisonisexpensiveNumericcomparisonischeapiPhoneApplicationProgrammingProf.
JanBorchersPerformance30NSExpressionDescription*ed=[[NSExpressionDescriptionalloc]init];ed.
name=@"minimum";ed.
expression=[NSExpressionexpressionForFunction:@"min:"arguments:@[[NSExpressionexpressionForKeyPath:@"grade"]]];[requestsetPropertiesToFetch:@[ed]];UsebatchfetchesJustfetchneededvaluesUsepredicatestolterresultsUseSQLiteforcalculationsUseSQLDebuggingiPhoneApplicationProgrammingProf.
JanBorchersPerformance30UsebatchfetchesJustfetchneededvaluesUsepredicatestolterresultsUseSQLiteforcalculationsUseSQLDebugging-com.
apple.
CoreData.
SQLDebug1iPhoneApplicationProgrammingProf.
JanBorchersConcurrency31MainQueueContextMainQueueContextPrivateQueueContextPrivateQueueContextPersistentStoreCoordinatoriPhoneApplicationProgrammingProf.
JanBorchersConcurrency31MainQueueContextMainQueueContextPrivateQueueContextPrivateQueueContextPersistentStoreCoordinatoriPhoneApplicationProgrammingProf.
JanBorchersConcurrency31MainQueueContextMainQueueContextPrivateQueueContextPrivateQueueContextPersistentStoreCoordinatorSaveiPhoneApplicationProgrammingProf.
JanBorchersConcurrency31MainQueueContextMainQueueContextPrivateQueueContextPrivateQueueContextPersistentStoreCoordinatorSaveiPhoneApplicationProgrammingProf.
JanBorchersConcurrency31MainQueueContextMainQueueContextPrivateQueueContextPrivateQueueContextPersistentStoreCoordinatoriPhoneApplicationProgrammingProf.
JanBorchersSaveConcurrency31MainQueueContextMainQueueContextPrivateQueueContextPrivateQueueContextPersistentStoreCoordinatorriPhoneApplicationProgrammingProf.
JanBorchersConcurrency32MainQueueContextMainQueueContextPrivateQueueContextPrivateQueueContextPersistentStoreCoordinatoriPhoneApplicationProgrammingProf.
JanBorchersConcurrency32MainQueueContextMainQueueContextPrivateQueueContextPrivateQueueContextPersistentStoreCoordinatorFetchriPhoneApplicationProgrammingProf.
JanBorchersDataHandlingOverview33DocumentAppData"Settings""Shoebox"LocalNSUserDefaultsUIDocumentDatabaseSyncediCloudKey/ValueGameCenterUIDocumentwithiCloudDatabaseOnlineCommunicationwithawebserveriPhoneApplicationProgrammingProf.
JanBorchersiCloud34iPhoneApplicationProgrammingProf.
JanBorchersiCloudBasicsChangesononedeviceareautomaticallypushedtootherdevicesUsercanpickupanydeviceandwillalwayshaveaccesstoherdataSyncisperappandperuserFreesubscriptionis5GBsharedamongallapps35iPhoneApplicationProgrammingProf.
JanBorchersiCloudAPIsSettings:useNSUbiquitousKeyValueStore(similarlytoNSUserDefaults)1MBlimitationSyncswithinminutesLastvaluealwayswinsDocuments:UIDocumentonaURLinaspecialfolderNolimitSyncswithinsecondsCanmergeconictingles36NSUbiquitousKeyValueStorApplicationUIDocumentiPhoneApplicationProgrammingProf.
JanBorchersDataHandlingOverview37DocumentAppData"Settings""Shoebox"LocalNSUserDefaultsUIDocumentDatabaseSyncediCloudKey/ValueGameCenterUIDocumentwithiCloudDatabaseOnlineCommunicationwithawebserveriPhoneApplicationProgrammingProf.
JanBorchersDatabaseDatabaseDatabaseDatabaseDatabaseDatabaseDatabaseRemote(Web)Objects38iPhoneApplicationProgrammingProf.
JanBorchersWebBackendServerXMLHTTPJSONRemote(Web)Objects39iPhoneApplicationProgrammingProf.
JanBorchersRepresentationalStateTransfer(REST)ResourcemanipulationviaHTTPoperationsURLdescribesresourceDataencodedinXMLorJSONGET,PUT,POST,DELETEoperationsareusedtomanipulateresources40http://my.
server.
com/person/127.
xmlServerAddressResourceNameResourceIdFormatiPhoneApplicationProgrammingProf.
JanBorchersiPhoneHTTPRequests//createrequestNSURL*url=[NSURLURLWithString:@"http://server/people.
xml"];request=[[NSMutableURLRequestalloc]initWithURL:url];//settheHTTPoperation[requestsetHTTPMethod:@"POST"];//setthepostdataNSData*postData=[@"id=1&person[name]=Paul"dataUsingEncoding:NSUTF8StringEncoding];[requestsetHTTPBody:postData];//firetherequestconnection=[NSURLConnectionconnectionWithRequest:requestdelegate:self];[connectionstart];41iPhoneApplicationProgrammingProf.
JanBorchersBasicDataNSDataNSXMLParserNSJSONSerializationNSURLConnectionWebBackendServerRemote(Web)Objects42iPhoneApplicationProgrammingProf.
JanBorchersRestKitBasics43RestKitknowsRESTfulWebservicesCaninteractwithCoreDataKeyparadigm:MappingresponsefromthewebtoObjective-CobjectsiPhoneApplicationProgrammingProf.
JanBorchersRestKitStructure44ObjectManagerManagedObjectStoreResponseEntity/ObjectMappingRequestDescriptoriPhoneApplicationProgrammingProf.
JanBorchersDemo45iPhoneApplicationProgrammingProf.
JanBorchersDataHandlingOverview46DocumentAppData"Settings""Shoebox"LocalNSUserDefaultsUIDocumentDatabaseSyncediCloudKey/ValueGameCenterUIDocumentwithiCloudDatabaseOnlineCommunicationwithawebserverCoreDataiPhoneApplicationProgrammingProf.
JanBorchersMoreInformationSQLiteOnlineDocumentationAppleGuidesArchivesandSerializationProgrammingGuideCoreDataProgrammingGuideDocument-BasedApplicationProgrammingGuideURLLoadingSystemProgrammingGuiderestkit.
orggithub.
com/lichtschlag/iCloudPlaygroundgithub.
com/lichtschlag/Chronos47iPhoneApplicationProgrammingProf.
JanBorchersEpilogue:Sharingdatalocally48Howtogetdatafromapptoapp"Openwith.
.
.
"UIDocumentInteractionControllerAppspublishwhatlestheycanopenSenderapppushesdocument,userselectstargetappDataiscopiedbetweenappsandboxesNowaytotracklesiPhoneApplicationProgrammingProf.
JanBorchersUIDocumentInteractionController-(IBAction)openExternally:(id)sender{//savefirst[self.
documentsaveToURL:self.
document.
fileURLforSaveOperation:UIDocumentSaveForOverwritingcompletionHandler:^(BOOLsuccess){//bringupdialogfromdocinteractioncontrollerself.
docController=[UIDocumentInteractionControllerinteractionControllerWithURL:self.
document.
fileURL];BOOLdidOpen=[docControllerpresentOpenInMenuFromRect:CGRectZeroinView:self.
openButtonanimated:YES];if(!
didOpen){[[[UIAlertViewalloc]initWithTitle:@"Cannotopenfileinotherapps"message:@"Unfortunately,thereisnoappinstalledthatcanhandlethiskindoffile.
"delegate:nilcancelButtonTitle:@"Ok"otherButtonTitles:nil]show];}}];}49iPhoneApplicationProgrammingProf.
JanBorchersChecktheiCloudPlaygrounddemocodeformoreinfoUIDocumentControllerinAction50

Digital-vm80美元,1-10Gbps带宽日本/新加坡独立服务器

Digital-vm是一家成立于2019年的国外主机商,商家提供VPS和独立服务器租用业务,其中VPS基于KVM架构,提供1-10Gbps带宽,数据中心可选包括美国洛杉矶、日本、新加坡、挪威、西班牙、丹麦、荷兰、英国等8个地区机房;除了VPS主机外,商家还提供日本、新加坡独立服务器,同样可选1-10Gbps带宽,最低每月仅80美元起。下面列出两款独立服务器配置信息。配置一 $80/月CPU:E3-...

易探云香港vps主机价格多少钱?香港云服务器主机租用价格

易探云香港vps主机价格多少钱?香港vps主机租用费用大体上是由配置决定的,我们选择香港vps主机租用最大的优势是免备案vps。但是,每家服务商的机房、配置、定价也不同。我们以最基础配置为标准,综合比对各大香港vps主机供应商的价格,即可选到高性能、价格适中的香港vps主机。通常1核CPU、1G内存、2Mbps独享带宽,价格在30元-120元/月。不过,易探云香港vps主机推出四个机房的优惠活动,...

亚州云-美国Care云服务器,618大带宽美国Care年付云活动服务器,采用KVM架构,支持3天免费无理由退款!

官方网站:点击访问亚州云活动官网活动方案:地区:美国CERA(联通)CPU:1核(可加)内存:1G(可加)硬盘:40G系统盘+20G数据盘架构:KVM流量:无限制带宽:100Mbps(可加)IPv4:1个价格:¥128/年(年付为4折)购买:直达订购链接测试IP:45.145.7.3Tips:不满意三天无理由退回充值账户!地区:枣庄电信高防防御:100GCPU:8核(可加)内存:4G(可加)硬盘:...

苹果手机中文网为你推荐
输入搜狗拼音输入法4xp如何关闭445端口请大家帮帮忙,怎样关闭135和445端口?win7关闭445端口如何快速关闭445端口ipad如何上网苹果ipad无线上网卡怎么设置?ipad连不上wifiiPad mini WiFi开关成灰色无法连接,怎么办勒索病毒win7补丁为了防勒索病毒,装了kb4012212补丁,但出现关机蓝屏的问题了,开机正常iphone连不上wifi苹果手机无法连接wifi是什么原因itunes备份怎么使用iTunes备份tcpip上的netbios怎么启用TCP/IP上的NetBIOS用itunes备份如何使用itunes完整备份iPhone资料
域名中介 电信服务器租赁 河南vps westhost Vultr googleapps 流媒体服务器 godaddy续费优惠码 双12活动 申请空间 美国十次啦服务器 权嘉云 nerds metalink 服务器监测 如何注册阿里云邮箱 爱奇艺会员免费试用 申请网页 国外视频网站有哪些 东莞idc 更多