ios - How to override getter of IBOutlet -


I have an IBOutlet inside a custom table view cell.

  @property (weak, nonatomic) IBOutlet UIView * innerContainer;  

I want to override the

gate as
  - (UIView *) innerContainer {UIColor * shadowColor = [UIColor colorWithRed: 199 / 255.0f green: 178 / 255.0 F blue: 153 / 255.0 f alpha: 1]; _innerContainer.layer.shadowOffset = CGSizeMake (0, 0); _innerContainer.layer.shadowColor = [cinematographer CGColor]; _innerContainer.layer.shadowRadius = 4; _innerContainer.layer.shadowOpacity = .75; CAGRT caffe frame = _inner container.layer.bound; CGPathRef ShadowPath = [UIBezierPath bezierPathWithRect: shadowFrame] .CGPath; _innerContainer.layer.shadowPath = shadowPath; Return _innerContainer; }  

But there is no effect. On the other hand, if I add shadow to innerContainer

- (UITableViewCell *) tableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath

So the effect?

I tried to add @synthesize innerContainer = _innerContainer but that made no difference.

There is a way to override the heater of an IBOutlet / strong>

is it? innerContainer to set your shadow, with your existing code. This is probably not working because you can not reach innerContainer directly in your code, and the recipient is never done. On the other hand, if you use the property many times, the work will be completed every time, which is overkill. Instead, override the awakeFromNib method in your table view cell, and keep this argument there. This method is called after all your outlets have been installed, and the right place for your logic to create shadows.


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -