Simplify memory management/initialisation for strings and data.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7621 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 2000-09-27 15:26:16 +00:00
parent ef6773dfb5
commit bcb5c31bce
12 changed files with 248 additions and 608 deletions

View file

@ -1,11 +1,6 @@
#include <Foundation/Foundation.h>
#include <stdio.h>
#define _(X) \
[[NSBundle mainBundle] localizedStringForKey: @#X value: nil table: nil]
#define $(X) \
[[NSBundle mainBundle] localizedStringForKey: X value: nil table: nil]
#if 0
int main ()
@ -19,18 +14,12 @@ int main (int argc, char **argv)
{
NSString *string;
id pool = [NSAutoreleasePool new];
NSURL *url = [NSURL fileURLWithPath: @"/tmp/a"];
NSData *data = [url resourceDataUsingCache: YES];
NSLog(@"%@", data);
url = [NSURL fileURLWithPath: @"/tmp/z"];
[url setResourceData: data];
NSLog(@"%@", _(Testing));
NSLog(@"%@", $(@"Testing"));
string = [NSString stringWithCString:argv[1]];
NSProcessInfo *info = [NSProcessInfo processInfo];
NSUserDefaults *defaults;
[info setProcessName: @"TestProcess"];
defaults = [NSUserDefaults standardUserDefaults];
NSLog(@"%@", [defaults dictionaryRepresentation]);
return 0;
}
#endif