Replace use of -performSelector:withObject:

This commit is contained in:
Zachary Waldowski authored and Kornel Lesiński committed 2014-06-17 00:53:21 +01:00
1 parent f46d7b5c1e
commit 76ce31f2f6
2 files changed
+11 -8

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@
+ (BOOL)canUnarchivePath:(NSString *)path;
- (id)initWithPath:(NSString *)path host:(SUHost *)host;
- (void)notifyDelegateOfExtractedLength:(NSNumber *)length;
- (void)notifyDelegateOfExtractedLength:(size_t)length;
- (void)notifyDelegateOfSuccess;
- (void)notifyDelegateOfFailure;
@end
+10 -7
View File
@@ -32,22 +32,25 @@
return NO;
}
- (void)notifyDelegateOfExtractedLength:(NSNumber *)length
- (void)notifyDelegateOfExtractedLength:(size_t)length
{
if ([delegate respondsToSelector:@selector(unarchiver:extractedLength:)])
[delegate unarchiver:self extractedLength:[length unsignedLongValue]];
if ([delegate respondsToSelector:@selector(unarchiver:extractedLength:)]) {
[delegate unarchiver:self extractedLength:length];
}
}
- (void)notifyDelegateOfSuccess
{
if ([delegate respondsToSelector:@selector(unarchiverDidFinish:)])
[delegate performSelector:@selector(unarchiverDidFinish:) withObject:self];
if ([delegate respondsToSelector:@selector(unarchiverDidFinish:)]) {
[delegate unarchiverDidFinish:self];
}
}
- (void)notifyDelegateOfFailure
{
if ([delegate respondsToSelector:@selector(unarchiverDidFail:)])
[delegate performSelector:@selector(unarchiverDidFail:) withObject:self];
if ([delegate respondsToSelector:@selector(unarchiverDidFail:)]) {
[delegate unarchiverDidFail:self];
}
}
static NSMutableArray *gUnarchiverImplementations;