ODATAサービスからのデータを必要とするiPad用のアプリケーションを開発しています。サービスはアクティビティのリストを提供し、各アクティビティには詳細があります。
最初に、2つの日付(date_fromとdate_to)の間のすべてのアクティビティのリストを取得します。このリストには、「id」、「description」、「date_from」、および「date_to」があります。
コード:
WindowsCredential *cred = [[[WindowsCredential alloc] initWithUserName:@"user" password:@"password"]autorelease];
PROXY001 *proxy = [[PROXY001 alloc] initWithUri:@"http://ip:8000/odata/PROXY001/" credential:cred];
DataServiceQuery *query =[proxy v1collection];
[query filter:@"owner eq 'OWNER' and date_from eq '20120101' and date_to eq '20121231'"];
QueryOperationResponse *response = [query execute];
NSMutableArray *activities = [[NSMutableArray alloc] init];
activities =[[response getResult] retain];
for (int i=0; i<activities.count; i++) {
v1collection *c = [activities objectAtIndex:i];
//etc...
}
ただし、各アクティビティの詳細を取得する必要があります。これを実行するために、私はこのURIを持っています:
http://ip:8000/odata/PROXY001/v1collection(binary'0050569C007D1ED1A8E615C3E1D843E1')
バイナリ「0050569C007D1ED1A8E615C3E1D843E1」は、1つのアクティビティの「ID」です。
問題は、ObjectiveCでそれをどのように行うのかわからないことです。
英語でごめんなさい。
ありがとう!!