[aerogear-dev] [aerogear-ios] error on store save

Matthias Wessendorf matzew at apache.org
Wed Jun 12 13:49:51 EDT 2013


can u NSLog the 'responseObject'?

Is that a NSDictionary or NSArray?



On Wednesday, June 12, 2013, Yavuz Selim YILMAZ wrote:

> Hi all,
>
> I am getting error while saving my response object to my store. Here are
> my codes:
>
>
> AGPipeline *pipeline = [AGPipeline pipelineWithBaseURL:[NSURL
> URLWithString:@"localhost"]];
>
> id<AGPipe> dataPipe = [pipeline pipe:^(id<AGPipeConfig> config) {
>             [config setName:@"persons"];
>             [config setEndpoint:@"get_persons.php"];
>         }];
>
> AGDataManager *dm = [AGDataManager manager];
>
> id<AGStore> dataStore = [dm store:^(id<AGStoreConfig> config) {
>         [config setName:@"persons"];
>         [config setType:@"PLIST"];
>     }];
>
> [dataPipe read:^(id responseObject) {
>         NSError *error;
>         if (![dataStore save:responseObject error:&error])
>             NSLog(@"Save: An error occured during save! \n%@", error);
>
>     } failure:^(NSError *error) {
>         NSLog(@"An error has occured during read! \n%@", error);
>     }];
>
>
> And I am getting this log output:
>
> Save: An error occured during save!
> Error Domain=org.aerogear.stores.save Code=0 "error on save"
> UserInfo=0x727a6e0 {NSLocalizedDescription=error on save}
>
>
> here is my "get_persons.php"
>
> <?php
>     $result_array = array(array(
>                         "id" => 1,
>                         "name" => "yavuz",
>                         "mail" => "yavuzsel at buffalo.edu<javascript:_e({}, 'cvml', 'yavuzsel at buffalo.edu');>
> ",
>                         "telephone" => NULL
>                     ),
>                     array(
>                         "id" => 2,
>                         "name" => "yavuzsel",
>                         "mail" => "yavuzsel at buffalo.edu<javascript:_e({}, 'cvml', 'yavuzsel at buffalo.edu');>
> ",
>                         "telephone" => "001234"
>                     ));
>     header('HTTP/1.1 200 OK');
>     header('content-type: application/json');
>     echo json_encode($result_array);
> ?>
>
>
> Any help or direction is appreciated.
>
> Cheers,
>
> ---
> Yavuz Selim Yilmaz
> SUNY at Buffalo
> Computer Science and Engineering
> PhD Candidate
>
>

-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20130612/2939d026/attachment.html 


More information about the aerogear-dev mailing list