Fred Collins
Fred Collins

Reputation: 5010

Developing iOS 4.x apps with XCode 4.2

I started new project in XCode 4.2 without "Automatic Reference Counting" and without "Use Storyboard".

I chose a "Single View App" in the app template selection.

My AppDelegate.h contains:

#import <UIKit/UIKit.h>

@class ViewController;

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@property (strong, nonatomic) ViewController *viewController;

@end

But the strong value is allowed in iOS 4.x devices? If not how can I create apps for iOS4+ with the new XCode 4.2? Of course without downgrade XCode.

Thank you. Cheers.

Upvotes: 1

Views: 755

Answers (2)

Dennis Bliefernicht
Dennis Bliefernicht

Reputation: 5157

strong is allowed in iOS 4 applications (with ARC turned on) although you can use the old retain in your non-ARC project. An important setting is to set your Deployment Target to the lowest iOS version that you want to support (e.g. 4.0) and not to use any APIs that are not available in that version. Besides that everything should be fine and you can use Xcode 4.2 to develop iOS 4 compatible apps.

Upvotes: 1

Koby
Koby

Reputation: 7367

Replace strong with retain since you're not using Automatic Reference Counting.

Upvotes: 3

Related Questions