This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Building libplist..." | |
git clone http://cgit.sukimashita.com/libplist.git/ > /dev/null | |
cd libplist | |
mkdir build | |
cd build | |
cmake --prefix=/usr .. | |
make | |
sudo make install | |
cd ../../ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__blockNSUInteger selectedIndex = 0; | |
NSUInteger foundIndex = [arrSelectedExecindexOfObjectPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop) { | |
if ([[(NSDictionary *)obj objectForKey:@"employeeId"] longLongValue] == [[[arrData objectAtIndex:indexPath.row] objectForKey:@"employeeId"] longLongValue]) { | |
*stop = YES; | |
selectedIndex = idx; | |
returnYES; | |
} | |
returnNO; | |
}]; | |
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BOOL isHaveSelected = NO; | |
for (NSDictionary *dicEmployeeInfo inarrSelectedExec) { | |
if ([[dicEmployeeInfo objectForKey:@"employeeId"] longLongValue] == [[[arrData objectAtIndex:indexPath.row] objectForKey:@"employeeId"] longLongValue]) { | |
isHaveSelected = YES; | |
[arrSelectedExecremoveObject:dicEmployeeInfo]; | |
//... do something | |
break; | |
} | |
continue; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void sortArrayOfDictionary { | |
NSArray *arr = [NSArray arrayWithObjects: | |
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:5], @"a", [NSNumber numberWithInt:5], @"b",nil], | |
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:6], @"a", [NSNumber numberWithInt:2], @"b",nil], | |
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:2], @"a", [NSNumber numberWithInt:7], @"b",nil], | |
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:5], @"a", [NSNumber numberWithInt:2], @"b",nil], | |
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:1], @"a", [NSNumber numberWithInt:0], @"b",nil], | |
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:5], @"a", [NSNumber numberWithInt:1], @"b",nil], | |
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:6], @"a", [NSNumber numberWithInt:1], @"b",nil |