I'm starting to learn Objective-C, and I've tried to compile this code on Debian Wheezy with GCC (GNUStep):
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *base64String = @"SGVsbG8gV29ybGQh";
NSURL *URL = [NSURL URLWithString: [NSString stringWithFormat:@"data:;base64,%@", base64String]];
NSData *decodedData = [NSData dataWithContentsOfURL:URL];
NSLog(@"%@", decodedData);
[pool drain];
return 0;
}
It compiles fine, but it returns "null" every time when I run the application, I've tried different solutions (converting NSData to NSString) but that didn't spit out decoded string neither.
Is it a problem with my code or the GNUStep environment?