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

美国高防云服务器 1核 1G 10M 38元/月 百纵科技

百纵科技:美国云服务器活动重磅来袭,洛杉矶C3机房 带金盾高防,会员后台可自助管理防火墙,添加黑白名单 CC策略开启低中高.CPU全系列E52680v3 DDR4内存 三星固态盘列阵。另有高防清洗!百纵科技官网:https://www.baizon.cn/联系QQ:3005827206美国洛杉矶 CN2 云服务器CPU内存带宽数据盘防御价格活动活动地址1核1G10M10G10G38/月续费同价点击...

特网云(1050元),IP数5 个可用 IP (/29) ,美国高防御服务器 无视攻击

特网云特网云为您提供高速、稳定、安全、弹性的云计算服务计算、存储、监控、安全,完善的云产品满足您的一切所需,深耕云计算领域10余年;我们拥有前沿的核心技术,始终致力于为政府机构、企业组织和个人开发者提供稳定、安全、可靠、高性价比的云计算产品与服务。官方网站:https://www.56dr.com/ 10年老品牌 值得信赖 有需要的请联系======================特网云美国高防御...

ucloud国内云服务器2元/月起;香港云服务器4元/首月;台湾云服务器3元/首月

ucloud云服务器怎么样?ucloud为了扩大云服务器市场份额,给出了超低价云服务器的促销活动,活动仍然是此前的Ucloud全球大促活动页面。目前,ucloud国内云服务器2元/月起;香港云服务器4元/首月;台湾云服务器3元/首月。相当于2-4元就可以试用国内、中国香港、中国台湾这三个地域的云服务器1个月了。ucloud全球大促仅限新用户,国内云服务器个人用户低至56元/年起,香港云服务器也仅8...

苹果手机中文网为你推荐
请务必阅读正文之后的免责条款部分adbandroid平板ipad支持ipadIOJsios8VTLHios齐鲁工业大学高水平学科建设专项重庆宽带测速重庆市电信网速测试是哪个网站或ipwindows键是哪个Windows快捷键是什么win10关闭445端口win10家庭版怎么禁用445端口
vps优惠码 备案域名出售 服务器配置技术网 国外服务器网站 表单样式 南昌服务器托管 合肥鹏博士 web服务器架设 河南移动邮件系统 泉州移动 免费mysql数据库 空间登入 国外在线代理服务器 东莞主机托管 创速 japanese50m咸熟 godaddyssl windowsserver2008r2 发证机构 此网页包含的内容将不使用安全的https 更多