Convert remaining uses of alloc] init] to new]

Summary: public

We moved to using `new` instead of `alloc] init` but there was still some calls
left.

Reviewed By: javache

Differential Revision: D2604679

fb-gh-sync-id: ff7300ecbedb55dd5e93873592598810c9b87808
This commit is contained in:
Tadeu Zagallo 2015-11-02 07:58:47 -08:00 committed by facebook-github-bot-4
parent 0a28ce480e
commit ccd90e25c1
14 changed files with 17 additions and 17 deletions

View File

@ -56,7 +56,7 @@
launchOptions:launchOptions]; launchOptions:launchOptions];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [[UIViewController alloc] init]; UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView; rootViewController.view = rootView;
self.window.rootViewController = rootViewController; self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];

View File

@ -57,7 +57,7 @@
launchOptions:launchOptions]; launchOptions:launchOptions];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [[UIViewController alloc] init]; UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView; rootViewController.view = rootView;
self.window.rootViewController = rootViewController; self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];

View File

@ -56,7 +56,7 @@
launchOptions:launchOptions]; launchOptions:launchOptions];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [[UIViewController alloc] init]; UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView; rootViewController.view = rootView;
self.window.rootViewController = rootViewController; self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];

View File

@ -20,10 +20,10 @@
- (void)testLayoutSubviewsOrdering - (void)testLayoutSubviewsOrdering
{ {
// create some Views and ViewControllers // create some Views and ViewControllers
UIViewController *parentVC = [[UIViewController alloc] init]; UIViewController *parentVC = [UIViewController new];
UIView *parentView = [[UIView alloc] init]; UIView *parentView = [UIView new];
UIViewController *childVC = [[UIViewController alloc] init]; UIViewController *childVC = [UIViewController new];
UIView *childView = [[UIView alloc] init]; UIView *childView = [UIView new];
// The ordering we expect is: // The ordering we expect is:
// parentView::layoutSubviews // parentView::layoutSubviews

View File

@ -17,7 +17,7 @@ RCT_EXPORT_MODULE()
- (ARTNode *)node - (ARTNode *)node
{ {
return [[ARTGroup alloc] init]; return [ARTGroup new];
} }
@end @end

View File

@ -17,7 +17,7 @@ RCT_EXPORT_MODULE()
- (ARTNode *)node - (ARTNode *)node
{ {
return [[ARTNode alloc] init]; return [ARTNode new];
} }
- (UIView *)view - (UIView *)view

View File

@ -17,7 +17,7 @@ RCT_EXPORT_MODULE()
- (ARTRenderable *)node - (ARTRenderable *)node
{ {
return [[ARTRenderable alloc] init]; return [ARTRenderable new];
} }
RCT_EXPORT_VIEW_PROPERTY(strokeWidth, CGFloat) RCT_EXPORT_VIEW_PROPERTY(strokeWidth, CGFloat)

View File

@ -18,7 +18,7 @@ RCT_EXPORT_MODULE()
- (ARTRenderable *)node - (ARTRenderable *)node
{ {
return [[ARTShape alloc] init]; return [ARTShape new];
} }
RCT_EXPORT_VIEW_PROPERTY(d, CGPath) RCT_EXPORT_VIEW_PROPERTY(d, CGPath)

View File

@ -17,7 +17,7 @@ RCT_EXPORT_MODULE()
- (UIView *)view - (UIView *)view
{ {
return [[ARTSurfaceView alloc] init]; return [ARTSurfaceView new];
} }
@end @end

View File

@ -18,7 +18,7 @@ RCT_EXPORT_MODULE()
- (ARTRenderable *)node - (ARTRenderable *)node
{ {
return [[ARTText alloc] init]; return [ARTText new];
} }
RCT_EXPORT_VIEW_PROPERTY(alignment, CTTextAlignment) RCT_EXPORT_VIEW_PROPERTY(alignment, CTTextAlignment)

View File

@ -358,7 +358,7 @@ id RCTAlertView(NSString *title, NSString *message, id delegate, NSString *cance
return nil; return nil;
} }
UIAlertView *alertView = [[UIAlertView alloc] init]; UIAlertView *alertView = [UIAlertView new];
alertView.title = title; alertView.title = title;
alertView.message = message; alertView.message = message;
alertView.delegate = delegate; alertView.delegate = delegate;

View File

@ -338,7 +338,7 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context)
return; return;
} }
if (!strongSelf->_context) { if (!strongSelf->_context) {
JSContext *context = [[JSContext alloc] init]; JSContext *context = [JSContext new];
strongSelf->_context = [[RCTJavaScriptContext alloc] initWithJSContext:context]; strongSelf->_context = [[RCTJavaScriptContext alloc] initWithJSContext:context];
} }
[strongSelf _addNativeHook:RCTNativeLoggingHook withName:"nativeLoggingHook"]; [strongSelf _addNativeHook:RCTNativeLoggingHook withName:"nativeLoggingHook"];

View File

@ -337,7 +337,7 @@ static NSMutableArray *RCTProfileGetThreadEvents(void)
static NSString *const RCTProfileThreadEventsKey = @"RCTProfileThreadEventsKey"; static NSString *const RCTProfileThreadEventsKey = @"RCTProfileThreadEventsKey";
NSMutableArray *threadEvents = [NSThread currentThread].threadDictionary[RCTProfileThreadEventsKey]; NSMutableArray *threadEvents = [NSThread currentThread].threadDictionary[RCTProfileThreadEventsKey];
if (!threadEvents) { if (!threadEvents) {
threadEvents = [[NSMutableArray alloc] init]; threadEvents = [NSMutableArray new];
[NSThread currentThread].threadDictionary[RCTProfileThreadEventsKey] = threadEvents; [NSThread currentThread].threadDictionary[RCTProfileThreadEventsKey] = threadEvents;
} }
return threadEvents; return threadEvents;

View File

@ -47,7 +47,7 @@
launchOptions:launchOptions]; launchOptions:launchOptions];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [[UIViewController alloc] init]; UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView; rootViewController.view = rootView;
self.window.rootViewController = rootViewController; self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];