I just wroted this line:
BOOL directoryResult = [[NSFileManager alloc]
createDirectoryAtURL:[[NSURL alloc]
initFileURLWithPath:[self.documentsPath
stringByAppendingFormat:@"/level%d", levelCount] isDirectory:YES]
withIntermediateDirectories:NO attributes:nil error:nil];
NSLog(@"BOOL: %d", directoryResult);
and I have two questions: how it is possible that this method is working properly? After [NSFileManager alloc] I'm not using init.
Why compiler does not complaining? Is init inside createDirectoryAtURL? Is it good way of programming?
And secondly in URL parameter of createDirectoryAtURL I'm creating NSURL just in place
[[NSURL alloc] initFileURLWithPath:[self.documentsPath stringByAppendingFormat:@"/level%d", levelCount] isDirectory:YES]
same question as above: Is it good way of programming or should I create such object before that line and just put object here?