Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7080955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:51:31+00:00 2026-05-28T06:51:31+00:00

According to documentation Default implementation does nothing. But… I throw exception from drawRect method

  • 0

According to documentation
Default implementation does nothing.

But… I throw exception from drawRect method and i see next callstack

3   EasyWakeup                          0x0003a7b6 -[AlarmIntervalView drawRect:] + 71
4   UIKit                               0x003f6187 -[UIView(CALayerDelegate) drawLayer:inContext:] + 426
5   QuartzCore                          0x011a8b5e -[CALayer drawInContext:] + 143

So as i can understand it means default implementation of -[CALayer drawInContext:] call
delegate method.
Is it correct?
Since i have known swizzling technique i’m not sure anything in objective-c…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:51:32+00:00Added an answer on May 28, 2026 at 6:51 am

    You’re correct in that CALayer’s default drawInContext: does nothing. This is true unless the layer has a delegate and that layer’s delegate implements drawLayer:inContext:. So the issue with the documentation is that it should have a little asterisk next to the statement “Default implementation does nothing.”

    Remember, all views are backed with some kind of CALayer. This layer is automatically setup to have its view set as its delegate. What’s not apparent on the surface is that UIView does implement CALayer’s delegate drawLayer:inContext:. This is what you’re seeing with all those calls on the call stack.

    Your instance of AlarmIntervalView automatically has a backing layer, and that backing layer has its delegate set to your AlarmIntervalView instance. Some part of the system calls the backing layer’s drawInContext: which checks for a delegate (which it has), sends the delegate respondsToSelector: with drawLayer:inContext: as the argument (which UIView does respond to), and finally actually sends the message drawLayer:inContext:. UIView’s implementation of drawLayer:inContext: calls your view’s drawRect:.

    I’m not really sure why you mention swizzling.

    [My response is long, mostly for my benefit. It helps me learn too.]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to the Microsoft documentation, when an unhandled exception occurs on a thread (from
According the Perl documentation on regexes : By default, the "^" character is guaranteed
SQLCMD uses windows authentication by default. According to the MSDN documentation , you can
According to the documentation, the decimal.Round method uses a round-to-even algorithm which is not
According to the documentation in VB6 the Mid() function returns a variant, but Mid$()
According to the documentation : There is no way to block signals temporarily from
According to the urllib2 documentation , Because the default handlers handle redirects (codes in
According to the MSDN documentation, by default the FileExtensionsAttribute (.NET 4.5) should allow me
i have a application i put Default.png for splash screen according to apple's documentation.the
According to the documentation from python.org, python 3.2 install on mac os requires an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.