あなたの助けに感謝します、あなたは私が私のコードを修正するのを手伝ってくれました、私はこれを書き留めました:
- (id) init {
self = [super init];
if (!self) return nil;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(receiveNotification:)
name:@"com.apple.iTunes.playerInfo"
object:nil];
return self;}
- (void) receiveNotification:(NSNotification *) notification {
if ([@"com.apple.iTunes.playerInfo" isEqualToString:@"com.apple.iTunes.playerInfo"]) {
NSLog (@"Successfully received the test notification!");
}}
ただし、NSDistributedNotificationCenterの代わりにNSNotificationCenterを使用しました。それは私が間違っていたところです。
ありがとう、サミ。