tag:blogger.com,1999:blog-4376417828574391409.post2886116946668297430..comments2023-11-23T08:55:01.108-05:00Comments on Victor Costan: iPhone Web Service Toolkit Upgrade: JSON FTWAnonymoushttp://www.blogger.com/profile/15471814314476820630noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-4376417828574391409.post-91681668481046851822011-08-12T09:56:20.477-04:002011-08-12T09:56:20.477-04:00For businesses it needs to stay at the top by usin...For businesses it needs to stay at the top by using new software solutions. Some applications could be developed by outsource company that provides <a href="http://sigmaukraine.com/technologies/microsoft" title="Microsoft software development" rel="nofollow"><strong>microsoft application development</strong></a> for business companies.Joshua Smithhttps://www.blogger.com/profile/09956978234577871712noreply@blogger.comtag:blogger.com,1999:blog-4376417828574391409.post-30384743210321359632010-01-05T14:08:29.764-05:002010-01-05T14:08:29.764-05:00Hi Victor,
Great library, Congrats!
I have one iss...Hi Victor,<br />Great library, Congrats!<br />I have one issue about ZNXmlHttpRequest. Can I use a model with a NSArray of nested models?<br />I would like to parse a XML like this<br /><br />< top ><br /> < name >Top Name< /name ><br /> < finals ><br /> < final ><br /> < name >First final< /name ><br /> < /final ><br /> < final ><br /> < name >Second final< /name ><br /> < /final ><br /> < final ><br /> < name >Last final< /name ><br /> < /final ><br /> < /finals ><br />< /top ><br /><br />ThanksRenehttps://www.blogger.com/profile/00108915582489321379noreply@blogger.comtag:blogger.com,1999:blog-4376417828574391409.post-81917590014367696312009-06-09T19:25:40.756-04:002009-06-09T19:25:40.756-04:00@Chris: apologies for not being clear in my blog p...@Chris: apologies for not being clear in my blog posts.<br /><br />Yes, you can use the same command. I think you can pretty much repeat the initial setup process to update the code.<br /><br />I committed all the code in the "submodels" branch.<br /><br />I hope it works for you!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4376417828574391409.post-32240437213552152922009-06-09T18:52:21.839-04:002009-06-09T18:52:21.839-04:00Hi Victor, I need to use the latest branch in my x...Hi Victor, I need to use the latest branch in my xcode project. Can I just overwrite the previous one via the command line tool?Chris Palmerhttps://www.blogger.com/profile/04310980687354205790noreply@blogger.comtag:blogger.com,1999:blog-4376417828574391409.post-70620382083504273092009-06-09T05:24:28.174-04:002009-06-09T05:24:28.174-04:00@Chris: is the code working out for you? If not, c...@Chris: is the code working out for you? If not, can you tell me where are you stuck?<br /><br />I made the XML parser more versatile, so now it supports nested models as well. So you should be fine no matter what format you use.<br /><br />Thanks for making me code this! :)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4376417828574391409.post-77722711126802893002009-06-08T19:27:04.237-04:002009-06-08T19:27:04.237-04:00@Chris: I'm assuming that you have a @property...@Chris: I'm assuming that you have a @property for the Project*, and that the property is named theProject, just like the instance variable.<br /><br />In that case, your json should look like "events":[{"the_project": { ..project stuff.. } ... ]. You can have "theProject" instead of "the_project", and that should work. But you can't have "project". ModelSupport uses the name of the property to decide the JSON dictionary key.<br /><br />The relevant test is in <a href="http://github.com/costan/zergsupport/blob/8acdf1f30768e86a5bf84be130bbcea6168365cc/ZergSupport/ModelSupport/ZNModelTest.m#L166" rel="nofollow">ZergSupport/ModelSupport/ZNModelTest.m</a><br /><br />It converts between a model and a Cocoa dictionary, but the same mechanism is used for JSON conversion.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4376417828574391409.post-27827820491091141342009-06-08T17:54:02.790-04:002009-06-08T17:54:02.790-04:00Hi Victor, I downloaded the branch and was looking...Hi Victor, I downloaded the branch and was looking at the diff. I was wondering if there was a test to have a look at? I guess I was unsure of how it loads the sub object and how you access its properties.<br /><br />@interface Event : ZNModel {<br /> Project *theProject<br /><br />}<br /><br />@interface Project : ZNModel {<br /> NSString *name;<br />}<br /><br /><br />So I query the list of event objects, the event is in Json looks like this:<br /><br />{"events":[{<br /> "pkId": 1026,<br /> "applUser": "Chris Palmer",<br /> "project": {<br /> "pkId": 7,<br /> "name": "Conn3cted - Toyota",<br /> "managerName": "Glenn Murray"<br /> },<br /> "startDate": "2009-06-01 09:00 AM",<br /> "endDate": "2009-06-01 05:00 PM",<br /> "note": "Work on , production issues of showroom with support, ronn , darren"<br />}Chris Palmerhttps://www.blogger.com/profile/04310980687354205790noreply@blogger.comtag:blogger.com,1999:blog-4376417828574391409.post-36958895015021625202009-06-08T04:04:49.924-04:002009-06-08T04:04:49.924-04:00Hi Victor,
Thanks for your input as well. Yes, I ...Hi Victor,<br /><br />Thanks for your input as well. Yes, I haven't even tried the xml stuff yet. I guess the use case is really the same between the two apis. You have various properties you may want to "map" to specific classes. But I think as long as your model objects inherit ZNModel we should be ok. I will have to test your branch...ill have a look tonight.Chris Palmerhttps://www.blogger.com/profile/04310980687354205790noreply@blogger.comtag:blogger.com,1999:blog-4376417828574391409.post-56139980609826329512009-06-08T03:26:59.982-04:002009-06-08T03:26:59.982-04:00@Chris: Thank you so much for your feedback!
You ...@Chris: Thank you so much for your feedback!<br /><br />You are right, in that I was thinking AppIUser would inherit from ZNModel as well.<br /><br />You are also right about this not working in XML. The problem is I don't parse nested trees. For example, in the tree below, I wouldn't get to "name":<br /><br />< event ><br /> < appIUser ><br /> < name >...<br /> < /appIUser ><br /> ...<br />< /event ><br /><br />I'll look into the XML parsing code tomorrow. Can you work with just having JSON support for now?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4376417828574391409.post-67413290862114041692009-06-08T02:17:26.155-04:002009-06-08T02:17:26.155-04:00I am not sure I grasped your thought.
Example :
...I am not sure I grasped your thought. <br /><br />Example :<br />@interface Event : ZNModel {<br /> NSString *pkId;<br /> ApplUser *applUser;<br /> NSString *project;<br /> NSString *note;<br /> ApplUser *consultant;<br /> NSDate *startDate;<br /> NSDate *endDate;<br />}<br /><br />I think what you are suggesting would be to make applUser a ZNModel? Then perhaps the toolkit would get smart and see the property and stuff the values?<br /><br />Side question, does the xml library handle that? I thought I saw an example where you map class names to properties.Chris Palmerhttps://www.blogger.com/profile/04310980687354205790noreply@blogger.comtag:blogger.com,1999:blog-4376417828574391409.post-73180091555623809052009-06-08T02:17:22.343-04:002009-06-08T02:17:22.343-04:00@Chris: try the "submodels" branch in th...@Chris: try the "submodels" branch in the repository.<br /><br />If it works for you, I'll promote it to master.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4376417828574391409.post-65969766883335517542009-06-07T22:26:35.117-04:002009-06-07T22:26:35.117-04:00@Chris: It doesn't handle that yet, but it sho...@Chris: It doesn't handle that yet, but it should.<br /><br />I think the most natural way would be to have a property whose type is a model, and pass a dictionary through JSON. Do you think that makes sense?<br /><br />Will hack something up.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4376417828574391409.post-18159364382048205352009-06-07T22:06:33.582-04:002009-06-07T22:06:33.582-04:00Hi,
I just started using the toolkit and I am hav...Hi,<br /><br />I just started using the toolkit and I am having some success. I keep building on my application since I am new to the iphone sdk. Is it possible to retrieve objects in objects? What I a mean is I have a property that is an object its self. The server side is java so I am quite flexible to what I can send via json. <br /><br />Thanks,<br />ChrisChris Palmerhttps://www.blogger.com/profile/04310980687354205790noreply@blogger.com