xcode4.2
How to enable/ disable “Automatic Reference Counting”?
Globally: Go to “Build Settings”, look for “Apple LLVM compiler 3.0 – Language”. Set the field “Objective-C Automatic Reference Counting” to “No”. For individual files: Go to “Build Phases”, select the file, double-click the “Compiler Flags” column and put “-fno-objc-arc” in it.
@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
iPhone/iPod Touch: application executable is missing a required architecture
For some reason the default architecture settings with xCode 4.2 is only for armv7. Go to Target -> Build Settings -> Architectures -> Release on value dropdown pick “Other…”, remove $(ARCHS_STANDARD_32_BIT), and add 2 rows first with “armv6” and second “armv7” Done
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
App submission failed due to icon dimensions (0 x 0)
According to this solution https://devforums.apple.com/message/612098#612098 make this steps: Install ApplicationLoader_2.5.1.dmg (Just install it, you don’t need to launch/use it) Quit & restart Xcode Clean Project Archive (again) Validate/Submit now works This solution fixed my problems with submission.
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.