swipeview每次索引0

时间:2013-08-15 08:51:45

标签: iphone objective-c nsmutablearray nsmutabledictionary swipeview

每次索引的索引为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];
    }];
}

可以查看完整代码here

每次我索引= 0时会出现什么原因?

0 个答案:

没有答案