ndevenish / Site-ndevenish

NDevenish.com Jekyll site source
58 stars 4 forks source link

Property in the Protocol #1

Open huajianhuang opened 7 years ago

huajianhuang commented 7 years ago

First of all, this code is great and it worked like a charm. Thank you so much for that.

I am currently having some trouble of incorporating a property in the class. Think of my python script having a property called "printFavouriteFood", and I want to have a property called "favouriteFood" for the Bridge class, which conforms to the BridgeInterface protocol. I tried to add this property in both the BridgeInterface protocol and the python script class Bridge(....), but it didn't really work out--errors I have range from "invalid syntax" to "does not full implement". I have tried objective-c style things such as @property, @synthesize, and @favouriteFood.setter.

Could you give me some suggestions please? Or if you already have an example, that would be even better. Thank you.

By the way, I am by no means a computer scientist, so please go easy on me on the nomenclatures.