From 20476368637bc63da1eb375685ab5a840afe9670 Mon Sep 17 00:00:00 2001 From: Maximilian Szengel Date: Fri, 17 Jan 2014 15:59:18 +0100 Subject: [PATCH 1/8] Change stream scheduling run loop mode. Change the mode for stream scheduling to NSRunLoopCommonModes, which does not stall when the application is modal or in background. --- Core/Source/DTBonjourDataConnection.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/Source/DTBonjourDataConnection.m b/Core/Source/DTBonjourDataConnection.m index c615ae1..a9379ba 100644 --- a/Core/Source/DTBonjourDataConnection.m +++ b/Core/Source/DTBonjourDataConnection.m @@ -213,8 +213,8 @@ - (BOOL)openWithTimeout:(CGFloat)timeout { [_inputStream setDelegate:self]; [_outputStream setDelegate:self]; - [_inputStream scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; - [_outputStream scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; + [_inputStream scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes]; + [_outputStream scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes]; [_inputStream open]; [_outputStream open]; @@ -247,8 +247,8 @@ - (void)close [_outputStream setDelegate:nil]; [_inputStream close]; [_outputStream close]; - [_inputStream removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; - [_outputStream removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; + [_inputStream removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes]; + [_outputStream removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes]; _inputStream = nil; _outputStream = nil; From fa8ac381f3de96a48f58baa0b57bae0ac66c16db Mon Sep 17 00:00:00 2001 From: gugmaster Date: Thu, 3 Apr 2014 10:16:24 +0200 Subject: [PATCH 2/8] Fixed compiler warnings --- DTBonjour.xcodeproj/project.pbxproj | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/DTBonjour.xcodeproj/project.pbxproj b/DTBonjour.xcodeproj/project.pbxproj index a66e993..9cfef28 100644 --- a/DTBonjour.xcodeproj/project.pbxproj +++ b/DTBonjour.xcodeproj/project.pbxproj @@ -195,7 +195,7 @@ A719021116A7F5E300C1EC52 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastUpgradeCheck = 0510; ORGANIZATIONNAME = "Drobnik KG"; }; buildConfigurationList = A719021416A7F5E300C1EC52 /* Build configuration list for PBXProject "DTBonjour" */; @@ -352,7 +352,6 @@ A719029416A7F93000C1EC52 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -367,7 +366,6 @@ A719029516A7F93000C1EC52 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_ENABLE_OBJC_EXCEPTIONS = YES; From 752199852802e4d353ff4b83980ee84a865180c8 Mon Sep 17 00:00:00 2001 From: gugmaster Date: Thu, 3 Apr 2014 14:03:01 +0200 Subject: [PATCH 3/8] Changed timeout variable type to NSTimeInterval, fixes #6 --- Core/Source/DTBonjourDataConnection.h | 4 ++-- Core/Source/DTBonjourDataConnection.m | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/Source/DTBonjourDataConnection.h b/Core/Source/DTBonjourDataConnection.h index 07eb3e8..41123df 100644 --- a/Core/Source/DTBonjourDataConnection.h +++ b/Core/Source/DTBonjourDataConnection.h @@ -26,7 +26,7 @@ typedef NS_ENUM(NSUInteger, DTBonjourDataConnectionContentType) }; extern NSString * DTBonjourDataConnectionErrorDomain; -extern CGFloat DTBonjourDataConnectionDefaultTimeout; +extern NSTimeInterval DTBonjourDataConnectionDefaultTimeout; @class DTBonjourDataConnection, DTBonjourDataChunk; @@ -154,7 +154,7 @@ extern CGFloat DTBonjourDataConnectionDefaultTimeout; @param timeout Timeout in seconds after which to cancel the stream opening. @returns `YES` if the connection could be established. */ -- (BOOL)openWithTimeout:(CGFloat)timeout; +- (BOOL)openWithTimeout:(NSTimeInterval)timeout; /** Closes the connection diff --git a/Core/Source/DTBonjourDataConnection.m b/Core/Source/DTBonjourDataConnection.m index a9379ba..e3ebbc2 100644 --- a/Core/Source/DTBonjourDataConnection.m +++ b/Core/Source/DTBonjourDataConnection.m @@ -14,7 +14,7 @@ #define kDTBonjourQNetworkAdditionsCheckSEL NSSelectorFromString(@"netService:didAcceptConnectionWithInputStream:outputStream:") -CGFloat DTBonjourDataConnectionDefaultTimeout = 60.0; +NSTimeInterval DTBonjourDataConnectionDefaultTimeout = 60.0; NSString * DTBonjourDataConnectionErrorDomain = @"DTBonjourDataConnection"; @interface NSNetService (QNetworkAdditions) From d9a718043526d839c4ba3e1ffd6c7896f2f914ff Mon Sep 17 00:00:00 2001 From: gugmaster Date: Thu, 3 Apr 2014 14:04:36 +0200 Subject: [PATCH 4/8] Performed changes recommended by Xcode 5.1 upgrade check, closes #7 --- DTBonjour.xcodeproj/project.pbxproj | 2 -- .../xcshareddata/xcschemes/DTBonjour (OS X).xcscheme | 2 +- .../xcshareddata/xcschemes/DTBonjour (iOS).xcscheme | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/DTBonjour.xcodeproj/project.pbxproj b/DTBonjour.xcodeproj/project.pbxproj index 9cfef28..fab3d2a 100644 --- a/DTBonjour.xcodeproj/project.pbxproj +++ b/DTBonjour.xcodeproj/project.pbxproj @@ -330,7 +330,6 @@ A719022816A7F5E300C1EC52 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; DSTROOT = /tmp/DTBonjour.dst; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Core/DTBonjour-Prefix.pch"; @@ -341,7 +340,6 @@ A719022916A7F5E300C1EC52 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; DSTROOT = /tmp/DTBonjour.dst; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "Core/DTBonjour-Prefix.pch"; diff --git a/DTBonjour.xcodeproj/xcshareddata/xcschemes/DTBonjour (OS X).xcscheme b/DTBonjour.xcodeproj/xcshareddata/xcschemes/DTBonjour (OS X).xcscheme index 48d1e16..c3cd7a5 100644 --- a/DTBonjour.xcodeproj/xcshareddata/xcschemes/DTBonjour (OS X).xcscheme +++ b/DTBonjour.xcodeproj/xcshareddata/xcschemes/DTBonjour (OS X).xcscheme @@ -1,6 +1,6 @@ Date: Thu, 3 Apr 2014 14:49:20 +0200 Subject: [PATCH 5/8] hange CGFloat in openWithTimeout method to NSTimeInterval in .m file close #8 --- Core/Source/DTBonjourDataConnection.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/Source/DTBonjourDataConnection.m b/Core/Source/DTBonjourDataConnection.m index e3ebbc2..6b125f7 100644 --- a/Core/Source/DTBonjourDataConnection.m +++ b/Core/Source/DTBonjourDataConnection.m @@ -209,7 +209,7 @@ - (void)dealloc [self close]; } -- (BOOL)openWithTimeout:(CGFloat)timeout +- (BOOL)openWithTimeout:(NSTimeInterval)timeout { [_inputStream setDelegate:self]; [_outputStream setDelegate:self]; From aa02f4fbe516bf6ee3efa109904e99bca9401a6d Mon Sep 17 00:00:00 2001 From: Luis von der Eltz Date: Thu, 14 Aug 2014 22:22:59 +0200 Subject: [PATCH 6/8] Added Missing (?) Bool Negation qNetworkAdditions_getInputStream returns YES if operation was successful. Consequently, initWithService returns nil when NO is returned. --- Core/Source/DTBonjourDataConnection.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/Source/DTBonjourDataConnection.m b/Core/Source/DTBonjourDataConnection.m index 6b125f7..673c571 100644 --- a/Core/Source/DTBonjourDataConnection.m +++ b/Core/Source/DTBonjourDataConnection.m @@ -171,7 +171,7 @@ - (id)initWithService:(NSNetService *)service // streams see the `QNetworkAdditions` above. (If the delegate does not // implement the `kDTBonjourQNetworkAdditionsCheck` selector, we can // simply use the patched version. - if ([service qNetworkAdditions_getInputStream:&in outputStream:&out]) + if (![service qNetworkAdditions_getInputStream:&in outputStream:&out]) return nil; } else From 7e3c9bdb82990cdc37a53e3d1982814ba6275716 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Wed, 1 Oct 2014 09:36:42 +0200 Subject: [PATCH 7/8] Updated podspec version --- DTBonjour.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DTBonjour.podspec b/DTBonjour.podspec index 5c230c7..c9457a6 100644 --- a/DTBonjour.podspec +++ b/DTBonjour.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'DTBonjour' - spec.version = '1.1.0' + spec.version = '1.1.1' spec.summary = "Client/Server Communication of NSObjects over WiFi." spec.homepage = "https://github.com/Cocoanetics/DTBonjour" spec.author = { "Oliver Drobnik" => "oliver@drobnik.com" } From 7999c045c807d9c4bdcdacf7d8627498d8bd0fb0 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Wed, 1 Oct 2014 09:40:51 +0200 Subject: [PATCH 8/8] Updated change log --- Documentation/Change Log-template.markdown | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/Change Log-template.markdown b/Documentation/Change Log-template.markdown index bbff6a8..4bdd433 100644 --- a/Documentation/Change Log-template.markdown +++ b/Documentation/Change Log-template.markdown @@ -3,6 +3,12 @@ Change Log This is the history of version updates. +**Version 1.1.1** + +- FIXED: Various Xcode warnings +- FIXED: Issue when initializing on older iOS (<7.0) or OSX (<10.9) version +- CHANGED: run loop scheduling to common modes + **Version 1.1.0** - FIXED: Various type warnings