How do you enable ARC project-wide in Xcode 4.2

“ARC is available in Xcode 4.2, currently in beta, and only when compiling with Clang (a.k.a. “Apple LLVM compiler”). The setting is called, obviously enough, “Objective-C Automatic Reference Counting”. Turn it on, and off you go. If you’re working on existing code, changing this setting will produce an enormous quantity of errors. ARC not only … Read more

How to enable iPod controls in the background to control non-iPod music in iOS 4?

Problem is solved. In short, to enable remote control event, 1) use : – (void)remoteControlReceivedWithEvent:(UIEvent *)theEvent and 2) put this is your view controller : – (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [[UIApplication sharedApplication] beginReceivingRemoteControlEvents]; [self becomeFirstResponder]; } – (BOOL)canBecomeFirstResponder { return YES; } I have to give credit to Grant. He has forked Matt Gallagher’s AudioStreamer … Read more

Using [UIColor colorWithRed:green:blue:alpha:] doesn’t work with UITableView seperatorColor?

You need to divide by 255.0 Because I hardly ever use values between 1.0 and 0.0, I created a very simple UIColor category that does the messy looking division by itself: (from http://github.com/Jon889/JPGeneral) //.h file @interface UIColor (JPExtras) + (UIColor *)colorWithR:(CGFloat)red G:(CGFloat)green B:(CGFloat)blue A:(CGFloat)alpha; @end //.m file @implementation UIColor (JPExtras) + (UIColor *)colorWithR:(CGFloat)red G:(CGFloat)green B:(CGFloat)blue … Read more