Accessing variable/function defined in AppCoronaDelegate

Hi all, 

I just started on exploring Corona Enterprise and is new to Objective-c so pardon me if this question sounds silly.  I am currently trying to build a plugin for a third party SDK which requires me to implement its delegate which I have done so via AppCoronaDelegate.  The issue I am having now is that my plugin file (PluginLibrary.mm) is unable to access a variable defined in the delegate file (AppCoronaDelegate.mm) that is instantiated via the delegate methods.  I have read about CoronaRuntime but not sure how that can be used.

Hope to hear some advice.

Thanks.

Cheers

It sounds like your questions are about Obj-C paradigms as opposed to anything Corona-specific. I would recommend reviewing some Obj-C resources online, such as: 

https://developer.apple.com/library/mac/documentation/cocoa/conceptual/ProgrammingWithObjectiveC/Introduction/Introduction.html

For example, in order to access a variable in the delegate class, you need to provide an accessor. There are Obj-C properties, and there are also getter methods you can create. You’ll also need a way to access the instance of the delegate itself from your plugin. Generally speaking, the solution depends on the underlying data structure/classes and relationships between them.

Thanks Walter for the guide.

I finally got it working.  The recent Corona Enterprise iOS tutorial on AirPrint kind of inspired me on how I should go about doing it.  :)

It sounds like your questions are about Obj-C paradigms as opposed to anything Corona-specific. I would recommend reviewing some Obj-C resources online, such as: 

https://developer.apple.com/library/mac/documentation/cocoa/conceptual/ProgrammingWithObjectiveC/Introduction/Introduction.html

For example, in order to access a variable in the delegate class, you need to provide an accessor. There are Obj-C properties, and there are also getter methods you can create. You’ll also need a way to access the instance of the delegate itself from your plugin. Generally speaking, the solution depends on the underlying data structure/classes and relationships between them.

Thanks Walter for the guide.

I finally got it working.  The recent Corona Enterprise iOS tutorial on AirPrint kind of inspired me on how I should go about doing it.  :)

Hi :slight_smile:

Could you explain me how?

Thanks!

Best

Olivier

I believe this is the tutorial that was being referenced above:

https://coronalabs.com/blog/2014/04/22/tutorial-image-printing-via-corona-enterprise-ios/

Rob

Thanks Rob!

Hi :slight_smile:

Could you explain me how?

Thanks!

Best

Olivier

I believe this is the tutorial that was being referenced above:

https://coronalabs.com/blog/2014/04/22/tutorial-image-printing-via-corona-enterprise-ios/

Rob

Thanks Rob!