KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Ok, so I have this, but it wont work: @interface UILabel (touches) @property (nonatomic) BOOL isMethodStep; @end @implementation UILabel (touches) -(BOOL)isMethodStep { return self.isMethodStep; } -(void)setIsMethodStep:(BOOL)boolean { self.isMethodStep = boolean; } -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { if(self.isMethodStep){ // set all labels to normal font: UIFont *toSet = (self.font == [UIFont fontWithName:@"Helvetica" size:16]) ? [UIFont fontWithName:@"Helvetica-Bold" size:16] : [UIFont fontWithName:@"Helvetica" size:16]; id superView = self.superview; for(id theView in [(UIView *)superView subviews]) if([theView isKindOfClass:[UILabel class]]) [(UILabel *)theView setFont:[UIFont fontWithName:@"Helvetica" size:16]]; self.font = toSet; } } @end If I take out the getter and setter methods then it doesn't work it tells me I need to create some getter and setter methods (or use @synthesize - but putting @synthesize in the @implementation throws an error too). But with the getter and setter methods I get an EXC_BAD_ACCESS and a crash. Any ideas? Thanks Tom
Tags (comma-separated)
Save Edits
Cancel