From 302bd5eeb00fb77599a0423b321ab84e442950dd Mon Sep 17 00:00:00 2001 From: Michael Waterfall Date: Tue, 17 Dec 2013 15:44:38 +0000 Subject: [PATCH] Added arm64 support. Changed deployment target to 5.1.1. Fixes #178 --- Demo/PhotoBrowserDemo.xcodeproj/project.pbxproj | 6 ++++-- Demo/PhotoBrowserDemo/Menu.m | 4 ++-- MWPhotoBrowser/Classes/MWPhotoBrowser.m | 12 ++++++------ .../SDWebImage/SDWebImage/SDWebImagePrefetcher.m | 6 +++--- .../MWPhotoBrowser.xcodeproj/project.pbxproj | 12 ++++++------ README.markdown | 2 +- 6 files changed, 22 insertions(+), 20 deletions(-) diff --git a/Demo/PhotoBrowserDemo.xcodeproj/project.pbxproj b/Demo/PhotoBrowserDemo.xcodeproj/project.pbxproj index f3525eb34..4e63b2496 100644 --- a/Demo/PhotoBrowserDemo.xcodeproj/project.pbxproj +++ b/Demo/PhotoBrowserDemo.xcodeproj/project.pbxproj @@ -344,6 +344,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -368,7 +369,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -379,6 +380,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -396,7 +398,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/Demo/PhotoBrowserDemo/Menu.m b/Demo/PhotoBrowserDemo/Menu.m index 385e7b759..0efa2ad4a 100644 --- a/Demo/PhotoBrowserDemo/Menu.m +++ b/Demo/PhotoBrowserDemo/Menu.m @@ -1114,7 +1114,7 @@ - (NSUInteger)numberOfPhotosInPhotoBrowser:(MWPhotoBrowser *)photoBrowser { //} - (void)photoBrowser:(MWPhotoBrowser *)photoBrowser didDisplayPhotoAtIndex:(NSUInteger)index { - NSLog(@"Did start viewing photo at index %i", index); + NSLog(@"Did start viewing photo at index %lu", (unsigned long)index); } - (BOOL)photoBrowser:(MWPhotoBrowser *)photoBrowser isPhotoSelectedAtIndex:(NSUInteger)index { @@ -1123,7 +1123,7 @@ - (BOOL)photoBrowser:(MWPhotoBrowser *)photoBrowser isPhotoSelectedAtIndex:(NSUI - (void)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index selectedChanged:(BOOL)selected { [_selections replaceObjectAtIndex:index withObject:[NSNumber numberWithBool:selected]]; - NSLog(@"Photo at index %i selected %@", index, selected ? @"YES" : @"NO"); + NSLog(@"Photo at index %lu selected %@", (unsigned long)index, selected ? @"YES" : @"NO"); } #pragma mark - Load Assets diff --git a/MWPhotoBrowser/Classes/MWPhotoBrowser.m b/MWPhotoBrowser/Classes/MWPhotoBrowser.m index 5b7b8164d..d5f0514a7 100644 --- a/MWPhotoBrowser/Classes/MWPhotoBrowser.m +++ b/MWPhotoBrowser/Classes/MWPhotoBrowser.m @@ -751,8 +751,8 @@ - (void)tilePages { // Ignore padding as paging bounces encroach on that // and lead to false page loads CGRect visibleBounds = _pagingScrollView.bounds; - int iFirstIndex = (int)floorf((CGRectGetMinX(visibleBounds)+PADDING*2) / CGRectGetWidth(visibleBounds)); - int iLastIndex = (int)floorf((CGRectGetMaxX(visibleBounds)-PADDING*2-1) / CGRectGetWidth(visibleBounds)); + NSInteger iFirstIndex = (NSInteger)floorf((CGRectGetMinX(visibleBounds)+PADDING*2) / CGRectGetWidth(visibleBounds)); + NSInteger iLastIndex = (NSInteger)floorf((CGRectGetMaxX(visibleBounds)-PADDING*2-1) / CGRectGetWidth(visibleBounds)); if (iFirstIndex < 0) iFirstIndex = 0; if (iFirstIndex > [self numberOfPhotos] - 1) iFirstIndex = [self numberOfPhotos] - 1; if (iLastIndex < 0) iLastIndex = 0; @@ -997,7 +997,7 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView { // Calculate current page CGRect visibleBounds = _pagingScrollView.bounds; - int index = (int)(floorf(CGRectGetMidX(visibleBounds) / CGRectGetWidth(visibleBounds))); + NSInteger index = (NSInteger)(floorf(CGRectGetMidX(visibleBounds) / CGRectGetWidth(visibleBounds))); if (index < 0) index = 0; if (index > [self numberOfPhotos] - 1) index = [self numberOfPhotos] - 1; NSUInteger previousCurrentPage = _currentPageIndex; @@ -1023,7 +1023,7 @@ - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { - (void)updateNavigation { // Title - NSInteger numberOfPhotos = [self numberOfPhotos]; + NSUInteger numberOfPhotos = [self numberOfPhotos]; if (_gridController) { if (_gridController.selectionMode) { self.title = NSLocalizedString(@"Select Photos", nil); @@ -1034,10 +1034,10 @@ - (void)updateNavigation { } else { photosText = NSLocalizedString(@"photos", @"Used in the context: '3 photos'"); } - self.title = [NSString stringWithFormat:@"%i %@", numberOfPhotos, photosText]; + self.title = [NSString stringWithFormat:@"%lu %@", (unsigned long)numberOfPhotos, photosText]; } } else if (numberOfPhotos > 1) { - self.title = [NSString stringWithFormat:@"%i %@ %i", _currentPageIndex+1, NSLocalizedString(@"of", @"Used in the context: 'Showing 1 of 3 items'"), numberOfPhotos]; + self.title = [NSString stringWithFormat:@"%lu %@ %lu", (unsigned long)(_currentPageIndex+1), NSLocalizedString(@"of", @"Used in the context: 'Showing 1 of 3 items'"), (unsigned long)numberOfPhotos]; } else { self.title = nil; } diff --git a/MWPhotoBrowser/Libraries/SDWebImage/SDWebImage/SDWebImagePrefetcher.m b/MWPhotoBrowser/Libraries/SDWebImage/SDWebImage/SDWebImagePrefetcher.m index c029e8d95..c60af4e0f 100755 --- a/MWPhotoBrowser/Libraries/SDWebImage/SDWebImage/SDWebImagePrefetcher.m +++ b/MWPhotoBrowser/Libraries/SDWebImage/SDWebImage/SDWebImagePrefetcher.m @@ -63,11 +63,11 @@ - (void)startPrefetchingAtIndex:(NSUInteger)index if (image) { - NSLog(@"Prefetched %d out of %d", self.finishedCount, self.prefetchURLs.count); + NSLog(@"Prefetched %lu out of %lu", (unsigned long)self.finishedCount, (unsigned long)self.prefetchURLs.count); } else { - NSLog(@"Prefetched %d out of %d (Failed)", self.finishedCount, [self.prefetchURLs count]); + NSLog(@"Prefetched %lu out of %lu (Failed)", (unsigned long)self.finishedCount, (unsigned long)[self.prefetchURLs count]); // Add last failed self.skippedCount++; @@ -92,7 +92,7 @@ - (void)startPrefetchingAtIndex:(NSUInteger)index - (void)reportStatus { NSUInteger total = [self.prefetchURLs count]; - NSLog(@"Finished prefetching (%d successful, %d skipped, timeElasped %.2f)", total - self.skippedCount, self.skippedCount, CFAbsoluteTimeGetCurrent() - self.startedTime); + NSLog(@"Finished prefetching (%lu successful, %lu skipped, timeElasped %.2f)", (unsigned long)total - self.skippedCount, (unsigned long)self.skippedCount, CFAbsoluteTimeGetCurrent() - self.startedTime); } - (void)prefetchURLs:(NSArray *)urls diff --git a/MWPhotoBrowser/MWPhotoBrowser.xcodeproj/project.pbxproj b/MWPhotoBrowser/MWPhotoBrowser.xcodeproj/project.pbxproj index c919cc73b..ac738adbf 100644 --- a/MWPhotoBrowser/MWPhotoBrowser.xcodeproj/project.pbxproj +++ b/MWPhotoBrowser/MWPhotoBrowser.xcodeproj/project.pbxproj @@ -520,14 +520,14 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD)"; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; @@ -553,7 +553,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD)"; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; @@ -567,7 +567,7 @@ GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; SDKROOT = iphoneos; }; name = Debug; @@ -576,14 +576,14 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD)"; + ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; + IPHONEOS_DEPLOYMENT_TARGET = 5.1.1; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; }; diff --git a/README.markdown b/README.markdown index b18983a36..13f92f87a 100644 --- a/README.markdown +++ b/README.markdown @@ -23,7 +23,7 @@ The browser can also be used to allow the user to select one or more photos usin [screenshot6_thumb]: https://raw.github.com/mwaterfall/MWPhotoBrowser/master/Preview/MWPhotoBrowser6t.png [screenshot6]: https://raw.github.com/mwaterfall/MWPhotoBrowser/master/Preview/MWPhotoBrowser6.png -Works on iOS 5+. All strings are localisable so they can be used in apps that support multiple languages. +Works on iOS 5.1.1+. All strings are localisable so they can be used in apps that support multiple languages. ## Usage