Put the method initWithSomething:(Something*)something andAnother:(Another*)another alongWith:(Fun*)fun;
on your Button
class. And on this init of your Button
, also init the
CCLabelCustom
with these parameters.
Then when you will init your button outside the class, use this method and pass the parameters.
PS.: The method initWithSomething
must return an ID object: -(id)initWithSomething:
Example:
// Outside class
Button *button = [[Button alloc] initWithSomething:something andAnother:another alongWith:fun];
...
// Your Button custom init
- (id)initWithSomething:(Something*)something andAnother:(Another*)another alongWith:(Fun*)fun
{
self = [self init];
if (self) {
self.buttonLabel = [[CCLabelCustom alloc] initWithSomething:something andAnother:another alongWith:fun]
}
return self;
}