<div dir="ltr">Hi,<div><br></div><div style>there is no &quot;isEmpty&quot; or so:</div><div style><a href="http://aerogear.org/docs/specs/aerogear-ios/Protocols/AGStore.html">http://aerogear.org/docs/specs/aerogear-ios/Protocols/AGStore.html</a><br>
</div><div style><br></div><div style>However, that would be a good enhancement. Do you mind filing a JIRA against the AGIOS component ?</div><div style><br></div><div style>Thanks!</div><div style>Matthias</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Thu, Jun 13, 2013 at 7:46 PM, Yavuz Selim YILMAZ <span dir="ltr">&lt;<a href="mailto:yavuzsel@buffalo.edu" target="_blank">yavuzsel@buffalo.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Hi,<div><br></div><div>Thanks for the answers. I have another question if you don&#39;t mind. When I create the myStore like in your examples, do I have any indication that the store is not empty (i.e. it is loaded from already existing plist store)? I can readAll from the store and check the count, but is there any better way to get it? (maybe a side question, is readAll efficient in this case?)</div>
<div><br></div><div>I appreciate your help. Bests,<div class="im"><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><div class="h5"><div><div>On Jun 7, 2013, at 2:42 AM, Christos Vasilakis &lt;<a href="mailto:cvasilak@gmail.com" target="_blank">cvasilak@gmail.com</a>&gt; wrote:</div><br><blockquote type="cite"><div style="word-wrap:break-word">
Hi Yavuz.<div><br></div><div>thanks for trying out our library!</div><div><br></div><div>The issue here is that you don&#39;t, when you reload the app, specify the type of the store, you just give the name. The library doesn&#39;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"></div></blockquote></div><div><div style="word-wrap:break-word"><pre style="line-height:16px;width:744px;font-size:12px;margin-bottom:0px;font-family:Consolas,&#39;Liberation Mono&#39;,Courier,monospace;margin-top:0px;word-wrap:break-word;padding:0px">
<div><span style="color:rgb(153,153,136);font-style:italic">// create the datamanager</span></div><div><span style="color:rgb(51,51,51)">AGDataManager</span><span style="font-weight:bold">*</span> <span style="color:rgb(51,51,51)">dm</span> <span style="font-weight:bold">=</span> <span>[</span><span style="color:rgb(51,51,51)">AGDataManager</span> <span style="color:rgb(51,51,51)">manager</span><span>];</span></div>
<div><span style="color:rgb(153,153,136);font-style:italic">// initialise store</span></div><div><span style="color:rgb(68,85,136);font-weight:bold">id</span><span style="font-weight:bold">&lt;</span><span style="color:rgb(51,51,51)">AGStore</span><span style="font-weight:bold">&gt;</span> <span style="color:rgb(51,51,51)">myStore</span> <span style="font-weight:bold">=</span> <span>[</span><span style="color:rgb(51,51,51)">dm</span> <span style="color:rgb(51,51,51)">store</span><span style="font-weight:bold">:^</span><span>(</span><span style="color:rgb(68,85,136);font-weight:bold">id</span><span style="font-weight:bold">&lt;</span><span style="color:rgb(51,51,51)">AGStoreConfig</span><span style="font-weight:bold">&gt;</span> <span style="color:rgb(51,51,51)">config</span><span>)</span> <span>{</span></div>
<div>    <span>[</span><span style="color:rgb(51,51,51)">config</span> <span style="color:rgb(51,51,51)">setName</span><span style="font-weight:bold">:</span><span style="color:rgb(221,17,68)">@&quot;tasks&quot;</span><span>];</span></div>
<div>    <span>[</span><span style="color:rgb(51,51,51)">config</span> <span style="color:rgb(51,51,51)">setType</span><span style="font-weight:bold">:</span><span style="color:rgb(221,17,68)">@&quot;PLIST&quot;</span><span>];</span></div>
<div><span>}]</span></div></pre></div></div><div><br></div><div>Now, If the PLIST store with name &#39;tasks&#39;  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 &lt;<a href="mailto:yavuzsel@buffalo.edu" target="_blank">yavuzsel@buffalo.edu</a>&gt; wrote:</div>
<br><blockquote type="cite"><div style="word-wrap:break-word">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"><code style="font-family:Courier,Consolas,monospace">// create the datamanager
AGDataManager* dm = [AGDataManager manager];
// add a new (default) store object:
id&lt;AGStore&gt; myStore = [dm store:^(id&lt;AGStoreConfig&gt; config) {
    [config setName:@&quot;tasks&quot;];
    [config setType:@&quot;PLIST&quot;];
}]</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&#39;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"><code style="font-family:Courier,Consolas,monospace">// create the datamanager
AGDataManager* dm = [AGDataManager manager];
// add a new (default) store object:
id&lt;AGStore&gt; myStore = [dm storeWithName:@&quot;tasks&quot;]</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;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<br>---</div><div style="font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing: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;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing: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;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing: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;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
PhD Candidate</div>
</div>
<br><div><div>On Jun 6, 2013, at 5:03 PM, Matthias Wessendorf &lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt; wrote:</div><br><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">&lt;<a href="mailto:yavuzsel@buffalo.edu" target="_blank">yavuzsel@buffalo.edu</a>&gt;</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>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 &quot;MEMORY&quot; type data store and &quot;PLIST&quot; type one (especially considering my goal is data persistence)?</div></div></blockquote><div><br></div><div>

<br></div><div>MEM -&gt; run of the app;</div><div>PList -&gt; property list =&gt; 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>store PList and use the &quot;Reachability&quot; class (Apple example OR <a href="https://github.com/tonymillion/Reachability" target="_blank">https://github.com/tonymillion/Reachability</a>)</div>

<div><br></div><div>-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" target="_blank">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" target="_blank">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></blockquote>
</div><br></div></div>_______________________________________________<br>aerogear-dev mailing list<br><a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">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></blockquote>
</div><br></div></div>_______________________________________________<br>aerogear-dev mailing list<br><a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">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></blockquote>
</div><br></div></div></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>