Skip to content

Instantly share code, notes, and snippets.

View cvasilak's full-sized avatar

Christos Vasilakis cvasilak

View GitHub Profile
@cvasilak
cvasilak / gist:4327302
Created December 18, 2012 11:39
iOS Query & Paging

Further, initial work has been done to support quering and paging of the data. Currently implemented in the Pipeline using the readWithFilter method, will allow you to specify your query (where clause) and paging (limit/offset) requirements, which will then be passed on your remote endpoints to process. Work is in progess, to support quering and paging on the local DataStore, exploiting some of the fine mechanisms that the iOS provides (e.g. NSPredicate) and of course provide easier abstractions for our users to work with.

Quering and Paging is going to play an important role in the next couple of releases. Currently, there is an ongoing discussion in the mailing list, so if there is correct time to get involved it is now! We would be more than happy to hear your ideas and suggest

{"id":null,"firstName":null,"otp":null,"password":null,"email":null,"lastName":null,"uri":"otpauth://totp/john?secret=4DC6QJDTCHNQPOXE"}
{"id":null,"firstName":null,"otp":null,"password":null,"email":null,"lastName":null,"uri":"otpauth://totp/john?secret=4DC6QJDTCHNQPOXE"}
{"id":null,"firstName":null,"otp":null,"password":null,"email":null,"lastName":null,"uri":"otpauth://totp/john?secret=RLTKIYD2IPB6ETWZ"}{"id":null,"firstName":null,"otp":null,"password":null,"email":null,"lastName":null,"uri":"otpauth://totp/john?secret=RLTKIYD2IPB6ETWZ"}
xcodeproj 'AeroGear-iOS-Integration.xcodeproj'
platform :ios
pod 'AeroGear', :podspec => 'https://raw.github.com/aerogear/aerogear-ios/master/AeroGear.podspec'
target 'AeroGear-iOS-IntegrationTests', :exclusive => true do
pod 'Kiwi'
end
#import "AGPropertyListStorage.h"
@implementation AGPropertyListStorage {
NSString* _file;
}
@synthesize type = _type;
+(id) storeWithConfig:(id<AGStoreConfig>) storeConfig {
return [[self alloc] initWithConfig:storeConfig];
package com.mkyong.rest;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.FormParam;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.Response;
//http://localhost:8080/RESTfulExample/rest/message/hello%20world
//
// ViewController.m
// TimeoutNSURLConnection
//
// Created by Christos Vasilakis on 2/19/13.
// Copyright (c) 2013 Christos Vasilakis. All rights reserved.
//
#import "ViewController.h"
/*
* JBoss, Home of Professional Open Source.
* Copyright Red Hat, Inc., and individual contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
- (void)postPath:(NSString *)path
parameters:(NSDictionary *)parameters
success:(void (^)(AFHTTPRequestOperation *operation, id responseObject))success
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure {
NSURLRequest* request = [self requestWithMethod:@"POST" path:path parameters:parameters];
AFHTTPRequestOperation* operation = [self HTTPRequestOperationWithRequest:request success:success failure:failure];
void (^timeout)(void) = ^ {
[operation cancel];
e.g.
-----
AGPipeline* pipeline = [AGPipeline pipelineWithBaseURL:BASE_SOCCER_APP_URL];
id<AGPipe> leagues = [pipeline pipe:^(id<AGPipeConfig> config) {
[config setName:@"leagues"];
[config setNestedPipes:[@"teams", @"players"]; // an array of nested resources for this pipe
}];
-----