- Documentation
Torch Object Storage
SDK Reference
iOS
Object Interface
Manage Objects
Enumerating Multi-Version Objects (iOS SDK)
Manage Objects
Enumerating Multi-Version Objects (iOS SDK)
Enumerating Multi-Version Objects (iOS SDK)
This article presents sample code for listing multi-version objects within a bucket, with each request returning up to 1,000 objects.
Sample Code
The following code demonstrates how to enumerate multi-version objects.
TOSCredential *credential = [[TOSCredential alloc] initWithAccessKey:@"accesskey" secretKey:@"secretkey" securityToken:@"securityToken"];
TOSEndpoint *tosEndpoint = [[TOSEndpoint alloc] initWithURLString:@"endpoint" withRegion:@"region"];
TOSClientConfiguration *config = [[TOSClientConfiguration alloc] initWithEndpoint:tosEndpoint credential:credential];
TOSClient *client = [[TOSClient alloc] initWithConfiguration:config];
TOSListObjectVersionsInput *listVersions = [[TOSListObjectVersionsInput alloc] init];
listVersions.tosBucket = @"bucket-name";
TOSTask *task = [client listObjectVersions:listVersions];
[task continueWithBlock:^id(TOSTask *task) {
NSLog(@"List object versions success.");
TOSListObjectVersionsOutput *output = task.result;
NSLog(@"List object versions failed, error: %@" ,task.error);
Last updated: 2025.09.25 16:40:49