Is it possible to create a "Private" CFQL Method?
Figured it out. On the method properties I set the Member Attributes to "Private".
Related
I've been trying to find the best way to implement a stored property in an extension, and came across this question: Swift extension stored properties alternative. However, I have not found a reason why in the discussion or anywhere else. Is there a reason why stored properties are not allowed in Swift? And if so, what is the reason?
Extensions are for extending the functionality of an existing class without changing the memory structure. It's more or less syntactic sugar. Imagine you could add stored properties and methods, what would it be? Nothing else but inheritance. So if you like to add new properties and methods just inherit from the class.
How can I set up the documentation for our custom components and actions so that they will be displayed at the IDE? The same goes for the variable names of these classes. Now the will be displayed like variableName instead of Variable Name.
Thanks in advance
Hardie
This is done with BeanInfo classes.
Look at samples/customCode/src/ManyFeaturesActionBeanInfo.java for an example. That BeanInfo class describes the properties for the class defined in ManyFeaturesAction.java.
I need a way to conditionally define the superclass of a class based on a value in NSUserDefaults.
I know one can define different interfaces based on #ifdef directive. I wonder if the same can be achieved with #if directive?
If not, is there some other way to achieve my goal?
Thank you!
You cannot do that with a preprocessor directive, since it would be determined at compile time while NSUserDefaults is something you want to check at runtime.
I think this thread could help you Dynamically change an object's superclass
Anyway, are you sure this is the best you can do by design? Why would you change the superclass at runtime based on something in NSUserDefaults?
I have use the type dynamic, a new type in .NET 4.0.
I want to use a dynamic type because I want to use some types that in advance I don't know what type is, but I know that all this possible type has some common methods.
In my case, I am using self tracking entities in entity framework 4.0, and I know that all the entities has the methods markedXXX (to set the state of the entity).
Through the dynamic object that I created, I can access and set the properties of one of this entities, but when I try to execute the MarkedAsXXX method I get an exception that says that the object has not definied the method.
I would like to know how to access to this methods. Is it possible?
Because I have a function that can access to the original values and set this values to the current one, but I need to set the entity as Unchenged.
Thanks.
I want to use a dynamic type because I want to use some types that in advance I don't know what type is, but I know that all this possible type has some common methods.
That suggests you should create an interface with those common methods, and make all the relevant types implement the interface.
Through the dynamic object that I created, I can access and set the properties of one of this entities, but when I try to execute the MarkedAsXXX method I get an exception that says that the object has not defined the method.
It's possible that this is due to explicit interface implementation. If the types have those methods declared as public methods in the normal way, it should be fine.
If you really want to use dynamic typing with these types, is there some base interface which declares the MarkedAsXXX methods, which you could cast the objects to before calling those methods? (I'm not familiar with the entity framework, so I don't know the details of those methods.)
Basically, I would try to avoid dynamic typing unless you really need it, partly because of edge cases like this - but if explicit interface implementation is the cause, then casting to that interface should be fine.
If you define an interface to the dynamically generated classes you can call the methods without the hassle of reflection calling.
I have assigned class varaible as....
[MyINFO setUsrID:[dict valueForKey:USERID]];
but when i access "usrID" on another view controller it gives EXC_BAD_ACESS error.
Please suggest what changes should be done in MyINFO ?
There's a good Matt Gallagher post about Singletons, along with a clever macro for creating singletons in Objective-C. You can read it here.
Class variables do not work this way in Objective-C. You can create a singleton class and use instance variables of the singleton.