[aerogear-dev] [aerogear-ios] error on store save
Yavuz Selim YILMAZ
yavuzsel at buffalo.edu
Wed Jun 12 13:52:31 EDT 2013
here is my response object from log:
({
id = 1;
mail = "yavuzsel at buffalo.edu";
name = "yavuz";
telephone = "<null>";
},
{
id = 2;
mail = "yavuzsel at buffalo.edu";
name = "yavuzsel";
telephone = "001234";
}
)
thanks,
---
Yavuz Selim Yilmaz
SUNY at Buffalo
Computer Science and Engineering
PhD Candidate
On Jun 12, 2013, at 1:49 PM, Matthias Wessendorf <matzew at apache.org> wrote:
> 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",
> "telephone" => NULL
> ),
> array(
> "id" => 2,
> "name" => "yavuzsel",
> "mail" => "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
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20130612/d7e8af31/attachment-0001.html
More information about the aerogear-dev
mailing list