Skip to content

Instantly share code, notes, and snippets.

AppFeedViewController *vc = [[AppFeedViewController alloc] initFromNib];
AppFeedDataController *dataController = [[dataControllerClass alloc] initWithViewController:vc schemaString:schemaStr category:category];
[dataController release];
(gdb) print (int) [actionSheet firstOtherButtonIndex]
$3 = -1
(gdb) print (int) [actionSheet cancelButtonIndex]
$4 = -1
(gdb) print (int) [actionSheet numberOfButtons]
$5 = 1
(gdb) print (int) buttonIndex
$6 = 0
Font names for family 'Bodoni Ornaments': (
BodoniOrnamentsITCTT
)
Font names for family 'AppleGothic': (
AppleGothic
)
Font names for family 'Gill Sans': (
"GillSans-BoldItalic",
"GillSans-Bold",
GillSans,
@sbrocket
sbrocket / uncrustify_OBJC.cfg
Created February 5, 2011 08:21
An uncrustify configuration for Objective-C
indent_align_string=false
indent_braces=false
indent_braces_no_func=false
indent_brace_parent=false
indent_namespace=false
indent_extern=false
indent_class=false
indent_class_colon=false
indent_else_if=false
indent_func_call_param=false
- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath {
UITableViewCell *cell = nil;
if ([indexPath isEqual:[tableView indexPathForSelectedRow]]) {
cell = [tableView dequeueReusableCellWithIdentifier:@"SelectedCell"];
if (!cell) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"SelectedCell"] autorelease];
// Do any one-time setup for the cell here, like creating subviews you want to add to the cell
UIView *specialSelectedView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];
specialSelectedView.backgroundColor = [UIColor redColor];
- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath {
UITableViewCell *cell = nil;
if ([indexPath isEqual:[tableView indexPathForSelectedRow]]) {
cell = [tableView dequeueReusableCellWithIdentifier:@"SelectedCell"];
if (!cell) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"SelectedCell"] autorelease];
// Do any one-time setup for the cell here, like creating subviews you want to add to the cell
UIView *specialSelectedView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];
specialSelectedView.backgroundColor = [UIColor redColor];
// Works
if (self.currentScope == 1) {
cell.contentViewInsets = UIEdgeInsetsMake(0, 0, 0, 2);
} else {
cell.contentViewInsets = UIEdgeInsetsZero;
}
// Works
UIEdgeInsets inset = (self.currentScope == 1) ? UIEdgeInsetsMake(0, 0, 0, 2) : UIEdgeInsetsZero;
cell.contentViewInsets = inset;
+ (void)initialize {
if (self == [AppDataBase class]) {
void (^dateAccessorFactory)(NSString*,NSString*) = ^(NSString *key, NSString *strKey) {
void(^setterBlock)(id,NSDate*) = [^void(id self, NSDate *val) {
[self willChangeValueForKey:key];
[self setPrimitiveValue:val forKey:key];
[self setPrimitiveValue:nil forKey:strKey];
[self didChangeValueForKey:key];
} copy];
CATransition *transition = [CATransition animation];
transition.duration = 0.25f;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade;
[button.layer addAnimation:transition forKey:nil];
// Use debugLog() or debugLogPretty() to log messages to the console when the "Debug" configuration
// is used to build the project - these logging messages won't appear in a Release build.
//
// Use assertLog() for more serious conditions. On Debug builds, assertLog() will throw an assertion
// and on Release builds it will turn into a standard NSLog (in case it comes to digging through a user's
// device logs to fix something)
#ifdef DEBUG
#define _D(...) __VA_ARGS__
#define debugLog(fmt, ...) NSLog(fmt, ##__VA_ARGS__)
#define debugLogPretty(fmt, ...) NSLog(@"%s (%@:%d)\n%@", \