@autoreleasepool without ARC?

From http://clang.llvm.org/docs/AutomaticReferenceCounting.html#autoreleasepool: @autoreleasepool may be used in non-ARC translation units, with equivalent semantics. and Greg Parker says [1] [2]: LLVM 3.0’s @autoreleasepool { … } is much faster than NSAutoreleasePool if your deployment target is new enough. No ARC required. (…) always works, but it’s faster with deployment target of OS X 10.7 or iOS … Read more

Displaying a Cocoa Window as a Sheet in Xcode 4 (OSX 10.7.2) with ARC

Tutorial for Xcode 4 Create new project and add the following to AppDelegate.h and AppDelegate.m. AppDelegate.h #import <Cocoa/Cocoa.h> @interface AppDelegate : NSObject <NSApplicationDelegate> { IBOutlet NSPanel *theSheet; } @property (assign) IBOutlet NSWindow *window; @end AppDelegate.m #import “AppDelegate.h” @implementation AppDelegate @synthesize window = _window; – (IBAction) showTheSheet:(id)sender { [NSApp beginSheet:theSheet modalForWindow:(NSWindow *)_window modalDelegate:self didEndSelector:nil contextInfo:nil]; } … Read more

Xcode 4.2 iOS Empty Application and storyboards

Comment out (or remove) the window creation and display code in AppDelegate.m as follows: – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. // self.window.backgroundColor = [UIColor whiteColor]; // [self.window makeKeyAndVisible]; return YES; } When using a storyboard, a main UIWindow is … Read more

Conditional segue performed on tap on UITableViewCell

While looking Storyboard, control-drag from your source View Controller to your Destination view controller. This will create a segue that you can trigger programmatically right from your source View Controller. Ensure that you give you Segue a name. This name is what you will pass into the source View Controller’s performSegue:withIdentifier: method.