+[NSObject alloc]
or class_createInstance()
). I'll also explain why you might do this — the benefits and drawbacks to a custom object creation process.NSMutableArray
with a comparison method that randomly returns either higher or lower, would the result be an even, random distribution? Spoiler: no it won't but the actual distribution is interesting nonetheless. I'll show you what would happen if you did sort this way (and also show you how to correctly randomize an array if you did want an even distribution).