Objective c NSString错误-无法静态分配接口类型

Objective c NSString错误-无法静态分配接口类型,objective-c,nsstring,nsnumber,Objective C,Nsstring,Nsnumber,我正在尝试创建一个NSDictionary对象,其中键是用歌曲的编号以及信息定义的。我在尝试定义传递到方法中的NSNumber时遇到上述错误: +(NSDictionary *) initWithMPMediaItem:(MPMediaItem *) song andSongNumber: (NSNumber *)songCount{ NSString *songKey = @"%@ Song Title", songCount; 看起来您想要使用: NSString *songKey =

我正在尝试创建一个NSDictionary对象,其中键是用歌曲的编号以及信息定义的。我在尝试定义传递到方法中的NSNumber时遇到上述错误:

+(NSDictionary *) initWithMPMediaItem:(MPMediaItem *) song andSongNumber: (NSNumber *)songCount{

NSString *songKey = @"%@ Song Title", songCount;

看起来您想要使用:

NSString *songKey = [NSString stringWithFormat:@"%@ Song Title", songCount];

看起来您想要使用:

NSString *songKey = [NSString stringWithFormat:@"%@ Song Title", songCount];

谢谢你的帮助!现在我知道stringwithformat方法的作用了。谢谢你的帮助!现在我知道stringwithformat方法的作用了。