Skip to content

Commit f3adc65

Browse files
committed
移除 KVO
1 parent 3374a0a commit f3adc65

4 files changed

Lines changed: 12 additions & 1 deletion

File tree

Demo/SJAttributesFactory.xcodeproj/project.pbxproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,11 @@
571571
CODE_SIGN_IDENTITY = "iPhone Developer";
572572
CODE_SIGN_STYLE = Manual;
573573
DEVELOPMENT_TEAM = DB5B5F2RH5;
574+
GCC_PREPROCESSOR_DEFINITIONS = (
575+
"$(inherited)",
576+
"COCOAPODS=1",
577+
SJ_MAC,
578+
);
574579
INFOPLIST_FILE = SJAttributesFactory/Info.plist;
575580
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
576581
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";

Demo/SJAttributesFactory.xcodeproj/xcshareddata/xcschemes/SJAttributesFactory.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
</AdditionalOptions>
4343
</TestAction>
4444
<LaunchAction
45-
buildConfiguration = "Debug"
45+
buildConfiguration = "Release"
4646
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4747
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
4848
launchStyle = "0"

SJAttributesFactory/SJAttributeWorker.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ inline static BOOL _rangeContains(NSRange range, NSRange subRange) {
2323
return (range.location <= subRange.location) && (range.location + range.length >= subRange.location + subRange.length);
2424
}
2525

26+
#ifdef DEBUG
2627
inline static void _errorLog(NSString *msg, id __nullable target) {
2728
NSLog(@"\n__Error__: %@\nTarget: %@", msg, target);
2829
}
30+
#else
31+
#define _errorLog(...)
32+
#endif
2933

3034
#pragma mark -
3135

@@ -69,7 +73,9 @@ - (void)addAttributesToTargetIfNeeded {
6973
if ( !_needToAdd ) return;
7074
else _needToAdd = NO;
7175

76+
#ifdef SJ_MAC
7277
NSLog(@"%@", self);
78+
#endif
7379

7480
NSRange range = _recorder.range;
7581
if ( range.location == 0 && range.length == 0 ) {

0 commit comments

Comments
 (0)