毎回のインデックスのインデックスは内部で 0 です:
- (UIView *)swipeView:(SwipeView *)swipeView viewForItemAtIndex:(NSInteger)index reusingView:(UIView *)view
{
view = [[MTResultCard alloc] initWithFrame:_swipeView.frame];
NSDictionary *resultsDictionary = [[MTDataLayer sharedDataLayer].results objectForKey:@"mykey"];
NSString *key = [[[[MTDataLayer sharedDataLayer].results objectForKey:@"mykey"] allKeysSorted] objectAtIndex:index];
((MTResultCard *)view).item = [[[MTDataLayer sharedDataLayer].results objectForKey:@"mykey"] objectForKey:key];
return view;
}
-(NSArray *)allKeysSorted{
return [[self allKeys]sortedArrayUsingComparator:^NSComparisonResult(NSString* obj1, NSString* obj2) {
return [obj1 compare:obj2];
}];
}
完全なコードはここで見ることができます
毎回 index = 0 になる理由は何ですか?