NSDictionary에 여러 문자열이 포함 된 배열이 여러 개 있습니다. 모든 배열을 하나의 배열로 배열에 넣고 싶습니다. 한 번에 모든 문자열을 수신하려면 어떻게해야합니까?NSArray를 사용하여 NSDictionary의 값을 사전 순 정렬 할 수 있습니까?
NSString *path = [[NSBundle mainBundle] pathForResource:@"firstTableView" ofType:@"plist"];
self.firstTableView = [NSDictionary dictionaryWithContentsOfFile:path];
효과 :이 나에게 NSLog의 목록을 제공하지만, 알파벳 순서가 아닌
NSMutableArray *mutarr = [[NSMutableArray alloc] initWithObjects:[self.firstTableView allValues], nil];
NSArray *mySorted = [[NSArray alloc]init];
mySorted = [mutarr sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
NSLog(@"First table view values: %@", mySorted);
참고 : self.firsttableview이 같이있는 NSDictionary이다 나는 이것을 시도했습니다.
설명을 기반으로하면 배열 배열이되며 문자열 배열이 아닙니다. – Wain
감사합니다. 편집 됨. –
고마워요. 저에게 도움이되었습니다. –