Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sgauravv

macrumors newbie
Original poster
Jul 17, 2008
12
0
hi
I have used these lines in our iphone application
NSString *uniqueID = [[UIDevice currentDevice] uniqueIdentifier];
CFTypeRef serialNumberAsCFString;

io_service_t platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault,IOServiceMatching("IOPlatformExpertdevice"));

if(platformExpert)

{

serialNumberAsCFString = IORegistryEntryCreateCFProperty(platformExpert, CFSTR(kIOPlatformSerialNumberKey), kCFAllocatorDefault,0);

}
IOObjectRelease(platformExpert);

NSString *serial = [[NSString alloc] initWithFormat:mad:"%@",serialNumberAsCFString];


now when i am compiling this code in iphone simulator it is working fine...
but when i am compiiling in iphone device that it is giving an error that these lines are undeclared.
same problem is also coming when I am using NSCalenderDate.
it is working fine in simulator but in device it is undeclared

May I know why it is so??
please help me.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
IOKit isn't available on the iPhone. The simulator doesn't use the same frameworks as the iPhone. NSCalenderDate isn't available on the iPhone either (search around, there are a few threads on this).
 

sgauravv

macrumors newbie
Original poster
Jul 17, 2008
12
0
hi.........
BUt NSDate is working and NSCalender is derived class of NSDate and from same framework.....
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Not on the iPhone. There are threads on this front page that give alternatives (namely NSCalendar and NSDateComponents).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.