[aerogear-dev] [aerogear-ios] error on store save
Yavuz Selim YILMAZ
yavuzsel at buffalo.edu
Wed Jun 12 13:16:06 EDT 2013
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20130612/c003df9d/attachment.html
More information about the aerogear-dev
mailing list