Created
August 22, 2013 18:18
-
-
Save BenBarahona/6310846 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSString *)constructHashTagForAppCopy:(NSString *)appCopy | |
{ | |
NSRange hashRange = [appCopy rangeOfString:@"#hashtag#" options:NSCaseInsensitiveSearch]; | |
if(hashRange.location != NSNotFound) | |
{ | |
NSString *hashCopy = [self.channel objectForKey:@"hashtag"]; | |
if(!hashCopy) | |
{ | |
hashCopy = @""; | |
} | |
else | |
{ | |
hashCopy = [NSString stringWithFormat:@"%@", [self.channel objectForKey:@"hashtag"]]; | |
// Double checking if hashcopy is correct | |
if(![[hashCopy substringToIndex:1] isEqualToString:@"#"]) | |
{ | |
hashCopy = [NSString stringWithFormat:@"#%@", hashCopy]; | |
} | |
} | |
appCopy = [appCopy stringByReplacingCharactersInRange:hashRange withString:hashCopy]; | |
} | |
else | |
{ | |
return appCopy; | |
} | |
return appCopy; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment