开发者

320 photosource / photoviewer with json

开发者 https://www.devze.com 2023-02-01 16:02 出处:网络
I\'ve managed to edit the TTTwitter sample project so it can parse my JSON and slap it into an array which i can read from.

I've managed to edit the TTTwitter sample project so it can parse my JSON and slap it into an array which i can read from.

But I'm struggling to think how i would insert this into the TTCatalog to use with photosource.m and photoviewer.m

The part which i need is below

- (void)load:(TTURLRequestCachePolicy)cachePolicy more:(BOOL)more {

NSString* url = [NSString stringWithFormat:kTwitterSearchFeedFormat2, @"searchPARAM"];

TTURLRequest* request = [TTURLRequest
                         requestWithURL: url
                         delegate: self];

request.cachePolicy = cachePolicy;
request.cacheExpirationAge = TT_CACHE_EXPIRATION_AGE_NEVER;
TTURLJSONResponse* response = [[TTURLJSONResponse alloc] init];
request.response = response;
TT_RELEASE_SAFELY(response);
[request send];
}

- (void)requestDidFinishLoad:(TTURLRequest*)request {
TTURLJSONResponse* response = request.response;
TTDASSERT([response.rootObject isKindOfClass:[NSDictionary class]]);
NS开发者_StackOverflow社区Dictionary* feed = response.rootObject;
TTDASSERT([[feed objectForKey:@"images"] isKindOfClass:[NSArray class]]);
NSLog(@"The content of arry is%@",feed);    
NSArray* entries = [feed objectForKey:@"images"];
NSLog(@"The content of arry is%d",entries.count);    
[super requestDidFinishLoad:request];

}

I added this to the photosource.m file hoping i can use the array to pick out the URLS to use in photoviewer.m

How do i make it, so those 2 are actually ran when i open the photoviewer.m so i can dynamically load up the pictures.

Thanks


In photoviewer.m Uncomment the below

[NSNull null],
0

精彩评论

暂无评论...
验证码 换一张
取 消