Just to clarify the previous answers:
In the NSFoundation API, NSData does not have a dataWithBase64EncodedString:
method. If your copying code in which it does, then that code has extended NSData by adding to it a category that contains the method.
You can add arbitrary methods to any class using a category. If someone has used a category in their example code, you cannot use that code unless you also get the header and implementation files that define the category. If the original author did not make those available then you are out of luck.
Base64 encoding isn't one of the API provided encodings for strings so you'll probably have to implement that yourself or find some code by someone who has.