I've been trying to log device parameters using [[UIDevice currentDevice] ...] and NSLog. I always get the same warning despite trying different ways to go about it.
The warning I get is:
Passing argument 1 of 'NSLog' from incompatible pointer type
Here are all my attempts:
NSString *UDID = [[UIDevice currentDevice] uniqueIdentifier];
NSString *deviceName = [[UIDevice currentDevice] name];
NSString *deviceModel = [[UIDevice currentDevice] model];
NSLog("\nDevice UDID: %@\nDevice Name: %@\nDevice Mode:%@\n",UDID, deviceName, deviceModel);
NSString *UDID = (NSString*)[[UIDevice currentDevice] uniqueIdentifier];
NSString *deviceName = (NSString*)[[UIDevice currentDevice] name];
NSString *deviceModel = (NSString*)[[UIDevice currentDevice] model];
NSLog("\nDevice UDID: %@\nDevice Name: %@\nDevice Mode:%@\n",UDID, deviceName, deviceModel);
NSString *UDID = [NSString stringWithFormat:[[UIDevice currentDevice] uniqueIdentifier]];
NSString *deviceName = [NSString stringWithFormat:[[UIDevice currentDevice] name]];
NSString *deviceModel = [NSString stringWithFormat:[[UIDevice currentDevice] model]];
NSLog("\nDevice UDID: %@\nDevice Name: %@\nDevice Mode:%@\n",UDID, deviceName, deviceModel);
NSLog("\nDevice UDID: %@\nDevice Name: %@\nDevice Mode:%@\n",[[UIDevice currentDevice] uniqueIdentifier], [[UIDevice currentDevice] name], [[UIDevice currentDevice] model]);
Can anyone help me out? Thanks!
You need to use an NSString as the first argument to NSLog For example
NSLog(@"\nDevice UDID: %@\nDevice Name: %@\nDevice Mode:%@\n",UDID, deviceName, deviceModel);
Notice the '@' before the start of the string