forked from omorandi/TiAssetsLibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAssetsList.m
41 lines (33 loc) · 797 Bytes
/
AssetsList.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2012 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
#import "AssetsList.h"
#import "Asset.h"
@implementation AssetsList
-(id)initWithALAssetsArray:(NSArray*)alAssets
{
self = [super init];
if (self)
{
assets = [alAssets retain];
}
return self;
}
-(void)dealloc
{
RELEASE_TO_NIL(assets);
[super dealloc];
}
-(NSNumber*)assetsCount
{
return [NSNumber numberWithInt:[assets count]];
}
-(Asset*)getAssetAtIndex:(id)args
{
ENSURE_SINGLE_ARG(args, NSNumber);
return [[[Asset alloc] initWithAsset:[assets objectAtIndex:[args intValue]]] autorelease];
}
@end