Skip to content

Commit 8d60600

Browse files
committed
fix: 修复 KVO 移除后可能出现的 crash
1 parent 8e86d37 commit 8d60600

8 files changed

Lines changed: 119 additions & 178 deletions

File tree

MTDemo/MTDemo.xcodeproj/project.pbxproj

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@
374374
A4DB9ECC1FA709A400826A8F /* Project object */ = {
375375
isa = PBXProject;
376376
attributes = {
377-
LastUpgradeCheck = 1020;
377+
LastUpgradeCheck = 1320;
378378
ORGANIZATIONNAME = "杨萧玉";
379379
TargetAttributes = {
380380
A489952E1FAE2F6200A7A58A = {
@@ -601,7 +601,7 @@
601601
DYLIB_INSTALL_NAME_BASE = "@rpath";
602602
INFOPLIST_FILE = ../MessageThrottle/Info.plist;
603603
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
604-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
604+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
605605
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
606606
PRODUCT_BUNDLE_IDENTIFIER = com.yulingtianxia.MessageThrottle;
607607
PRODUCT_NAME = MessageThrottle;
@@ -626,7 +626,7 @@
626626
DYLIB_INSTALL_NAME_BASE = "@rpath";
627627
INFOPLIST_FILE = ../MessageThrottle/Info.plist;
628628
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
629-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
629+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
630630
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
631631
PRODUCT_BUNDLE_IDENTIFIER = com.yulingtianxia.MessageThrottle;
632632
PRODUCT_NAME = MessageThrottle;
@@ -663,6 +663,7 @@
663663
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
664664
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
665665
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
666+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
666667
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
667668
CLANG_WARN_STRICT_PROTOTYPES = YES;
668669
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -688,7 +689,7 @@
688689
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
689690
GCC_WARN_UNUSED_FUNCTION = YES;
690691
GCC_WARN_UNUSED_VARIABLE = YES;
691-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
692+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
692693
MTL_ENABLE_DEBUG_INFO = YES;
693694
ONLY_ACTIVE_ARCH = YES;
694695
SDKROOT = iphoneos;
@@ -720,6 +721,7 @@
720721
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
721722
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
722723
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
724+
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
723725
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
724726
CLANG_WARN_STRICT_PROTOTYPES = YES;
725727
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -739,7 +741,7 @@
739741
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
740742
GCC_WARN_UNUSED_FUNCTION = YES;
741743
GCC_WARN_UNUSED_VARIABLE = YES;
742-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
744+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
743745
MTL_ENABLE_DEBUG_INFO = NO;
744746
SDKROOT = iphoneos;
745747
VALIDATE_PRODUCT = YES;
@@ -913,7 +915,7 @@
913915
SDKROOT = appletvos;
914916
SKIP_INSTALL = YES;
915917
TARGETED_DEVICE_FAMILY = 3;
916-
TVOS_DEPLOYMENT_TARGET = 9.0;
918+
TVOS_DEPLOYMENT_TARGET = 12.0;
917919
VERSIONING_SYSTEM = "apple-generic";
918920
VERSION_INFO_PREFIX = "";
919921
};
@@ -940,7 +942,7 @@
940942
SDKROOT = appletvos;
941943
SKIP_INSTALL = YES;
942944
TARGETED_DEVICE_FAMILY = 3;
943-
TVOS_DEPLOYMENT_TARGET = 9.0;
945+
TVOS_DEPLOYMENT_TARGET = 12.0;
944946
VERSIONING_SYSTEM = "apple-generic";
945947
VERSION_INFO_PREFIX = "";
946948
};

MTDemo/MTDemo.xcodeproj/xcshareddata/xcschemes/MTDemo.xcscheme

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1320"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,8 +26,17 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
codeCoverageEnabled = "YES"
30-
shouldUseLaunchSchemeArgsEnv = "YES">
29+
shouldUseLaunchSchemeArgsEnv = "YES"
30+
codeCoverageEnabled = "YES">
31+
<MacroExpansion>
32+
<BuildableReference
33+
BuildableIdentifier = "primary"
34+
BlueprintIdentifier = "A4DB9ED31FA709A400826A8F"
35+
BuildableName = "MTDemo.app"
36+
BlueprintName = "MTDemo"
37+
ReferencedContainer = "container:MTDemo.xcodeproj">
38+
</BuildableReference>
39+
</MacroExpansion>
3140
<Testables>
3241
<TestableReference
3342
skipped = "NO">
@@ -50,17 +59,6 @@
5059
</BuildableReference>
5160
</TestableReference>
5261
</Testables>
53-
<MacroExpansion>
54-
<BuildableReference
55-
BuildableIdentifier = "primary"
56-
BlueprintIdentifier = "A4DB9ED31FA709A400826A8F"
57-
BuildableName = "MTDemo.app"
58-
BlueprintName = "MTDemo"
59-
ReferencedContainer = "container:MTDemo.xcodeproj">
60-
</BuildableReference>
61-
</MacroExpansion>
62-
<AdditionalOptions>
63-
</AdditionalOptions>
6462
</TestAction>
6563
<LaunchAction
6664
buildConfiguration = "Debug"
@@ -82,8 +80,6 @@
8280
ReferencedContainer = "container:MTDemo.xcodeproj">
8381
</BuildableReference>
8482
</BuildableProductRunnable>
85-
<AdditionalOptions>
86-
</AdditionalOptions>
8783
</LaunchAction>
8884
<ProfileAction
8985
buildConfiguration = "Release"

MTDemo/MTDemo.xcodeproj/xcshareddata/xcschemes/MessageThrottle iOS.xcscheme

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1320"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -29,8 +29,6 @@
2929
shouldUseLaunchSchemeArgsEnv = "YES">
3030
<Testables>
3131
</Testables>
32-
<AdditionalOptions>
33-
</AdditionalOptions>
3432
</TestAction>
3533
<LaunchAction
3634
buildConfiguration = "Release"
@@ -51,8 +49,6 @@
5149
ReferencedContainer = "container:MTDemo.xcodeproj">
5250
</BuildableReference>
5351
</MacroExpansion>
54-
<AdditionalOptions>
55-
</AdditionalOptions>
5652
</LaunchAction>
5753
<ProfileAction
5854
buildConfiguration = "Release"

MTDemo/MTDemo.xcodeproj/xcshareddata/xcschemes/MessageThrottle macOS.xcscheme

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1320"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -29,8 +29,6 @@
2929
shouldUseLaunchSchemeArgsEnv = "YES">
3030
<Testables>
3131
</Testables>
32-
<AdditionalOptions>
33-
</AdditionalOptions>
3432
</TestAction>
3533
<LaunchAction
3634
buildConfiguration = "Debug"
@@ -51,8 +49,6 @@
5149
ReferencedContainer = "container:MTDemo.xcodeproj">
5250
</BuildableReference>
5351
</MacroExpansion>
54-
<AdditionalOptions>
55-
</AdditionalOptions>
5652
</LaunchAction>
5753
<ProfileAction
5854
buildConfiguration = "Release"

MTDemo/MTDemo.xcodeproj/xcshareddata/xcschemes/MessageThrottle tvOS.xcscheme

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1320"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -29,8 +29,6 @@
2929
shouldUseLaunchSchemeArgsEnv = "YES">
3030
<Testables>
3131
</Testables>
32-
<AdditionalOptions>
33-
</AdditionalOptions>
3432
</TestAction>
3533
<LaunchAction
3634
buildConfiguration = "Debug"
@@ -51,8 +49,6 @@
5149
ReferencedContainer = "container:MTDemo.xcodeproj">
5250
</BuildableReference>
5351
</MacroExpansion>
54-
<AdditionalOptions>
55-
</AdditionalOptions>
5652
</LaunchAction>
5753
<ProfileAction
5854
buildConfiguration = "Release"

MTDemo/MTDemo.xcodeproj/xcshareddata/xcschemes/MessageThrottle watchOS.xcscheme

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1320"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -29,8 +29,6 @@
2929
shouldUseLaunchSchemeArgsEnv = "YES">
3030
<Testables>
3131
</Testables>
32-
<AdditionalOptions>
33-
</AdditionalOptions>
3432
</TestAction>
3533
<LaunchAction
3634
buildConfiguration = "Debug"
@@ -51,8 +49,6 @@
5149
ReferencedContainer = "container:MTDemo.xcodeproj">
5250
</BuildableReference>
5351
</MacroExpansion>
54-
<AdditionalOptions>
55-
</AdditionalOptions>
5652
</LaunchAction>
5753
<ProfileAction
5854
buildConfiguration = "Release"

MessageThrottle.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "MessageThrottle"
3-
s.version = "1.4.0"
3+
s.version = "1.4.1"
44
s.summary = "A lightweight Objective-C message throttle and debounce library."
55
s.description = <<-DESC
66
MessageThrottle is a lightweight, simple library for controlling frequency of forwarding Objective-C messages. You can choose to control existing methods per instance or per class. It's an implementation of function throttle/debounce developed with Objective-C runtime.

0 commit comments

Comments
 (0)