20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#import "OFBridging.h"
#import "OFOutOfRangeException.h"
@implementation NSOFArray
- (instancetype)initWithOFArray: (OFArray *)array
{
if ((self = [super init]) != nil) {
@try {
_array = [array retain];
} @catch (id e) {
return nil;
}
}
return self;
}
- (id)objectAtIndex: (NSUInteger)idx
{
id object = [_array objectAtIndex: idx];
if ([(OFObject *)object conformsToProtocol: @protocol(OFBridging)])
return [object NSObject];
|
|
<
|
<
<
<
<
>
>
>
>
>
>
>
|
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#import "OFBridging.h"
#import "OFOutOfRangeException.h"
@implementation NSOFArray
- (instancetype)initWithOFArray: (OFArray *)array
{
if ((self = [super init]) != nil)
_array = [array retain];
return self;
}
- (void)dealloc
{
[_array release];
[super dealloc];
}
- (id)objectAtIndex: (NSUInteger)idx
{
id object = [_array objectAtIndex: idx];
if ([(OFObject *)object conformsToProtocol: @protocol(OFBridging)])
return [object NSObject];
|