Ios 如何将(id)参数转换为属性列表对象?

Ios 如何将(id)参数转换为属性列表对象?,ios,Ios,我的应用程序是通过URL启动的,我添加了以下方法,该方法将在启动时调用: - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation 注释被描述为源应用程序提供的属性列表对象。我想检查一下内容,看看源应用程序提供了哪些信息/数据。我该怎么做 谢谢无需将注释变量从id转换

我的应用程序是通过URL启动的,我添加了以下方法,该方法将在启动时调用:

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
注释被描述为源应用程序提供的属性列表对象。我想检查一下内容,看看源应用程序提供了哪些信息/数据。我该怎么做


谢谢

无需将
注释
变量从
id
转换为其他变量。只需调用对象直接支持的任何方法

可以是数组、字典、字符串、数字、布尔值、日期和数据

要查找属性列表的类型:
[annotation className]
[annotation class]
[annotation classCode]

所有属性列表将符合
说明
valueForKey
方法

// Retrieve the contents of a property list as a string.
NSString *contents = [annotation description]
NSLog(@"%@", contents);