这是屏幕截图,在过去的下拉菜单中是存在的,我点击它,它表明一个我想在我的iOS应用程序中实现下面的下拉菜单功能。如何做到这一点?
但不是说,在这里我要添加排序菜单像一些菜单,
1. sort by date
2. sort by name
3. sort by ...etc
这是屏幕截图,在过去的下拉菜单中是存在的,我点击它,它表明一个我想在我的iOS应用程序中实现下面的下拉菜单功能。如何做到这一点?
但不是说,在这里我要添加排序菜单像一些菜单,
1. sort by date
2. sort by name
3. sort by ...etc
由键..名字一样短阵....把钥匙上你想你的短阵
这会短你的阵列升序
NSSortDescriptor *descriptor = [[NSSortDescriptor alloc] initWithKey:@"Your Key" ascending:YES selector:@selector(localizedStandardCompare:)];
NSArray *shortedArray=[Your array sortedArrayUsingDescriptors:[NSArray arrayWithObjects:descriptor,nil]];
这将缩短您的排列
NSSortDescriptor *descriptor = [[NSSortDescriptor alloc] initWithKey:@"Your Key" ascending:NO selector:@selector(localizedStandardCompare:)];
NSArray *shortedArray=[Your array sortedArrayUsingDescriptors:[NSArray arrayWithObjects:descriptor,nil]];
是的,正确的一.. ..! –
感谢您的帮助,但我的项目是在目标c ...!其他解决方案? –
你可以整合Swift到Obj-c.check这个链接https://stackoverflow.com/questions/24102104/how-to-import-swift-code-to-objective-c –
还有,有人告诉我,怎么能实现排序技术..! –