Error establishing a database connection
Complements the post title perfectly :)179 karma · joined July 24, 2009
[ my public key: https://keybase.io/benjie; my proof: https://keybase.io/benjie/sigs/QGjpauz2Remx10SpAp02LpRxyb7WDGJb8ZaBmADt3Sw ]
Error establishing a database connection
Complements the post title perfectly :) -(id)objectAtIndexedSubscript:(NSUInteger)index;
-(void)setObject:(id)object atIndexedSubscript:(NSUInteger)index;
as weiran has shown for NS(Mutable)Array/NS(Mutable)Dictionary. NSNumber *fortyTwo = @42; // equivalent to [NSNumber numberWithInt:42]
NSNumber *piDouble = @3.1415926535; // equivalent to [NSNumber numberWithDouble:3.1415926535]
NSNumber *yesNumber = @YES; // equivalent to [NSNumber numberWithBool:YES]
NSArray *array = @[ @"Hello", NSApp, [NSNumber numberWithInt:42] ];
NSDictionary *dictionary = @{
@"name" : NSUserName(),
@"date" : [NSDate date],
@"processInfo" : [NSProcessInfo processInfo]
};
This, especially the NSArray/NSDictionary stuff, should make coding in Obj-C so much faster and more pleasant - well done LLVM team!PS: Not sure if the object subscripting stuff is supported yet, but that looks awesome too!
> Worryingly, this was enabled by default on my MacBook Air as soon as I upgraded from the copy of Lion it shipped with. I did not enable this feature.
So it looks like you don't have to enable it yourself manually. I can neither confirm nor deny this myself, just going off what the author has said.