Convert alloc/init to new to please linter

This commit is contained in:
Nick Lockwood
2015-08-17 07:35:34 -07:00
parent 869ff92dbc
commit 8d1e02b8bd
74 changed files with 172 additions and 172 deletions

View File

@@ -94,7 +94,7 @@ RCT_EXPORT_METHOD(getPhotos:(NSDictionary *)params
BOOL __block foundAfter = NO;
BOOL __block hasNextPage = NO;
BOOL __block calledCallback = NO;
NSMutableArray *assets = [[NSMutableArray alloc] init];
NSMutableArray *assets = [NSMutableArray new];
[_bridge.assetsLibrary enumerateGroupsWithTypes:groupTypes usingBlock:^(ALAssetsGroup *group, BOOL *stopGroups) {
if (group && (groupName == nil || [groupName isEqualToString:[group valueForProperty:ALAssetsGroupPropertyName]])) {

View File

@@ -30,7 +30,7 @@ RCT_EXPORT_MODULE()
static RCTImageDownloader *sharedInstance;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedInstance = [[RCTImageDownloader alloc] init];
sharedInstance = [RCTImageDownloader new];
});
return sharedInstance;
}

View File

@@ -114,7 +114,7 @@ static UIImage *RCTScaledImageForAsset(ALAssetRepresentation *representation,
- (ALAssetsLibrary *)assetsLibrary
{
if (!_assetsLibrary) {
_assetsLibrary = [[ALAssetsLibrary alloc] init];
_assetsLibrary = [ALAssetsLibrary new];
}
return _assetsLibrary;
}
@@ -181,7 +181,7 @@ static UIImage *RCTScaledImageForAsset(ALAssetRepresentation *representation,
PHAsset *asset = [results firstObject];
PHImageRequestOptions *imageOptions = [[PHImageRequestOptions alloc] init];
PHImageRequestOptions *imageOptions = [PHImageRequestOptions new];
BOOL useMaximumSize = CGSizeEqualToSize(size, CGSizeZero);
CGSize targetSize;

View File

@@ -31,9 +31,9 @@ RCT_EXPORT_MODULE(ImagePickerIOS);
- (instancetype)init
{
if ((self = [super init])) {
_pickers = [[NSMutableArray alloc] init];
_pickerCallbacks = [[NSMutableArray alloc] init];
_pickerCancelCallbacks = [[NSMutableArray alloc] init];
_pickers = [NSMutableArray new];
_pickerCallbacks = [NSMutableArray new];
_pickerCancelCallbacks = [NSMutableArray new];
}
return self;
}
@@ -56,7 +56,7 @@ RCT_EXPORT_METHOD(openCameraDialog:(NSDictionary *)config
UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];
UIViewController *rootViewController = keyWindow.rootViewController;
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
UIImagePickerController *imagePicker = [UIImagePickerController new];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
@@ -78,11 +78,11 @@ RCT_EXPORT_METHOD(openSelectDialog:(NSDictionary *)config
UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];
UIViewController *rootViewController = keyWindow.rootViewController;
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
UIImagePickerController *imagePicker = [UIImagePickerController new];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
NSMutableArray *allowedTypes = [[NSMutableArray alloc] init];
NSMutableArray *allowedTypes = [NSMutableArray new];
if ([config[@"showImages"] boolValue]) {
[allowedTypes addObject:(NSString *)kUTTypeImage];
}

View File

@@ -26,7 +26,7 @@ RCT_EXPORT_MODULE()
if ((self = [super init])) {
// TODO: need a way to clear this store
_store = [[NSMutableDictionary alloc] init];
_store = [NSMutableDictionary new];
}
return self;
}