Skip to content

Instantly share code, notes, and snippets.

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 ../../
@chisj
chisj / block_test.m
Created October 30, 2012 08:56
block_test
__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];
@chisj
chisj / gist:3979099
Created October 30, 2012 08:55
testobjectc.m
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;
}
@chisj
chisj / sortArrayOfDictionary.m
Created October 23, 2012 01:50
Object-C Sort Array of Dictionary
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