Iphone UIDevice属性和NSLog存在问题

Iphone UIDevice属性和NSLog存在问题,iphone,properties,nslog,uidevice,Iphone,Properties,Nslog,Uidevice,我一直在尝试使用[[UIDevice currentDevice]…]和NSLog记录设备参数。我总是得到同样的警告,尽管我尝试了不同的方法 我得到的警告是: Passing argument 1 of 'NSLog' from incompatible pointer type 以下是我所有的尝试: 1: 2: 三: 4: 有人能帮我吗?谢谢 NSLog将NSString作为格式字符串,而不是常量字符*。在字符串前面加上@ i、 e: NSLog将NSString作为格式字符串,而不是con

我一直在尝试使用[[UIDevice currentDevice]…]和NSLog记录设备参数。我总是得到同样的警告,尽管我尝试了不同的方法

我得到的警告是:

Passing argument 1 of 'NSLog' from incompatible pointer type
以下是我所有的尝试:

1: 2: 三: 4:
有人能帮我吗?谢谢

NSLog
将NSString作为格式字符串,而不是
常量字符*
。在字符串前面加上
@

i、 e:


NSLog
将NSString作为格式字符串,而不是
const char*
。在字符串前面加上
@

i、 e:


您需要使用NSString作为NSLog的第一个参数 比如说

NSLog(@"\nDevice UDID: %@\nDevice Name: %@\nDevice Mode:%@\n",UDID, deviceName, deviceModel);

请注意字符串开头之前的“@”,您需要使用NSString作为NSLog的第一个参数 比如说

NSLog(@"\nDevice UDID: %@\nDevice Name: %@\nDevice Mode:%@\n",UDID, deviceName, deviceModel);

请注意,字符串开头之前的“@”需要一个
NSString
作为其格式参数。您应该像这样调用
NSLog

NSLog(@"\nDevice UDID: %@", [[UIDevice currentDevice] uniqueIdentifier]);

注意开头的“@”-这是一个常量
NSString
引用。您正在使用裸C字符串。

NSLog
需要一个
NSString
作为其格式参数。您应该像这样调用
NSLog

NSLog(@"\nDevice UDID: %@", [[UIDevice currentDevice] uniqueIdentifier]);

注意开头的“@”-这是一个常量
NSString
引用。您使用的是纯C字符串。

我真不敢相信我居然漏掉了。谢谢你的好眼力。。。。我现在觉得自己太傻了,萝莉,我真不敢相信我错过了。谢谢你的好眼力。。。。我现在觉得自己太傻了,哈哈
NSLog(@"\nDevice UDID: %@\nDevice Name: %@\nDevice Mode:%@\n", ....
NSLog(@"\nDevice UDID: %@\nDevice Name: %@\nDevice Mode:%@\n",UDID, deviceName, deviceModel);
NSLog(@"\nDevice UDID: %@", [[UIDevice currentDevice] uniqueIdentifier]);