问题 I have this layer hosted view, which is initialised like so: // Init layers self.wantsLayer = YES; _hostedLayer = [CALayer layer]; _hostedLayer.delegate = self; self.layer = _hostedLayer; Weirdly, the delegate method updateLayer is not called. When I comment out the last 3 lines, it does get called. What's wrong here? Hint: Yes I have overridden wantsUpdateLayer and return YES . 回答1: When a view asks for a layer it gets a special, private subclass of CALayer by default, which has extra