Both to the same thing, but [self playButtonSound];
is definitely the normal way to invoke a method in Objective-C. However, using performSelector:
allows you to call a method that is only determined at runtime.
From the NSObject Protocol Reference:
The performSelector
: method is
equivalent to sending an aSelector
message directly to the receiver. For
example, all three of the following
messages do the same thing:
id myClone = [anObject copy];
id myClone = [anObject performSelector:@selector(copy)];
id myClone = [anObject performSelector:sel_getUid("copy")];
However, the performSelector:
method
allows you to send messages that
aren’t determined until runtime. A
variable selector can be passed as the
argument:
SEL myMethod = findTheAppropriateSelectorForTheCurrentSituation();
[anObject performSelector:myMethod];