Hello. I am developing an iOS app that uses Core Bluetooth to send data from an iOS device to a BLE micrcontroller. I am following the example TemperatureSensor sample app as a guide and in the LeDiscovery.h and .m files I came accross the id keyword used to create a sharedInstance. I found another online tutorial which implemented almost the same exact code except with the instanceType keyword.
Could some explain what id and instanceType are? How do you which one to use? Also, I would greatly appreciate if someone were to explain the following code in the TemperatureSensor app:
+ (id) sharedInstance
{
static LeDiscovery *this = nil;
if (!this)
this = [[LeDiscovery alloc] init];
return this;
}