<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Yavuz.<div><br></div><div>thanks for trying out our library!</div><div><br></div><div>The issue here is that you don't, when you reload the app, specify the type of the store, you just give the name. The library doesn't remember names and types of stores. For this to work you need o specify the type of store as in the case when you created. That is:</div><div><br></div><div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "></div></blockquote></div><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><pre class="line-pre" style="font-size: 12px; line-height: 16px; font-family: Consolas, 'Liberation Mono', Courier, monospace; word-wrap: break-word; width: 744px; margin-top: 0px; margin-bottom: 0px; padding: 0px; background-color: rgb(255, 255, 255); position: static; z-index: auto; "><div class="line" id="file-gistfile1-m-LC1"><span class="c1" style="color: rgb(153, 153, 136); font-style: italic; ">// create the datamanager</span></div><div class="line" id="file-gistfile1-m-LC2"><span class="n" style="color: rgb(51, 51, 51); ">AGDataManager</span><span class="o" style="font-weight: bold; ">*</span> <span class="n" style="color: rgb(51, 51, 51); ">dm</span> <span class="o" style="font-weight: bold; ">=</span> <span class="p">[</span><span class="n" style="color: rgb(51, 51, 51); ">AGDataManager</span> <span class="n" style="color: rgb(51, 51, 51); ">manager</span><span class="p">];</span></div><div class="line" id="file-gistfile1-m-LC3"><span class="c1" style="color: rgb(153, 153, 136); font-style: italic; ">// initialise store</span></div><div class="line" id="file-gistfile1-m-LC4"><span class="kt" style="color: rgb(68, 85, 136); font-weight: bold; ">id</span><span class="o" style="font-weight: bold; "><</span><span class="n" style="color: rgb(51, 51, 51); ">AGStore</span><span class="o" style="font-weight: bold; ">></span> <span class="n" style="color: rgb(51, 51, 51); ">myStore</span> <span class="o" style="font-weight: bold; ">=</span> <span class="p">[</span><span class="n" style="color: rgb(51, 51, 51); ">dm</span> <span class="n" style="color: rgb(51, 51, 51); ">store</span><span class="o" style="font-weight: bold; ">:^</span><span class="p">(</span><span class="kt" style="color: rgb(68, 85, 136); font-weight: bold; ">id</span><span class="o" style="font-weight: bold; "><</span><span class="n" style="color: rgb(51, 51, 51); ">AGStoreConfig</span><span class="o" style="font-weight: bold; ">></span> <span class="n" style="color: rgb(51, 51, 51); ">config</span><span class="p">)</span> <span class="p">{</span></div><div class="line" id="file-gistfile1-m-LC5"> <span class="p">[</span><span class="n" style="color: rgb(51, 51, 51); ">config</span> <span class="n" style="color: rgb(51, 51, 51); ">setName</span><span class="o" style="font-weight: bold; ">:</span><span class="s" style="color: rgb(221, 17, 68); ">@"tasks"</span><span class="p">];</span></div><div class="line" id="file-gistfile1-m-LC6"> <span class="p">[</span><span class="n" style="color: rgb(51, 51, 51); ">config</span> <span class="n" style="color: rgb(51, 51, 51); ">setType</span><span class="o" style="font-weight: bold; ">:</span><span class="s" style="color: rgb(221, 17, 68); ">@"PLIST"</span><span class="p">];</span></div><div class="line" id="file-gistfile1-m-LC7"><span class="p">}]</span></div></pre></div></div><div><br></div><div>Now, If the PLIST store with name 'tasks' exist on disk it will be initialised with the values you have inserted prior to termination and you can access them as normal.</div><div><br></div><div>Thanks</div><div>Christos</div><div><br></div><div><br></div><div><br><div><div>On Jun 7, 2013, at 12:15 AM, Yavuz Selim YILMAZ <<a href="mailto:yavuzsel@buffalo.edu">yavuzsel@buffalo.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">thank you for your response Matthias. i want to clarify my first question more. so, i created my data store like this when user launched the app.<div><br></div><div><pre style="font-family: Courier, Consolas, monospace; font-size: 13px; line-height: 18px; border: 1px solid rgb(199, 207, 213); background-color: rgb(241, 245, 249); color: rgb(102, 102, 102); padding: 0.3em 1em; position: static; z-index: auto; "><code style="font-family: Courier, Consolas, monospace; ">// create the datamanager
AGDataManager* dm = [AGDataManager manager];
// add a new (default) store object:
id<AGStore> myStore = [dm store:^(id<AGStoreConfig> config) {
[config setName:@"tasks"];
[config setType:@"PLIST"];
}]</code></pre><div><br></div><div>then user switched to some other app and my app eventually terminated. then user came back to my app again. how do i retrieve the data store i created above? does this work (seems like it won't, as i lost my data manager above):</div><div><br></div><div><pre style="font-family: Courier, Consolas, monospace; font-size: 13px; line-height: 18px; border: 1px solid rgb(199, 207, 213); background-color: rgb(241, 245, 249); color: rgb(102, 102, 102); padding: 0.3em 1em; position: static; z-index: auto; "><code style="font-family: Courier, Consolas, monospace; ">// create the datamanager
AGDataManager* dm = [AGDataManager manager];
// add a new (default) store object:
id<AGStore> myStore = [dm storeWithName:@"tasks"]</code></pre><div><br></div></div><div>
<div style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><br class="Apple-interchange-newline">---</div><div style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Yavuz Selim Yilmaz</div><div style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">SUNY at Buffalo</div><div style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Computer Science and Engineering</div><div style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">PhD Candidate</div>
</div>
<br><div><div>On Jun 6, 2013, at 5:03 PM, Matthias Wessendorf <<a href="mailto:matzew@apache.org">matzew@apache.org</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 6, 2013 at 9:34 PM, Yavuz Selim YILMAZ <span dir="ltr"><<a href="mailto:yavuzsel@buffalo.edu" target="_blank">yavuzsel@buffalo.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">Hi All,<div><br></div><div>
I am trying out the AeroGear iOS lib, and trying to achieve client side data persistency employing AeroGear as much as possible. Here are a few questions I have, and I would appreciate any comments, suggestions and/or directions:</div>
<div><br></div><div>- So, starting from the basic question, how can I retrieve my data stores once user leaves the app and comes back (or, can I do this at all)?</div></div></blockquote><div><br></div><div style="">there are callbacks for the lifecycle of the app</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">
<div><br></div><div>-Then, what is the difference between "MEMORY" type data store and "PLIST" type one (especially considering my goal is data persistence)?</div></div></blockquote><div><br></div><div>
<br></div><div style="">MEM -> run of the app;</div><div style="">PList -> property list => pers. storage on the file system (sandbox style)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><br></div><div>- Or alternatively, considering what AeroGear provides for now, what would be the best approach to implement offline support for the client? (for now, what I know is the lib does not provide DataSync. so data consistency is what I will take care of on my own.)</div>
</div></blockquote><div><br></div><div style="">store PList and use the "Reachability" class (Apple example OR <a href="https://github.com/tonymillion/Reachability">https://github.com/tonymillion/Reachability</a>)</div>
<div style=""><br></div><div style="">-M</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><br></div><div>Thanks for your time to read (and to respond). Bests,<br><div>
<div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">
<br>---</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">
Yavuz Selim Yilmaz</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">
SUNY at Buffalo</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">
Computer Science and Engineering</div><div style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:-webkit-auto;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:medium;white-space:normal;font-family:Helvetica;word-spacing:0px">
PhD Candidate</div>
</div>
<br></div></div><br>_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Matthias Wessendorf <br>
<br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a>
</div></div>
_______________________________________________<br>aerogear-dev mailing list<br><a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a></blockquote></div><br></div></div>_______________________________________________<br>aerogear-dev mailing list<br><a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/aerogear-dev</blockquote></div><br></div></body></html>