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

丽萨主机122元/每季,原生IP,CN2 GIA网络

萨主机(lisahost)新上了美国cn2 gia国际精品网络 – 精品线路,支持解锁美区Netflix所有资源,HULU, DISNEY, StartZ, HBO MAX,ESPN, Amazon Prime Video等,同时支持Tiktok。套餐原价基础上加价20元可更换23段美国原生ip。支持Tiktok。成功下单后,在线充值相应差价,提交工单更换美国原生IP。!!!注意是加价20换原生I...

提速啦(24元/月)河南BGP云服务器活动 买一年送一年4核 4G 5M

提速啦的来历提速啦是 网站 本着“良心 便宜 稳定”的初衷 为小白用户避免被坑 由赣州王成璟网络科技有限公司旗下赣州提速啦网络科技有限公司运营 投资1000万人民币 在美国Cera 香港CTG 香港Cera 国内 杭州 宿迁 浙江 赣州 南昌 大连 辽宁 扬州 等地区建立数据中心 正规持有IDC ISP CDN 云牌照 公司。公司购买产品支持3天内退款 超过3天步退款政策。提速啦的市场定位提速啦主...

TmhHost暑假活动:高端线路VPS季付8折优惠,可选洛杉矶CN2 GIA/日本软银/香港三网CN2 GIA/韩国双向CN2等

tmhhost怎么样?tmhhost正在搞暑假大促销活动,全部是高端线路VPS,现在直接季付8折优惠,活动截止时间是8月31日。可选机房及线路有美国洛杉矶cn2 gia+200G高防、洛杉矶三网CN2 GIA、洛杉矶CERA机房CN2 GIA,日本软银(100M带宽)、香港BGP直连200M带宽、香港三网CN2 GIA、韩国双向CN2。点击进入:tmhhost官方网站地址tmhhost优惠码:Tm...

苹果手机中文网为你推荐
Max163usergooglexp如何关闭445端口系统怎么关闭445端口重庆宽带测速重庆电信测速我的网速溢出iphone连不上wifi苹果8p连接不了WiFims17-010win10蒙林北冬虫夏草酒·10年原浆1*6 500ml 176,176是一瓶的价格还是一箱的价格联通版iphone4s苹果4S移动版和联通版有什么不同360chromechrome是什么文件夹?是360急速浏览器吗?但是怎么没有卸载掉?chromeframe谷歌浏览器(Chrome) 与(Chromium) 有什么区别?哪个更快?css选择器css有哪些选择器
vps论坛 香港ufo 搬瓦工官网 海外服务器 好看的桌面背景图片 网站实时监控 镇江联通宽带 dux 建立邮箱 100m空间 699美元 免费cdn 韩国代理ip 论坛主机 godaddy空间 北京主机托管 新疆服务器 google搜索打不开 wannacry勒索病毒 压力测试工具 更多