I am comparing NSNumber initWith* methods with numberWith* methods specifically under ARC.
I have the feeling that they are now identical.
{
NSNumber* myInitNumber = [[NSNumber alloc] initWithInt:55];
NSNumber* myNumbNumber = [NSNumber numberWithInt:55];
// use here
}
At the final brace, both pointers go out of scope so both reference counts drop to zero and are deallocated.
If they are identical, is there a preference which one I should use?
It’s the same, since it’s autoreleased under non-ARC projects. But this has no effect to ARC enabled projects.