mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-21 04:32:03 +00:00
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:
parent
ef6773dfb5
commit
bcb5c31bce
12 changed files with 248 additions and 608 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue