Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work around KVC Crasher in CMObject -description method #82

Merged
merged 2 commits into from Sep 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
@@ -1,3 +1,9 @@
1.7.13 (September 26, 2016)
===========================
Bugfixes:
* Resolve a compiler warning caused by stricter Objective-C casting rules in Xcode 8
* Fix a bug in the CMObject -description method that could, in rare circumstances, cause a crash

1.7.12 (August 9, 2016)
======================
Bugfixes:
Expand Down Expand Up @@ -30,7 +36,7 @@ v1.7.5 (June 12, 2015)
v1.7.5 (March 6, 2015)
======================
* Changed all returned values to be `instancetype`
* Fixed a bug in which a dictionary that looked like a CMObject, but shouldn't be, was deserialized to be a CMUntypedObject. Inserting `__class__: 'map'` as a Key/Value pair in your dictionaries will stop this from occuring.
* Fixed a bug in which a dictionary that looked like a CMObject, but shouldn't be, was deserialized to be a CMUntypedObject. Inserting `__class__: 'map'` as a Key/Value pair in your dictionaries will stop this from occurring.

v1.7.4 (March 5, 2015)
======================
Expand Down
2 changes: 1 addition & 1 deletion CloudMine.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "CloudMine"
s.version = "1.7.12"
s.version = "1.7.13"
s.summary = "The iOS Framework for interacting with CloudMine."
s.homepage = "https://cloudmine.io/docs/#/ios"
s.license = 'MIT'
Expand Down
6 changes: 3 additions & 3 deletions ios/cloudmine-ios.xcodeproj/project.pbxproj
Expand Up @@ -1420,7 +1420,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = EE1B44A5F6B4AA8E61850EFA /* Pods-cloudmine-ios.debug.xcconfig */;
buildSettings = {
CURRENT_PROJECT_VERSION = 1.7.12;
CURRENT_PROJECT_VERSION = 1.7.13;
DSTROOT = /tmp/ios.dst;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_GENERATE_TEST_COVERAGE_FILES = YES;
Expand Down Expand Up @@ -1448,7 +1448,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = B2A33E73BEDE10A94973E9FE /* Pods-cloudmine-ios.release.xcconfig */;
buildSettings = {
CURRENT_PROJECT_VERSION = 1.7.12;
CURRENT_PROJECT_VERSION = 1.7.13;
DSTROOT = /tmp/ios.dst;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO;
Expand Down Expand Up @@ -1574,7 +1574,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = C3444874F77B35F0544725D1 /* Pods-cloudmine-ios.test.xcconfig */;
buildSettings = {
CURRENT_PROJECT_VERSION = 1.7.12;
CURRENT_PROJECT_VERSION = 1.7.13;
DSTROOT = /tmp/ios.dst;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_GENERATE_TEST_COVERAGE_FILES = YES;
Expand Down
2 changes: 1 addition & 1 deletion ios/ios/src/CMConstants.h
Expand Up @@ -16,6 +16,6 @@

#define CM_DEFAULT_API_VERSION @"v1"

#define CM_VERSION @"1.7.12"
#define CM_VERSION @"1.7.13"

#endif
15 changes: 14 additions & 1 deletion ios/ios/src/Persisted Objects/CMObject.m
Expand Up @@ -365,11 +365,24 @@ - (NSString *)description;

for (RTProperty *prop in properties) {
if (!([prop.name isEqualToString:@"description"] || [prop.name isEqualToString:@"debugDescription"] )) {
string = [string stringByAppendingFormat:@"\n%@: %@", prop.name, [self valueForKey:prop.name]];
string = [string stringByAppendingFormat:@"\n%@: %@", prop.name, [self safe_valueForKey:prop.name]];
}
}

return string;
}

- (NSString *)safe_valueForKey:(NSString *)key
{
NSString *value = @"";

@try {
value = [self valueForKey:key];
} @catch (NSException *exception) {
value = exception.name;
} @finally {
return value;
}
}

@end
2 changes: 1 addition & 1 deletion ios/iosTests/cloudmine-iosTests-Info.plist
Expand Up @@ -17,6 +17,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.7.11</string>
<string>1.7.13</string>
</dict>
</plist>