Fixed some deprecated api warnings.

This commit is contained in:
Damiano Galassi committed 2016-10-13 10:54:17 +02:00
1 parent 7dcf857660
commit 5083abe3ed
12 files changed
+74 -88

No files matched your search

+3 -21
View File
@@ -11,16 +11,8 @@
#import "SBChapterDB.h"
@interface SBChapterImporter ()
@property (atomic, readwrite) BOOL isCancelled;
@end
@implementation SBChapterImporter
@synthesize isCancelled = _isCancelled;
+ (NSString *)defaultProvider
{
return @"ChapterDB";
@@ -36,22 +28,12 @@
- (void)searchTitle:(NSString *)title language:(nullable NSString *)language duration:(NSUInteger)duration completionHandler:(void(^)(NSArray<SBChapterResult *> *results))handler
{
dispatch_async(dispatch_get_global_queue(0, 0), ^{
NSArray *results = [self searchTitle:title language:language duration:duration];
dispatch_async(dispatch_get_main_queue(), ^{
if (!self.isCancelled) {
handler(results);
}
});
});
@throw [NSException exceptionWithName:NSInternalInconsistencyException
reason:[NSString stringWithFormat:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)]
userInfo:nil];
}
- (void)cancel
{
self.isCancelled = YES;
}
- (NSArray<SBChapterResult *> *)searchTitle:(NSString *)title language:(nullable NSString *)language duration:(NSUInteger)duration
{
@throw [NSException exceptionWithName:NSInternalInconsistencyException
reason:[NSString stringWithFormat:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)]