@outlet CPView _rightNeighbour;
--
You received this message because you are subscribed to the Google Groups "Cappuccino & Objective-J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to objectivej+...@googlegroups.com.
To post to this group, send email to objec...@googlegroups.com.
Visit this group at http://groups.google.com/group/objectivej.
For more options, visit https://groups.google.com/d/optout.
"Categories allow extension of behaviour, not state"
NSString* myVarKey = @"myVar";
+ (id)myVar
{
return objc_getAssociatedObject(self, myVarKey);
}
cappObject._associatedObjects = new Object(); /* Not sure if there is a more intention revealing Dictionary class in JS - but Object does the job */
cappObject._associatedObjects.key1 = "value1";
cappObject._associatedObjects["key2"] = "value2";
/* void objc_setAssociatedObject(id object, const void *key, id value, objc_AssociationPolicy policy) */
function objj_setAssociatedObject(object, key, value, policy) {
if (!object._associatedObjects)
object._associatedObjects = new Object();
object._associatedObjects[key] = value;
}
Objective-J does not have properties but it allows you to add ivars in categories. I.e. you can to do the same thing in Objective-J as in Objective-C by creating an ivar instead of a property.
A problem is that XCodeCapp does not generate a correct .h file for the Interface Builder to read. You will never see the outlet in the Interface Builder. This is a bug in XCodeCapp.
22 apr 2015 kl. 09:18 skrev Udo Schneider <udo.sc...@homeaddress.de>:Is there maybe a "post-convert" hook in XCodeCapp which would allow calling a script or something like that? This way one could at least add the missing stuff semi-manually until this bug is fixed.
#import <Cocoa/Cocoa.h>
#import "xcc_general_include.h"
@interface CPView (AutoLayout)
@property (assign) IBOutlet NSView* topNeighbour;
@end
Try to write "@interface NSView (AutoLayout)” instead of "@interface CPView (AutoLayout)".- Martin