I am just learning obj c. I am using GNUStep downloaded from gnustep.org/experience/Windows.html (there are 3 installers - msys system, core, devel) some time back.
Running the below code:
#import <Foundation/Foundation.h>
int main (int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSDictionary *m_Dict =
[NSDictionary dictionaryWithObjectsAndKeys:
@"ABC", @"One",
@"DEF", @"Two",
@"GHI", @"Three",
nil ];
// Print all key-value pairs from the dictionary
[m_Dict enumerateKeysAndObjectsUsingBlock: ^(id key, id obj, BOOL *stop) {
NSLog(@"%@ => %@", key, obj);
}];
[pool drain];
return 0;
}
is showing an error:
$ gcc -o c c.m -I /GNUstep/System/Library/Headers -L /GNUstep/System/Library/Li
``braries -lobjc -lgnustep-base -fconstant-string-class=NSConstantString
c.m: In function 'main':
c.m:16:44: error: expected expression before '^' token
c.m:18:1: warning: 'NSDictionary' may not respond to '-enumerateKeysAndObjectsUs
ingBlock:' [enabled by default]
c.m:18:1: warning: (Messages without a matching method signature [enabled by def
ault]
c.m:18:1: warning: will be assumed to return 'id' and accept [enabled by default
]
c.m:18:1: warning: '...' as arguments.) [enabled by default]c
Please suggest what I am doing wrong. searched here on Stackoverflow also but couldn't find much help.