This repository has been archived by the owner on Jan 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
PhotoTest1Controller.m
101 lines (87 loc) · 4.38 KB
/
PhotoTest1Controller.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#import "PhotoTest1Controller.h"
#import "MockPhotoSource.h"
@implementation PhotoTest1Controller
- (void)viewDidLoad {
self.photoSource = [[[MockPhotoSource alloc]
initWithType:MockPhotoSourceNormal
// initWithType:MockPhotoSourceDelayed
// initWithType:MockPhotoSourceLoadError
// initWithType:MockPhotoSourceDelayed|MockPhotoSourceLoadError
title:@"Flickr Photos"
photos:[NSArray arrayWithObjects:
// Request fails immediately due to DNS error
// [[[MockPhoto alloc]
// initWithURL:@"http://example.com"
// smallURL:@"http://example.com"
// size:CGSizeMake(320, 480)] autorelease],
// 404 on both URL and thumbnail
// [[[MockPhoto alloc]
// initWithURL:@"http://farm4.static.flickr.com/3425/3214x620333_daf56d25e5.jpg?v=0"
// smallURL:@"http://farm4.static.flickr.com/3425/3214620333_daf56d25e5_t.jpg"
// size:CGSizeMake(320, 480)] autorelease],
// Returns HTML instead of image
// [[[MockPhoto alloc]
// initWithURL:@"http://flickr.com"
// smallURL:@"http://farm4.static.flickr.com/3444/3223645618_f5e2fa7fea_t.jpg"
// size:CGSizeMake(320, 480)] autorelease],
[[[MockPhoto alloc]
initWithURL:@"http://farm4.static.flickr.com/3444/3223645618_13fe36887a_o.jpg"
smallURL:@"http://farm4.static.flickr.com/3444/3223645618_f5e2fa7fea_t.jpg"
size:CGSizeMake(320, 480)
caption:@"These are the wood tiles that we had installed after the accident."] autorelease],
// Causes album to be loaded
// [NSNull null],
[[[MockPhoto alloc]
initWithURL:@"http://farm2.static.flickr.com/1124/3164979509_bcfdd72123.jpg?v=0"
smallURL:@"http://farm2.static.flickr.com/1124/3164979509_bcfdd72123_t.jpg"
size:CGSizeMake(320, 480)
caption:@"A hike."] autorelease],
[[[MockPhoto alloc]
initWithURL:@"http://farm4.static.flickr.com/3106/3203111597_d849ef615b.jpg?v=0"
smallURL:@"http://farm4.static.flickr.com/3106/3203111597_d849ef615b_t.jpg"
size:CGSizeMake(320, 480)] autorelease],
[[[MockPhoto alloc]
initWithURL:@"http://farm4.static.flickr.com/3099/3164979221_6c0e583f7d.jpg?v=0"
smallURL:@"http://farm4.static.flickr.com/3099/3164979221_6c0e583f7d_t.jpg"
size:CGSizeMake(320, 480)] autorelease],
[[[MockPhoto alloc]
initWithURL:@"http://farm4.static.flickr.com/3081/3164978791_3c292029f2.jpg?v=0"
smallURL:@"http://farm4.static.flickr.com/3081/3164978791_3c292029f2_t.jpg"
size:CGSizeMake(320, 480)] autorelease],
[[[MockPhoto alloc]
initWithURL:@"http://farm2.static.flickr.com/1134/3172884000_84bc6a841e.jpg?v=0"
smallURL:@"http://farm2.static.flickr.com/1134/3172884000_84bc6a841e_t.jpg"
size:CGSizeMake(320, 480)] autorelease],
[[[MockPhoto alloc]
initWithURL:@"http://farm4.static.flickr.com/3246/2957580101_33c799fc09_o.jpg"
smallURL:@"http://farm4.static.flickr.com/3246/2957580101_d63ef56b15_t.jpg"
size:CGSizeMake(960, 1280)] autorelease],
[[[MockPhoto alloc]
initWithURL:@"http://farm3.static.flickr.com/2358/2179913094_3a1591008e.jpg"
smallURL:@"http://farm3.static.flickr.com/2358/2179913094_3a1591008e_t.jpg"
size:CGSizeMake(383, 500)] autorelease],
[[[MockPhoto alloc]
initWithURL:@"http://farm4.static.flickr.com/3162/2677417507_e5d0007e41.jpg"
smallURL:@"http://farm4.static.flickr.com/3162/2677417507_e5d0007e41_t.jpg"
size:CGSizeMake(391, 500)] autorelease],
[[[MockPhoto alloc]
initWithURL:@"http://farm4.static.flickr.com/3334/3334095096_ffdce92fc4.jpg"
smallURL:@"http://farm4.static.flickr.com/3334/3334095096_ffdce92fc4_t.jpg"
size:CGSizeMake(407, 500)] autorelease],
[[[MockPhoto alloc]
initWithURL:@"http://farm4.static.flickr.com/3118/3122869991_c15255d889.jpg"
smallURL:@"http://farm4.static.flickr.com/3118/3122869991_c15255d889_t.jpg"
size:CGSizeMake(500, 406)] autorelease],
[[[MockPhoto alloc]
initWithURL:@"http://farm2.static.flickr.com/1004/3174172875_1e7a34ccb7.jpg"
smallURL:@"http://farm2.static.flickr.com/1004/3174172875_1e7a34ccb7_t.jpg"
size:CGSizeMake(500, 372)] autorelease],
[[[MockPhoto alloc]
initWithURL:@"http://farm3.static.flickr.com/2300/2179038972_65f1e5f8c4.jpg"
smallURL:@"http://farm3.static.flickr.com/2300/2179038972_65f1e5f8c4_t.jpg"
size:CGSizeMake(391, 500)] autorelease],
nil]
photos2:nil
] autorelease];
}
@end