I'm trying to pass an NSString via a menuitem using the following code
CCMenuItem * buyButton = [CCMenuItemLabel itemWithLabel:buyLabel target:self selector:@selector(buyItem:)];
buyButton.userData = (__bridge void *)((NSString*)(itemName));
to the following selector
-(void) buyItem:(CCMenuItemLabel*)sender {
NSString * itemName = (NSString *)sender.userData;
}
but i'm crashing in the selector. I am using cocos2d with arc enabled, hence the bridge in the userdata assigment. (kobold2d). any ideas?