📄 myuiwindow.m
字号:
#import "MyUIWindow.h"#import "SortDescriptorAppDelegate.h"@implementation MyUIWindow- (void)sortByName:(id)sender{ SortDescriptorAppDelegate* delegate = [[UIApplication sharedApplication] delegate]; NSSortDescriptor* nameDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"name_" ascending:YES selector:@selector(localizedCaseInsensitiveCompare:)] autorelease]; NSArray* sortDescriptors = [NSArray arrayWithObject:nameDescriptor]; NSArray* sortedArray = [delegate.employeeArray_ sortedArrayUsingDescriptors:sortDescriptors];}- (void)sortByAge:(id)sender{ SortDescriptorAppDelegate* delegate = [[UIApplication sharedApplication] delegate]; NSSortDescriptor* ageDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"age_" ascending:NO] autorelease]; NSArray* sortDescriptors = [NSArray arrayWithObject:ageDescriptor]; NSArray* sortedArray = [delegate.employeeArray_ sortedArrayUsingDescriptors:sortDescriptors]; }@end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -