嗨在我的一个应用程序中,我必须在tableview中加载数据。在加载数据之前,我必须做两个操作
我使用下面的代码实现了这些功能,但问题是它正在谈论很长时间在tableview中显示数据。请任何人都可以帮助我如何解决这个问题。请帮帮我。
NSArray *array = [NSArray arrayWithArray:ProductsArray];
NSArray *uniquearray = [[NSSet setWithArray:array] allObjects];
ProductsArray=[NSMutableArray arrayWithArray:uniquearray];
// Sort Based on Product name and SKU Number
NSSortDescriptor *ProductDescription = [[NSSortDescriptor alloc] initWithKey:@"Product" ascending:YES];
// String are alphabetized in ascending order
NSSortDescriptor *SKUDescription = [[NSSortDescriptor alloc] initWithKey:@"SKU" ascending:YES];
// Combine the two
NSArray *sortDescriptors = @[ProductDescription, SKUDescription];
// Sort your array
NSArray *sortedArray = [ProductsArray sortedArrayUsingDescriptors:sortDescriptors];
ProductsArray=[NSMutableArray arrayWithArray:sortedArray];