Skip to content

Instantly share code, notes, and snippets.

@amrox
Created June 29, 2011 19:27
Show Gist options
  • Save amrox/1054686 to your computer and use it in GitHub Desktop.
Save amrox/1054686 to your computer and use it in GitHub Desktop.
// don't do this
deviceToken = [[[[deviceToken description]
stringByReplacingOccurrencesOfString: @"<" withString: @""]
stringByReplacingOccurrencesOfString: @">" withString: @""]
stringByReplacingOccurrencesOfString: @" " withString: @""];
// do this
NSString* deviceTokenStr = [[[[deviceToken description]
stringByReplacingOccurrencesOfString: @"<" withString: @""]
stringByReplacingOccurrencesOfString: @">" withString: @""]
stringByReplacingOccurrencesOfString: @" " withString: @""];
// also parsing the output of the description method is usually a bit sketchy, but I think
// it's ok in this case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment