diff --git a/Demo/Podfile b/Demo/Podfile index 3bfef12..f2d1d5e 100644 --- a/Demo/Podfile +++ b/Demo/Podfile @@ -4,4 +4,8 @@ platform :ios, '8.0' target 'librato-iOS Demo' do pod 'librato-iOS', :path => '../librato-iOS.podspec' + + target 'librato-iOS DemoTests' do + inherit! :search_paths + end end diff --git a/Demo/librato-iOS Demo.xcodeproj/project.pbxproj b/Demo/librato-iOS Demo.xcodeproj/project.pbxproj index 47a8310..cbfbc7c 100644 --- a/Demo/librato-iOS Demo.xcodeproj/project.pbxproj +++ b/Demo/librato-iOS Demo.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 0D6D45DA41B71E92FB0B9E41 /* libPods-librato-iOS DemoTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C644C1E73D9E5B07F26ABA47 /* libPods-librato-iOS DemoTests.a */; }; 6692261E180358AF00237E77 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6692261D180358AF00237E77 /* Foundation.framework */; }; 66922620180358AF00237E77 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6692261F180358AF00237E77 /* CoreGraphics.framework */; }; 66922622180358AF00237E77 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66922621180358AF00237E77 /* UIKit.framework */; }; @@ -21,6 +22,7 @@ 66922643180358B000237E77 /* librato_iOS_DemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 66922642180358B000237E77 /* librato_iOS_DemoTests.m */; }; 6692264E18035E8400237E77 /* LibratoDemoEventTracker.m in Sources */ = {isa = PBXBuildFile; fileRef = 6692264D18035E8400237E77 /* LibratoDemoEventTracker.m */; }; 669C48111D8764040059EDBD /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 669C48101D8764040059EDBD /* MainStoryboard.storyboard */; }; + D953BD3F1DBAA49B005EEF1B /* NSString+ALMSanitizedForMetricTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D9263DD61DB946660035CC6E /* NSString+ALMSanitizedForMetricTests.m */; }; E83CC217E62447107D693D91 /* libPods-librato-iOS Demo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F8E7DC6EE1A84E81B6B7B7A2 /* libPods-librato-iOS Demo.a */; }; /* End PBXBuildFile section */ @@ -55,8 +57,12 @@ 6692264D18035E8400237E77 /* LibratoDemoEventTracker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LibratoDemoEventTracker.m; sourceTree = ""; }; 669C48101D8764040059EDBD /* MainStoryboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainStoryboard.storyboard; sourceTree = ""; }; 71FE433FB985CA1AB0DF6BDA /* Pods-librato-iOS Demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-librato-iOS Demo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-librato-iOS Demo/Pods-librato-iOS Demo.debug.xcconfig"; sourceTree = ""; }; + 801077638741FA5C51076C77 /* Pods-librato-iOS DemoTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-librato-iOS DemoTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-librato-iOS DemoTests/Pods-librato-iOS DemoTests.release.xcconfig"; sourceTree = ""; }; + 8E8188DE6A6BC172BA811B1C /* Pods-librato-iOS DemoTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-librato-iOS DemoTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-librato-iOS DemoTests/Pods-librato-iOS DemoTests.debug.xcconfig"; sourceTree = ""; }; B3CFB32942D9D0C3245EEB4E /* Pods-librato-iOS Demo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-librato-iOS Demo.release.xcconfig"; path = "Pods/Target Support Files/Pods-librato-iOS Demo/Pods-librato-iOS Demo.release.xcconfig"; sourceTree = ""; }; C5A2D3C7197B48C6A9ACC07D /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; + C644C1E73D9E5B07F26ABA47 /* libPods-librato-iOS DemoTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-librato-iOS DemoTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + D9263DD61DB946660035CC6E /* NSString+ALMSanitizedForMetricTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+ALMSanitizedForMetricTests.m"; sourceTree = ""; }; F8E7DC6EE1A84E81B6B7B7A2 /* libPods-librato-iOS Demo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-librato-iOS Demo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -79,6 +85,7 @@ 66922637180358AF00237E77 /* XCTest.framework in Frameworks */, 66922639180358B000237E77 /* UIKit.framework in Frameworks */, 66922638180358AF00237E77 /* Foundation.framework in Frameworks */, + 0D6D45DA41B71E92FB0B9E41 /* libPods-librato-iOS DemoTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -114,6 +121,7 @@ 66922636180358AF00237E77 /* XCTest.framework */, C5A2D3C7197B48C6A9ACC07D /* libPods.a */, F8E7DC6EE1A84E81B6B7B7A2 /* libPods-librato-iOS Demo.a */, + C644C1E73D9E5B07F26ABA47 /* libPods-librato-iOS DemoTests.a */, ); name = Frameworks; sourceTree = ""; @@ -147,6 +155,7 @@ isa = PBXGroup; children = ( 66922642180358B000237E77 /* librato_iOS_DemoTests.m */, + D9263DD61DB946660035CC6E /* NSString+ALMSanitizedForMetricTests.m */, 6692263D180358B000237E77 /* Supporting Files */, ); path = "librato-iOS DemoTests"; @@ -166,6 +175,8 @@ children = ( 71FE433FB985CA1AB0DF6BDA /* Pods-librato-iOS Demo.debug.xcconfig */, B3CFB32942D9D0C3245EEB4E /* Pods-librato-iOS Demo.release.xcconfig */, + 8E8188DE6A6BC172BA811B1C /* Pods-librato-iOS DemoTests.debug.xcconfig */, + 801077638741FA5C51076C77 /* Pods-librato-iOS DemoTests.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -197,9 +208,12 @@ isa = PBXNativeTarget; buildConfigurationList = 66922649180358B000237E77 /* Build configuration list for PBXNativeTarget "librato-iOS DemoTests" */; buildPhases = ( + 60F4CC329F21EB0D532804DC /* [CP] Check Pods Manifest.lock */, 66922631180358AF00237E77 /* Sources */, 66922632180358AF00237E77 /* Frameworks */, 66922633180358AF00237E77 /* Resources */, + BAACFE891AE2BDA71802DAB9 /* [CP] Embed Pods Frameworks */, + B8F1461E083D696A5571BDE5 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -293,7 +307,52 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + 60F4CC329F21EB0D532804DC /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + B8F1461E083D696A5571BDE5 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-librato-iOS DemoTests/Pods-librato-iOS DemoTests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + BAACFE891AE2BDA71802DAB9 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-librato-iOS DemoTests/Pods-librato-iOS DemoTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; CF311E2286F14B79A814F7BE /* [CP] Copy Pods Resources */ = { @@ -328,6 +387,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + D953BD3F1DBAA49B005EEF1B /* NSString+ALMSanitizedForMetricTests.m in Sources */, 66922643180358B000237E77 /* librato_iOS_DemoTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -479,6 +539,7 @@ }; 6692264A180358B000237E77 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 8E8188DE6A6BC172BA811B1C /* Pods-librato-iOS DemoTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/librato-iOS Demo.app/librato-iOS Demo"; FRAMEWORK_SEARCH_PATHS = ( @@ -501,6 +562,7 @@ }; 6692264B180358B000237E77 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 801077638741FA5C51076C77 /* Pods-librato-iOS DemoTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/librato-iOS Demo.app/librato-iOS Demo"; FRAMEWORK_SEARCH_PATHS = ( diff --git a/Demo/librato-iOS DemoTests/NSString+ALMSanitizedForMetricTests.m b/Demo/librato-iOS DemoTests/NSString+ALMSanitizedForMetricTests.m new file mode 100644 index 0000000..4a71f26 --- /dev/null +++ b/Demo/librato-iOS DemoTests/NSString+ALMSanitizedForMetricTests.m @@ -0,0 +1,36 @@ +// +// NSString+SanitizedForMetricTests.m +// librato-iOS +// +// Created by Sergey Kuryanov on 20.10.16. +// Copyright © 2016 Amco International Education Services, LLC. All rights reserved. +// + +#import +#import "NSString+ALMSanitizedForMetric.h" + +@interface NSString_ALMSanitizedForMetricTests : XCTestCase +@property (nonatomic, strong) NSString *testString; +@end + +@implementation NSString_ALMSanitizedForMetricTests + +- (void)setUp { + [super setUp]; + + self.testString = @"A-Za-z0-9.:-_<>{}[];\'\"!@#$%^&*()_+=œ∑´®†¥¨ˆøπ“‘«åß∂ƒ©˙∆˚¬…æΩ≈ç√∫˜µ≤≥÷"; +} + +- (void)tearDown { + self.testString = nil; + + [super tearDown]; +} + +- (void)testThatOnlyAllowedCharactersPresent { + NSString *expectedString = @"A-Za-z0-9.:-_-------------------_------------------------------------"; + + XCTAssertEqualObjects(self.testString.alm_sanitizedForMetric, expectedString); +} + +@end diff --git a/Demo/librato-iOS DemoTests/librato_iOS_DemoTests.m b/Demo/librato-iOS DemoTests/librato_iOS_DemoTests.m index 780d094..7821fcc 100644 --- a/Demo/librato-iOS DemoTests/librato_iOS_DemoTests.m +++ b/Demo/librato-iOS DemoTests/librato_iOS_DemoTests.m @@ -26,9 +26,5 @@ - (void)tearDown [super tearDown]; } -- (void)testExample -{ - XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); -} @end diff --git a/librato-iOS.xcodeproj/project.pbxproj b/librato-iOS.xcodeproj/project.pbxproj index 7396bdc..466aebb 100644 --- a/librato-iOS.xcodeproj/project.pbxproj +++ b/librato-iOS.xcodeproj/project.pbxproj @@ -17,7 +17,7 @@ 6692259917FE44B800237E77 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6692258117FE44B800237E77 /* UIKit.framework */; }; 669225A117FE44B800237E77 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6692259F17FE44B800237E77 /* InfoPlist.strings */; }; 669225A317FE44B800237E77 /* librato_iOSTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 669225A217FE44B800237E77 /* librato_iOSTests.m */; }; - 669225B117FE457800237E77 /* NSString+SanitizedForMetric.m in Sources */ = {isa = PBXBuildFile; fileRef = 669225B017FE457800237E77 /* NSString+SanitizedForMetric.m */; }; + 669225B117FE457800237E77 /* NSString+ALMSanitizedForMetric.m in Sources */ = {isa = PBXBuildFile; fileRef = 669225B017FE457800237E77 /* NSString+ALMSanitizedForMetric.m */; }; 669225C017FE458100237E77 /* LibratoClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 669225B317FE458100237E77 /* LibratoClient.m */; }; 669225C117FE458100237E77 /* LibratoConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 669225B517FE458100237E77 /* LibratoConnection.m */; }; 669225C217FE458100237E77 /* LibratoDirectPersister.m in Sources */ = {isa = PBXBuildFile; fileRef = 669225B717FE458100237E77 /* LibratoDirectPersister.m */; }; @@ -57,8 +57,8 @@ 6692259E17FE44B800237E77 /* librato-iOSTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "librato-iOSTests-Info.plist"; sourceTree = ""; }; 669225A017FE44B800237E77 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 669225A217FE44B800237E77 /* librato_iOSTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = librato_iOSTests.m; sourceTree = ""; }; - 669225AF17FE457800237E77 /* NSString+SanitizedForMetric.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+SanitizedForMetric.h"; sourceTree = ""; }; - 669225B017FE457800237E77 /* NSString+SanitizedForMetric.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+SanitizedForMetric.m"; sourceTree = ""; }; + 669225AF17FE457800237E77 /* NSString+ALMSanitizedForMetric.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+ALMSanitizedForMetric.h"; sourceTree = ""; }; + 669225B017FE457800237E77 /* NSString+ALMSanitizedForMetric.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+ALMSanitizedForMetric.m"; sourceTree = ""; }; 669225B217FE458100237E77 /* LibratoClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LibratoClient.h; sourceTree = ""; }; 669225B317FE458100237E77 /* LibratoClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LibratoClient.m; sourceTree = ""; }; 669225B417FE458100237E77 /* LibratoConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LibratoConnection.h; sourceTree = ""; }; @@ -184,8 +184,8 @@ 669225AC17FE454800237E77 /* Categories */ = { isa = PBXGroup; children = ( - 669225AF17FE457800237E77 /* NSString+SanitizedForMetric.h */, - 669225B017FE457800237E77 /* NSString+SanitizedForMetric.m */, + 669225AF17FE457800237E77 /* NSString+ALMSanitizedForMetric.h */, + 669225B017FE457800237E77 /* NSString+ALMSanitizedForMetric.m */, ); path = Categories; sourceTree = ""; @@ -335,7 +335,7 @@ 669225C417FE458100237E77 /* LibratoProcessor.m in Sources */, 669225C517FE458100237E77 /* LibratoQueue.m in Sources */, 6692260A17FF3C2A00237E77 /* Librato.m in Sources */, - 669225B117FE457800237E77 /* NSString+SanitizedForMetric.m in Sources */, + 669225B117FE457800237E77 /* NSString+ALMSanitizedForMetric.m in Sources */, 669225C617FE458100237E77 /* LibratoVersion.m in Sources */, 669225CC17FE458800237E77 /* LibratoMetric.m in Sources */, 669225C017FE458100237E77 /* LibratoClient.m in Sources */, diff --git a/librato-iOS/Categories/NSString+SanitizedForMetric.h b/librato-iOS/Categories/NSString+ALMSanitizedForMetric.h similarity index 62% rename from librato-iOS/Categories/NSString+SanitizedForMetric.h rename to librato-iOS/Categories/NSString+ALMSanitizedForMetric.h index 56d0fc7..d4254b3 100644 --- a/librato-iOS/Categories/NSString+SanitizedForMetric.h +++ b/librato-iOS/Categories/NSString+ALMSanitizedForMetric.h @@ -1,5 +1,5 @@ // -// NSString+SanitizedForMetric.h +// NSString+ALMSanitizedForMetric.h // Librato-iOS // // Created by Adam Yanalunas on 10/3/13. @@ -8,8 +8,8 @@ #import -@interface NSString (SanitizedForMetric) +@interface NSString (ALMSanitizedForMetric) -- (NSString *)sanitizedForMetric; +- (NSString *)alm_sanitizedForMetric; @end diff --git a/librato-iOS/Categories/NSString+ALMSanitizedForMetric.m b/librato-iOS/Categories/NSString+ALMSanitizedForMetric.m new file mode 100644 index 0000000..b82241f --- /dev/null +++ b/librato-iOS/Categories/NSString+ALMSanitizedForMetric.m @@ -0,0 +1,21 @@ +// +// NSString+ALMSanitizedForMetric.m +// Librato-iOS +// +// Created by Adam Yanalunas on 10/3/13. +// Copyright (c) 2013 Amco International Education Services, LLC. All rights reserved. +// + +#import "NSString+ALMSanitizedForMetric.h" + +@implementation NSString (ALMSanitizedForMetric) + +- (NSString *)alm_sanitizedForMetric +{ + NSCharacterSet *allowedSet = [NSCharacterSet characterSetWithCharactersInString:@"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.:-_"]; + NSString *cleaned = [[self componentsSeparatedByCharactersInSet:allowedSet.invertedSet] componentsJoinedByString:@"-"]; + return [cleaned substringToIndex:(self.length < 255 ? self.length : 255)]; +} + + +@end diff --git a/librato-iOS/Categories/NSString+SanitizedForMetric.m b/librato-iOS/Categories/NSString+SanitizedForMetric.m deleted file mode 100644 index 71a215a..0000000 --- a/librato-iOS/Categories/NSString+SanitizedForMetric.m +++ /dev/null @@ -1,21 +0,0 @@ -// -// NSString+SanitizedForMetric.m -// Librato-iOS -// -// Created by Adam Yanalunas on 10/3/13. -// Copyright (c) 2013 Amco International Education Services, LLC. All rights reserved. -// - -#import "NSString+SanitizedForMetric.h" - -@implementation NSString (SanitizedForMetric) - -- (NSString *)sanitizedForMetric -{ - NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"[^A-Za-z0-9.:-_]" options:0 error:NULL]; - NSString *cleaned = [regex stringByReplacingMatchesInString:self options:0 range:NSMakeRange(0, self.length) withTemplate:@"-"]; - return [cleaned substringToIndex:(self.length < 255 ? self.length : 255)]; -} - - -@end diff --git a/librato-iOS/Metrics/LibratoMetric.m b/librato-iOS/Metrics/LibratoMetric.m index 50f4697..667c5cb 100644 --- a/librato-iOS/Metrics/LibratoMetric.m +++ b/librato-iOS/Metrics/LibratoMetric.m @@ -7,7 +7,7 @@ // #import "LibratoMetric.h" -#import "NSString+SanitizedForMetric.h" +#import "NSString+ALMSanitizedForMetric.h" #import "MTLValueTransformer.h" NSString *const LibratoMetricMeasureTimeKey = @"measure_time"; @@ -81,9 +81,9 @@ + (NSValueTransformer *)nameJSONTransformer { return [MTLValueTransformer reversibleTransformerWithForwardBlock:^id(NSString *name) { NSAssert(name.length > 0, @"Measurements must be named"); - return name.sanitizedForMetric; + return name.alm_sanitizedForMetric; } reverseBlock:^id(NSString *name) { - return name.sanitizedForMetric; + return name.alm_sanitizedForMetric; }]; } @@ -91,9 +91,9 @@ + (NSValueTransformer *)nameJSONTransformer + (NSValueTransformer *)sourceJSONTransformer { return [MTLValueTransformer reversibleTransformerWithForwardBlock:^id(NSString *source) { - return source.sanitizedForMetric; + return source.alm_sanitizedForMetric; } reverseBlock:^id(NSString *source) { - return (source.length ? source.sanitizedForMetric : nil); + return (source.length ? source.alm_sanitizedForMetric : nil); }]; }