Skip to content

Commit

Permalink
[#46] getRemoteId returns a string
Browse files Browse the repository at this point in the history
  • Loading branch information
jjburka committed Feb 17, 2009
1 parent ce5e057 commit 2c1044a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Classes/lib/NSObject+ObjectiveResource.m
Expand Up @@ -165,7 +165,7 @@ - (NSString *)convertToRemoteExpectedType {
#pragma mark default equals methods for id and class based equality
- (BOOL)isEqualToRemote:(id)anObject {
return [NSStringFromClass([self class]) isEqualToString:NSStringFromClass([anObject class])] &&
[anObject respondsToSelector:@selector(getRemoteId)] && [[[anObject getRemoteId] stringValue]isEqualToString:[[self getRemoteId] stringValue]];
[anObject respondsToSelector:@selector(getRemoteId)] && [[anObject getRemoteId]isEqualToString:[self getRemoteId]];
}
- (NSUInteger)hashForRemote {
return [[self getRemoteId] intValue] + [NSStringFromClass([self class]) hash];
Expand All @@ -177,6 +177,9 @@ - (id)getRemoteId {
SEL idMethodSelector = NSSelectorFromString([self getRemoteClassIdName]);
if ([self respondsToSelector:idMethodSelector]) {
result = [self performSelector:idMethodSelector];
if ([result respondsToSelector:@selector(stringValue)]) {
result = [result stringValue];
}
}
return result;
}
Expand Down

0 comments on commit 2c1044a

Please sign in to comment.