Commit 328d1fc6 authored by yuzheng.tz's avatar yuzheng.tz

消灭一些block相关警告

parent 78bd70f6
......@@ -446,7 +446,7 @@
900E65741C2BB8D5003D9A9E /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0720;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = "谭真";
TargetAttributes = {
900E657B1C2BB8D5003D9A9E = {
......@@ -647,17 +647,28 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
......@@ -690,17 +701,28 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
......@@ -833,7 +855,7 @@
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
......@@ -873,7 +895,7 @@
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
......@@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
......@@ -37,7 +36,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
......
......@@ -32,7 +32,7 @@
self.representedAssetIdentifier = [[TZImageManager manager] getAssetIdentifier:model.asset];
}
int32_t imageRequestID = [[TZImageManager manager] getPhotoWithAsset:model.asset photoWidth:self.tz_width completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
if (_progressView) {
if (self->_progressView) {
self.progressView.hidden = YES;
self.imageView.alpha = 1.0;
}
......@@ -132,11 +132,11 @@
- (void)fetchBigImage {
_bigImageRequestID = [[TZImageManager manager] getPhotoWithAsset:_model.asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
if (_progressView) {
if (self->_progressView) {
[self hideProgressView];
}
} progressHandler:^(double progress, NSError *error, BOOL *stop, NSDictionary *info) {
if (_model.isSelected) {
if (self->_model.isSelected) {
progress = progress > 0.02 ? progress : 0.02;;
self.progressView.progress = progress;
self.progressView.hidden = NO;
......
......@@ -35,8 +35,8 @@
_result = result;
if (needFetchAssets) {
[[TZImageManager manager] getAssetsFromFetchResult:result completion:^(NSArray<TZAssetModel *> *models) {
_models = models;
if (_selectedModels) {
self->_models = models;
if (self->_selectedModels) {
[self checkSelectedModels];
}
}];
......
......@@ -540,7 +540,7 @@ static dispatch_once_t onceToken;
dispatch_async(dispatch_get_main_queue(), ^{
if (completion) completion(thumbnailImage,nil,YES);
if (photoWidth == TZScreenWidth || photoWidth == _photoPreviewMaxWidth) {
if (photoWidth == TZScreenWidth || photoWidth == self->_photoPreviewMaxWidth) {
dispatch_async(dispatch_get_global_queue(0,0), ^{
ALAssetRepresentation *assetRep = [alAsset defaultRepresentation];
CGImageRef fullScrennImageRef = [assetRep fullScreenImage];
......
......@@ -652,8 +652,8 @@
TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController;
[[TZImageManager manager] getAllAlbums:imagePickerVc.allowPickingVideo allowPickingImage:imagePickerVc.allowPickingImage needFetchAssets:!self.isFirstAppear completion:^(NSArray<TZAlbumModel *> *models) {
dispatch_async(dispatch_get_main_queue(), ^{
_albumArr = [NSMutableArray arrayWithArray:models];
for (TZAlbumModel *albumModel in _albumArr) {
self->_albumArr = [NSMutableArray arrayWithArray:models];
for (TZAlbumModel *albumModel in self->_albumArr) {
albumModel.selectedModels = imagePickerVc.selectedModels;
}
[imagePickerVc hideProgressHUD];
......@@ -663,16 +663,16 @@
[self configTableView];
}
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
_tableView.rowHeight = 70;
_tableView.tableFooterView = [[UIView alloc] init];
_tableView.dataSource = self;
_tableView.delegate = self;
[_tableView registerClass:[TZAlbumCell class] forCellReuseIdentifier:@"TZAlbumCell"];
[self.view addSubview:_tableView];
if (!self->_tableView) {
self->_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
self->_tableView.rowHeight = 70;
self->_tableView.tableFooterView = [[UIView alloc] init];
self->_tableView.dataSource = self;
self->_tableView.delegate = self;
[self->_tableView registerClass:[TZAlbumCell class] forCellReuseIdentifier:@"TZAlbumCell"];
[self.view addSubview:self->_tableView];
} else {
[_tableView reloadData];
[self->_tableView reloadData];
}
});
}];
......
......@@ -67,7 +67,7 @@
if (_geocodeBlock && locations.count) {
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder reverseGeocodeLocation:[locations firstObject] completionHandler:^(NSArray *array, NSError *error) {
_geocodeBlock(array);
self->_geocodeBlock(array);
}];
}
}
......
......@@ -98,20 +98,20 @@ static CGFloat itemMargin = 5;
[tzImagePickerVc showProgressHUD];
}
dispatch_async(dispatch_get_global_queue(0, 0), ^{
if (!tzImagePickerVc.sortAscendingByModificationDate && _isFirstAppear && iOS8Later && _model.isCameraRoll) {
if (!tzImagePickerVc.sortAscendingByModificationDate && self->_isFirstAppear && iOS8Later && self->_model.isCameraRoll) {
[[TZImageManager manager] getCameraRollAlbum:tzImagePickerVc.allowPickingVideo allowPickingImage:tzImagePickerVc.allowPickingImage needFetchAssets:YES completion:^(TZAlbumModel *model) {
_model = model;
_models = [NSMutableArray arrayWithArray:_model.models];
self->_model = model;
self->_models = [NSMutableArray arrayWithArray:self->_model.models];
[self initSubviews];
}];
} else {
if (_showTakePhotoBtn || !iOS8Later || _isFirstAppear) {
[[TZImageManager manager] getAssetsFromFetchResult:_model.result completion:^(NSArray<TZAssetModel *> *models) {
_models = [NSMutableArray arrayWithArray:models];
if (self->_showTakePhotoBtn || !iOS8Later || self->_isFirstAppear) {
[[TZImageManager manager] getAssetsFromFetchResult:self->_model.result completion:^(NSArray<TZAssetModel *> *models) {
self->_models = [NSMutableArray arrayWithArray:models];
[self initSubviews];
}];
} else {
_models = [NSMutableArray arrayWithArray:_model.models];
self->_models = [NSMutableArray arrayWithArray:self->_model.models];
[self initSubviews];
}
}
......@@ -125,7 +125,7 @@ static CGFloat itemMargin = 5;
[self checkSelectedModels];
[self configCollectionView];
_collectionView.hidden = YES;
self->_collectionView.hidden = YES;
[self configBottomToolBar];
[self scrollCollectionViewToBottom];
......@@ -662,7 +662,7 @@ static CGFloat itemMargin = 5;
}
TZImagePickerController *imagePickerVc = (TZImagePickerController *)self.navigationController;
[[TZImageManager manager] getPhotosBytesWithArray:imagePickerVc.selectedModels completion:^(NSString *totalBytes) {
_originalPhotoLabel.text = [NSString stringWithFormat:@"(%@)",totalBytes];
self->_originalPhotoLabel.text = [NSString stringWithFormat:@"(%@)",totalBytes];
}];
}
......@@ -680,9 +680,9 @@ static CGFloat itemMargin = 5;
}
}
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[_collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:item inSection:0] atScrollPosition:UICollectionViewScrollPositionBottom animated:NO];
_shouldScrollToBottom = NO;
_collectionView.hidden = NO;
[self->_collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:item inSection:0] atScrollPosition:UICollectionViewScrollPositionBottom animated:NO];
self->_shouldScrollToBottom = NO;
self->_collectionView.hidden = NO;
});
} else {
_collectionView.hidden = NO;
......@@ -748,20 +748,20 @@ static CGFloat itemMargin = 5;
- (void)reloadPhotoArray {
TZImagePickerController *tzImagePickerVc = (TZImagePickerController *)self.navigationController;
[[TZImageManager manager] getCameraRollAlbum:tzImagePickerVc.allowPickingVideo allowPickingImage:tzImagePickerVc.allowPickingImage needFetchAssets:NO completion:^(TZAlbumModel *model) {
_model = model;
[[TZImageManager manager] getAssetsFromFetchResult:_model.result completion:^(NSArray<TZAssetModel *> *models) {
self->_model = model;
[[TZImageManager manager] getAssetsFromFetchResult:self->_model.result completion:^(NSArray<TZAssetModel *> *models) {
[tzImagePickerVc hideProgressHUD];
TZAssetModel *assetModel;
if (tzImagePickerVc.sortAscendingByModificationDate) {
assetModel = [models lastObject];
if (assetModel.type != TZAssetModelMediaTypeVideo || tzImagePickerVc.allowPickingMultipleVideo) {
[_models addObject:assetModel];
[self->_models addObject:assetModel];
}
} else {
assetModel = [models firstObject];
if (assetModel.type != TZAssetModelMediaTypeVideo || tzImagePickerVc.allowPickingMultipleVideo) {
[_models insertObject:assetModel atIndex:0];
[self->_models insertObject:assetModel atIndex:0];
}
}
......@@ -769,11 +769,11 @@ static CGFloat itemMargin = 5;
if (tzImagePickerVc.allowCrop) {
TZPhotoPreviewController *photoPreviewVc = [[TZPhotoPreviewController alloc] init];
if (tzImagePickerVc.sortAscendingByModificationDate) {
photoPreviewVc.currentIndex = _models.count - 1;
photoPreviewVc.currentIndex = self->_models.count - 1;
} else {
photoPreviewVc.currentIndex = 0;
}
photoPreviewVc.models = _models;
photoPreviewVc.models = self->_models;
[self pushPhotoPrevireViewController:photoPreviewVc];
} else {
[tzImagePickerVc.selectedModels addObject:assetModel];
......@@ -787,10 +787,10 @@ static CGFloat itemMargin = 5;
[tzImagePickerVc.selectedModels addObject:assetModel];
[self refreshBottomToolBarStatus];
}
_collectionView.hidden = YES;
[_collectionView reloadData];
self->_collectionView.hidden = YES;
[self->_collectionView reloadData];
_shouldScrollToBottom = YES;
self->_shouldScrollToBottom = YES;
[self scrollCollectionViewToBottom];
}];
}];
......
......@@ -175,10 +175,10 @@
_asset = asset;
self.imageRequestID = [[TZImageManager manager] getPhotoWithAsset:asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
if (![asset isEqual:_asset]) return;
if (![asset isEqual:self->_asset]) return;
self.imageView.image = photo;
[self resizeSubviews];
_progressView.hidden = YES;
self->_progressView.hidden = YES;
if (self.imageProgressUpdateBlock) {
self.imageProgressUpdateBlock(1);
}
......@@ -186,17 +186,17 @@
self.imageRequestID = 0;
}
} progressHandler:^(double progress, NSError *error, BOOL *stop, NSDictionary *info) {
if (![asset isEqual:_asset]) return;
_progressView.hidden = NO;
[self bringSubviewToFront:_progressView];
if (![asset isEqual:self->_asset]) return;
self->_progressView.hidden = NO;
[self bringSubviewToFront:self->_progressView];
progress = progress > 0.02 ? progress : 0.02;
_progressView.progress = progress;
self->_progressView.progress = progress;
if (self.imageProgressUpdateBlock && progress < 1) {
self.imageProgressUpdateBlock(progress);
}
if (progress >= 1) {
_progressView.hidden = YES;
self->_progressView.hidden = YES;
self.imageRequestID = 0;
}
} networkAccessAllowed:YES];
......@@ -358,17 +358,17 @@
}
[[TZImageManager manager] getPhotoWithAsset:self.model.asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
_cover = photo;
self->_cover = photo;
}];
[[TZImageManager manager] getVideoWithAsset:self.model.asset completion:^(AVPlayerItem *playerItem, NSDictionary *info) {
dispatch_async(dispatch_get_main_queue(), ^{
_player = [AVPlayer playerWithPlayerItem:playerItem];
_playerLayer = [AVPlayerLayer playerLayerWithPlayer:_player];
_playerLayer.backgroundColor = [UIColor blackColor].CGColor;
_playerLayer.frame = self.bounds;
[self.layer addSublayer:_playerLayer];
self->_player = [AVPlayer playerWithPlayerItem:playerItem];
self->_playerLayer = [AVPlayerLayer playerLayerWithPlayer:_player];
self->_playerLayer.backgroundColor = [UIColor blackColor].CGColor;
self->_playerLayer.frame = self.bounds;
[self.layer addSublayer:self->_playerLayer];
[self configPlayButton];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pausePlayerAndShowNaviBar) name:AVPlayerItemDidPlayToEndTimeNotification object:_player.currentItem];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pausePlayerAndShowNaviBar) name:AVPlayerItemDidPlayToEndTimeNotification object:self->_player.currentItem];
});
}];
}
......
......@@ -510,7 +510,7 @@
- (void)showPhotoBytes {
[[TZImageManager manager] getPhotosBytesWithArray:@[_models[_currentIndex]] completion:^(NSString *totalBytes) {
_originalPhotoLabel.text = [NSString stringWithFormat:@"(%@)",totalBytes];
self->_originalPhotoLabel.text = [NSString stringWithFormat:@"(%@)",totalBytes];
}];
}
......
......@@ -60,20 +60,20 @@
- (void)configMoviePlayer {
[[TZImageManager manager] getPhotoWithAsset:_model.asset completion:^(UIImage *photo, NSDictionary *info, BOOL isDegraded) {
if (!isDegraded && photo) {
_cover = photo;
_doneButton.enabled = YES;
self->_cover = photo;
self->_doneButton.enabled = YES;
}
}];
[[TZImageManager manager] getVideoWithAsset:_model.asset completion:^(AVPlayerItem *playerItem, NSDictionary *info) {
dispatch_async(dispatch_get_main_queue(), ^{
_player = [AVPlayer playerWithPlayerItem:playerItem];
_playerLayer = [AVPlayerLayer playerLayerWithPlayer:_player];
_playerLayer.frame = self.view.bounds;
[self.view.layer addSublayer:_playerLayer];
self->_player = [AVPlayer playerWithPlayerItem:playerItem];
self->_playerLayer = [AVPlayerLayer playerLayerWithPlayer:self->_player];
self->_playerLayer.frame = self.view.bounds;
[self.view.layer addSublayer:self->_playerLayer];
[self addProgressObserver];
[self configPlayButton];
[self configBottomToolBar];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pausePlayerAndShowNaviBar) name:AVPlayerItemDidPlayToEndTimeNotification object:_player.currentItem];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pausePlayerAndShowNaviBar) name:AVPlayerItemDidPlayToEndTimeNotification object:self->_player.currentItem];
});
}];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment