Could someone please explain the difference between setWithObjects and initWithObjects
So i spent the last hour or so fighting with my code, and eventually discovered that the NSSet I was trying to use was empty. Once I switched from the first line of code to the second, everything worked great. I was just hoping someone could tell me what is wrong with the first line. It compiles just fine, but apparently doesn't do what I'm hoping for.

    NSSet *singleOperandOperations = [singleOperandOperations initWithObjects: @"cos", @"sin", @"sqrt", nil];

v.s.

    NSSet *singleOperandOperations = [NSSet setWithObjects: @"cos", @"sin", @"sqrt", nil];

Thanks!
Could someone please explain the difference between setWithObjects and initWithObjects
===

So i spent the last hour or so fighting with my code, and eventually discovered that the NSSet I was trying to use was empty. Once I switched from the first line of code to the second, everything worked great. I was just hoping someone could tell me what is wrong with the first line. It compiles just fine, but apparently doesn't do what I'm hoping for.

    NSSet *singleOperandOperations = [singleOperandOperations initWithObjects: @"cos", @"sin", @"sqrt", nil];

v.s.

    NSSet *singleOperandOperations = [NSSet setWithObjects: @"cos", @"sin", @"sqrt", nil];

Thanks!