0

I'm trying to develop an iPhone app using the Linea Pro 5 SDK and Delphi XE5. I am translating the lineaSDK.h file to Delphi and I do not know how to translate this line from the SDK:

@interface Linea  : NSObject
...

/**
 Creates and initializes new Linea class instance or returns already initalized one. Use this function, if you want to access the class from different places
 @return shared class instance
 **/

+(id)sharedDevice`  // <--- this is where I am getting stumped.
...

I've read the Apple documentation on what (id) is and have Googled for a hint but to no avail. Any ideas?

RRUZ
  • 134,889
  • 20
  • 356
  • 483
Phil
  • 96
  • 2
  • I don't know Object Pascal, but it's analogous to this in Java: public static Object sharedDevice(); '+' means it's a class-level method and 'id' is essentially saying "an object" without giving any hint of the type. – Paul Dardeau Jan 22 '14 at 23:29
  • From the comment in the .h file it states that +(id)sharedDevice creates and initialises a new Linea class instance. So really, it is the constructor for the Linea class. (At least that's how I interpret it.) – Phil Jan 22 '14 at 23:35
  • Stylistically, class methods named "sharedXXXX" typically refer to a singleton, so it's typically used as an accessor (not as factory, although calling it may create the instance the first time it's called). – Paul Dardeau Jan 22 '14 at 23:37

0 Answers0