public
Description: A Mac OS X photo uploader program for my photo album.
Homepage: http://bleu.west.spy.net/~dustin/projects/photoupload/
Clone URL: git://github.com/dustin/photoupload.git
photoupload / PUImageList.m
100644 59 lines (48 sloc) 1.057 kb
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// PUImageList.m
// PhotoUpload
//
// Created by Dustin Sallings on 2005/30/3.
// Copyright 2005 Dustin Sallings <dustin@spy.net>. All rights reserved.
//
 
#import "PUImageList.h"
#import "PUImage.h"
 
@implementation PUImageList
 
+ (BOOL)automaticallyNotifiesObserversForKey:(NSString *)theKey {
    BOOL automatic=NO;
    if ([theKey isEqualToString:@"images"]) {
        automatic=YES;
    } else {
        automatic=[super automaticallyNotifiesObserversForKey:theKey];
    }
    return automatic;
}
 
-(id)init
{
  id rv=[super init];
  images=[[NSMutableArray alloc] initWithCapacity:16];
  return(rv);
}
 
-(void)addPath:(NSString *)path
{
  [self willChangeValueForKey:@"images"];
  PUImage *img=[[PUImage alloc] initWithPath:path];
  [images addObject: img];
  [img release];
  
  [self didChangeValueForKey:@"images"];
}
 
-(void)removeAllObjects
{
  [self willChangeValueForKey:@"images"];
  [images removeAllObjects];
  [self didChangeValueForKey:@"images"];
}
 
-(NSArray *)images
{
  return(images);
}
 
-(unsigned)count
{
  return([images count]);
}
 
@end