我没有得到这个错误警告,直到我更新到最新版本的Xcode?Xcode 6.0.1新警告
Incompatible pointer types initializing 'MPNowPlayingInfoCenter' with an expression of type 'NSNotificationCenter’
CODE:
- (void)doUpdateNowPlayingCenter
{
if (!self.updateNowPlayingCenter || !self.nowPlayingItem)
{
return;
}
Class playingInfoCenter = NSClassFromString(@"MPNowPlayingInfoCenter");
if (!playingInfoCenter)
{
return;
}
MPNowPlayingInfoCenter *center = [playingInfoCenter defaultCenter];
NSDictionary *songInfo = @
{
MPMediaItemPropertyTitle: [self.nowPlayingItem valueForProperty:MPMediaItemPropertyTitle],
MPMediaItemPropertyPlaybackDuration: [self.nowPlayingItem valueForProperty:MPMediaItemPropertyPlaybackDuration]
};
center.nowPlayingInfo = songInfo;
}
这听起来像是某种类型推断在XCode 6中被破解了。演员们将解决这个问题。 – Petesh 2014-10-23 14:18:15