Hey, for the life of me, this is not working:..
NSMutableString *b64String = [[[NSMutableString alloc] initWithFormat:@"Basic %@", [string _base64Encoding:string]] autorelease];
[b64String stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]];
NSLog(@"(%@)", b64String);
NSRange foundRange = [b64String rangeOfString:@"\n"];
if (foundRange.location != NSNotFound)
[b64String stringByReplacingOccurrencesOfString:@"\n"
withString:@""
options:0
range:foundRange];
NSLog(@"(%@)", b64String);
Both those methods I found on SO - and they don't seem to work... I've got to be doing something terribly wrong. But, if I break on the NSLog's, I can clearly see the "\n" in the string (in the debugger AND in the console out)
Also, this is true:
if (foundRange.location != NSNotFound)
And I can see if execute the stringByReplacingOccurencesOfString method...