0

Index of the index each time is 0 inside:

- (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];
    }];
}

Full code can be viewed here

What would be the reason that each time I have index = 0 ?

el.severo
  • 2,202
  • 6
  • 31
  • 62

0 Answers0