Separate Expressions for +alloc and -init
The following code will crash hard when compiled using ARC:
#import <Foundation/Foundation.h> int main(void) { NSOutputStream* stream; stream = [NSOutputStream alloc]; stream = [stream initToMemory]; NSLog(@"%@", stream); }This is split calls to
alloc
andinitToMemory
are effectively what happens when usingNSOutputStream.alloc().initToMemory()
in Python.[…]
This appears to be a genuine bug in macOS, filed as FB17759654.