0

I'm attempting to use the RocketSocket library on a OS 10.7 but Xcode keeps complaining that the property base64Encoding not found in NSData and NSMutable regarding these lines in SRWebSocket.m:

return [[NSData dataWithBytes:md length:CC_SHA1_DIGEST_LENGTH] base64Encoding];

_secKey = keyBytes.base64Encoding;

After some googling, I found that base64Encoding is deprecated. I'm a relative noob to ObjC (and Mac in general). Anyone have any idea how to fix this problem?

pankaj asudani
  • 862
  • 6
  • 18
Dawud
  • 19
  • 2
  • Could you please post more of the code so we can get some context, and the whole of the error rather than a precis. On the face of it, the two lines you've included should work so it's likely to be a problem elsewhere. – davidf2281 Apr 19 '14 at 11:24
  • The error message in the question title mentions a different method than what is shown in your code. – Martin R Apr 19 '14 at 12:09

1 Answers1

0

Replace

_secKey = keyBytes.base64Encoding

by

_secKey = [keyBytes base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength]; 
user3621991
  • 126
  • 1