久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    • <bdo id='dP20Z'></bdo><ul id='dP20Z'></ul>
    <i id='dP20Z'><tr id='dP20Z'><dt id='dP20Z'><q id='dP20Z'><span id='dP20Z'><b id='dP20Z'><form id='dP20Z'><ins id='dP20Z'></ins><ul id='dP20Z'></ul><sub id='dP20Z'></sub></form><legend id='dP20Z'></legend><bdo id='dP20Z'><pre id='dP20Z'><center id='dP20Z'></center></pre></bdo></b><th id='dP20Z'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='dP20Z'><tfoot id='dP20Z'></tfoot><dl id='dP20Z'><fieldset id='dP20Z'></fieldset></dl></div>
    <legend id='dP20Z'><style id='dP20Z'><dir id='dP20Z'><q id='dP20Z'></q></dir></style></legend>

    <tfoot id='dP20Z'></tfoot>

      <small id='dP20Z'></small><noframes id='dP20Z'>

    1. Core Data 什么時候刷新到磁盤?

      When does Core Data flush to disk?(Core Data 什么時候刷新到磁盤?)
      • <bdo id='K3kRu'></bdo><ul id='K3kRu'></ul>
              <tbody id='K3kRu'></tbody>

              <small id='K3kRu'></small><noframes id='K3kRu'>

              <legend id='K3kRu'><style id='K3kRu'><dir id='K3kRu'><q id='K3kRu'></q></dir></style></legend>

              • <tfoot id='K3kRu'></tfoot>

                <i id='K3kRu'><tr id='K3kRu'><dt id='K3kRu'><q id='K3kRu'><span id='K3kRu'><b id='K3kRu'><form id='K3kRu'><ins id='K3kRu'></ins><ul id='K3kRu'></ul><sub id='K3kRu'></sub></form><legend id='K3kRu'></legend><bdo id='K3kRu'><pre id='K3kRu'><center id='K3kRu'></center></pre></bdo></b><th id='K3kRu'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='K3kRu'><tfoot id='K3kRu'></tfoot><dl id='K3kRu'><fieldset id='K3kRu'></fieldset></dl></div>
              • 本文介紹了Core Data 什么時候刷新到磁盤?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                我在我的應用程序中使用 Core Data,并發現了模擬器的一些奇怪行為:當我在我的應用程序中向 Core Data 添加一些數據并使用 XCode 中的停止"按鈕退出模擬器時(或者只需按 Cmd-Q) 立即,下次我啟動模擬器時,數據不會存儲在數據庫中.經過一些測試,我發現數據存儲到磁盤:

                I use Core Data in my application, and discovered some odd behavior of the simulator: When I add some data to Core Data in my app and quits the simulator using the "stop" button in XCode (or just press Cmd-Q) immediately, the data is not stored in the database the next time I start the simulator. After some testing, I found out, that the data is stored to disk:

                • 當我按下主頁按鈕時.(幾乎 - 如果退出速度非常快,可以在存儲數據之前退出應用程序.)
                • 如果我在添加數據后讓應用程序運行一段時間(至少大約 20 秒).
                • immediately if I press the home button. (Almost - it is possible to quit the application before data is stored if quitting very fast.)
                • If I let the application run for some time (at least about 20 seconds) after adding data.

                調用 [NSManagedObjectContext save:] 沒有幫助.行為是一樣的.

                It does not help to call [NSManagedObjectContext save:]. The behavior is the same.

                所以我的問題是:這種行為的原因是什么?有沒有辦法在退出之前強制刷新到磁盤?在設備上運行時,我是否有可能以這種方式丟失數據(就我個人而言,我沒有看到任何風險,除了強制關閉,但奇怪的行為讓我有點困擾)

                So my question is: What is the reason for this kind of behavior? Are there any way to force flushing to disk before quitting? And are there any risk that I can loose data this way when running on a device (personally, I do not see any, except a force close, but the odd behavior bothers me a bit)

                推薦答案

                您可能正在使用嵌套上下文.如果你的上下文有一個父上下文,調用 -save: 只會保存到那個上下文,而不是文件系統.

                You're probably using nested context's. If your context has a parent context, calling -save: will just save to that context, not to the file system.

                嵌套上下文(通常)用于安全地使用后臺隊列上的上下文,并允許保存前臺上下文而不必產生保存到文件系統的開銷.保存到文件系統將在后臺隊列中進行,不會阻塞主線程.

                Nested context are (usually) used to safely use a context on a background queue, and allowing a foreground context to save without having to incur the overhead of saving to the file system. The save to the file system will happen on a background queue and not block the main thread.

                這篇關于Core Data 什么時候刷新到磁盤?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                How to animate a UIImageview to display fullscreen by tapping on it?(如何通過點擊動畫 UIImageview 以顯示全屏?)
                To stop segue and show alert(停止 segue 并顯示警報)
                iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以編程方式確定路徑)
                Icon already includes gloss effects(圖標已經包含光澤效果)
                How does UIEdgeInsetsMake work?(UIEdgeInsetsMake 是如何工作的?)
                UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定義跟蹤和進度圖像(iOS 5 屬性))

                    • <bdo id='l1GWp'></bdo><ul id='l1GWp'></ul>

                      <small id='l1GWp'></small><noframes id='l1GWp'>

                        <tbody id='l1GWp'></tbody>
                      • <legend id='l1GWp'><style id='l1GWp'><dir id='l1GWp'><q id='l1GWp'></q></dir></style></legend>

                          <i id='l1GWp'><tr id='l1GWp'><dt id='l1GWp'><q id='l1GWp'><span id='l1GWp'><b id='l1GWp'><form id='l1GWp'><ins id='l1GWp'></ins><ul id='l1GWp'></ul><sub id='l1GWp'></sub></form><legend id='l1GWp'></legend><bdo id='l1GWp'><pre id='l1GWp'><center id='l1GWp'></center></pre></bdo></b><th id='l1GWp'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='l1GWp'><tfoot id='l1GWp'></tfoot><dl id='l1GWp'><fieldset id='l1GWp'></fieldset></dl></div>

                        1. <tfoot id='l1GWp'></tfoot>
                          主站蜘蛛池模板: 亚洲一级av毛片 | 国产欧美日韩在线一区 | 另类 综合 日韩 欧美 亚洲 | 中文字幕视频在线 | 婷婷久久五月天 | 日日射夜夜骑 | 国产免费看 | 日韩在线观看中文字幕 | 欧亚av在线| 国产高清在线观看 | 日韩av在线免费 | 国产免费观看视频 | 国产精品美女一区二区三区 | 99精品国产一区二区三区 | 91资源在线 | 二区在线观看 | 美女国内精品自产拍在线播放 | 亚洲欧美视频 | 欧美精品一区二区在线观看 | 国产精品视频在 | 国产精品日韩欧美一区二区三区 | 国产欧美一区二区久久性色99 | 中文字幕一区在线 | 黄色在线免费播放 | 亚洲一区不卡 | 午夜久草| 国产成人99久久亚洲综合精品 | 激情五月婷婷在线 | 一区二区三区欧美 | 国产高清视频在线观看 | 成人动漫视频网站 | 久久久久亚洲av毛片大全 | 狠狠插天天干 | 国产美女在线观看 | 色爱区综合 | 中文字幕第5页 | 欧美日韩视频在线第一区 | 韩日一区二区 | 91免费在线| 久久激情网 | 国产一区二区三区免费视频 |