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 9015007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:38:42+00:00 2026-06-16T03:38:42+00:00

I want to trace when something changes the size of self.view. What’s the correct

  • 0

I want to trace when something changes the size of self.view. What’s the correct format?

(lldb) po self.view
(UIView *) $1 = 0x0a8aba20 <UIView: 0xa8aba20; frame = (0 0; 480 864); autoresize = W+TM+BM; layer = <CALayer: 0xa8aba50>>
(lldb) watch set variable self.view.frame.size.width
error: "self" is a pointer and . was used to attempt to access "view". Did you mean "self->view.frame.size.width"?
(lldb) watch set variable self->view
error: "view" is not a member of "(PlayViewController *) self"
(lldb) watch set variable self->view.frame.size.width
error: "view" is not a member of "(PlayViewController *) self"

I’ve tried the documentation and other lldb watchpoint questions but can’t find anything for this specific case.

Thanks for your help.

  • 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-06-16T03:38:43+00:00Added an answer on June 16, 2026 at 3:38 am

    The view controller references its view from its _view instance variable.

    The view doesn’t store its frame directly. It just returns its layer’s `frame’.

    The view references its layer from its _layer instance variable.

    The layer doesn’t store the frame either. It computes its frame from its bounds, position, anchorPoint, and transform. The size is part of bounds.

    The layer doesn’t store its bounds directly in an instance variable. Instead, its layer instance variable references an instance of a private C++ class, CA::Layer. The member layout of this class is undocumented.

    In other words, you can go self->_view->_layer->layer to get to the CA::Layer instance, but then you’re stuck because you don’t know where in the CA::Layer to find the bounds.

    So, trying to use a watchpoint to detect changes to the view’s size is rather difficult.

    It is easier to put a breakpoint on -[CALayer setBounds:].

    On the simulator

    Remember to use the layer address in the breakpoint condition, not the view address.

    (lldb) po self.view
    (UIView *) $1 = 0x0a034690 <UIView: 0xa034690; frame = (0 20; 768 1004); autoresize = W+H; layer = <CALayer: 0xa034780>>
    (lldb) break set -F '-[CALayer setBounds:]' -c '((int*)$esp)[1] == 0xa034780'
    Breakpoint created: 2: name = '-[CALayer setBounds:]', locations = 1, resolved = 1
    

    When the breakpoint is hit, the CALayer instance is referenced by ((int *)$esp)[1], and the new bounds is *(CGRect *)($esp+12):

    (lldb) po ((int*)$esp)[1]
    (int) $8 = 167987072 <CALayer:0xa034780; position = CGPoint (384 480); bounds = CGRect (0 0; 768 1004); delegate = <UIView: 0xa034690; frame = (0 -22; 768 1004); autoresize = W+H; layer = <CALayer: 0xa034780>>; sublayers = (<CALayer: 0xa033010>); backgroundColor = <CGColor 0xa034960> [<CGColorSpace 0xa02b3b0> (kCGColorSpaceDeviceRGB)] ( 1 1 1 1 )>
    (lldb) p *(CGRect*)($esp+12)
    (CGRect) $9 = origin=(x=0, y=0) size=(width=768, height=960)
    (lldb) finish
    (lldb) po 0xa034780
    (int) $10 = 167987072 <CALayer:0xa034780; position = CGPoint (384 480); bounds = CGRect (0 0; 768 960); delegate = <UIView: 0xa034690; frame = (0 0; 768 960); autoresize = W+H; layer = <CALayer: 0xa034780>>; sublayers = (<CALayer: 0xa033010>); backgroundColor = <CGColor 0xa034960> [<CGColorSpace 0xa02b3b0> (kCGColorSpaceDeviceRGB)] ( 1 1 1 1 )>
    

    On the device

    Remember to use the layer address in the breakpoint condition, not the view address.

    (lldb) po self.view
    (UIView *) $0 = 0x1f031a10 <UIView: 0x1f031a10; frame = (0 20; 768 1004); autoresize = W+H; layer = <CALayer: 0x1f031b00>>
    (lldb) break set -F '-[CALayer setBounds:]' -c '$r0 == 0x1f031b00'
    Breakpoint created: 2: name = '-[CALayer setBounds:]', locations = 1, resolved = 1
    

    When the breakpoint is hit, the CALayer instance is referenced by $r0, the new X origin is in $r2, the new Y origin is in $r3, and the new size is *(CGSize *)$sp:

    (lldb) po $r0
    (unsigned int) $7 = 520297216 <CALayer:0x1f031b00; position = CGPoint (384 480); bounds = CGRect (0 0; 768 1004); delegate = <UIView: 0x1f031a10; frame = (0 -22; 768 1004); autoresize = W+H; layer = <CALayer: 0x1f031b00>>; sublayers = (<CALayer: 0x1f030840>); backgroundColor = <CGColor 0x1f031ce0> [<CGColorSpace 0x1e530ad0> (kCGColorSpaceDeviceRGB)] ( 1 1 1 1 )>
    (lldb) p/f $r2
    (unsigned int) $14 = 0
    (lldb) p/f $r3
    (unsigned int) $15 = 0
    (lldb) p *(CGSize *)$sp
    (CGSize) $16 = (width=768, height=960)
    (lldb) finish
    (lldb) po 0x1f031b00
    (int) $17 = 520297216 <CALayer:0x1f031b00; position = CGPoint (384 480); bounds = CGRect (0 0; 768 960); delegate = <UIView: 0x1f031a10; frame = (0 0; 768 960); autoresize = W+H; layer = <CALayer: 0x1f031b00>>; sublayers = (<CALayer: 0x1f030840>); backgroundColor = <CGColor 0x1f031ce0> [<CGColorSpace 0x1e530ad0> (kCGColorSpaceDeviceRGB)] ( 1 1 1 1 )>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to trace the modification history of a specific file. Does linux have
I want to trace all the parent controls of a control (e.g) if i
I want to trace the source code , but when I set a breakpoint,
I have a my custom collection derived from List(.MyItem.) I want to trace if
I've started using svn with Versions.app locally, as I want to keep trace of
I want to retrieve stack trace from a user dump file programmatically . There
I want to implement a custom trace listener like follows: public class TraceListener :
I want to disable the stack trace getting generated when an exception is thrown.
I want to get a detailed log about my stack trace. I can get
Suppose I want to reflect exception in the log. Should I pass stack trace

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.