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

  • Home
  • SEARCH
  • 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 6578703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:48:16+00:00 2026-05-25T15:48:16+00:00

I am very lost in Xcode 4. Watching a simple variable is a nightmare.

  • 0

I am very lost in Xcode 4. Watching a simple variable is a nightmare. I do not figure out how to just “watch a variable value”. It was easier in Xcode 3…

I have the following piece of code:

if (labelEast.center.x > (east_oldPosition.x + 50) )
        NSLog(@"Time to switch to previous exercise !");
    else if (labelEast.center.x < (east_oldPosition.x - 50) )
        NSLog(@"Time to switch to next exercise !");

After setting a breakpoint, I am just trying to watch labelEast.center.x (labelEast is a UILabel object). Since I could not find a watch item in a Xcode 4 menu, I am trying to use gdb. I am used to print variable/object values with po (print object). But now, I cannot display labelEast center property because it is inherited from a mother class.

(gdb) po labelEast.center
There is no member named center.

I do not understand why gdb says this whereas the code works fine and sees the property.

Thus I have 2 questions:

  1. How to watch such a property without gdb in a graphical way (as simply as in Visual Studio) ?
  2. How to do the same with gdb ?

Many thanks,
Franz


Unfortunately, I tried it but got this:

po [labelSouth center]

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x1a000356 0x343c7d06 in
objc_msgSend_stret () The program being debugged was signaled while in
a function called from GDB. GDB remains in the frame where the signal
was received. To change this behavior use “set unwindonsignal on”
Evaluation of the expression containing the function (objc_msgSend)
will be abandoned.

And when I try:

(gdb) print labelSouth.center
There is no member named center.

I really suspect there is no access to center property in UILabel. But how can me code run ???

  • 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-25T15:48:16+00:00Added an answer on May 25, 2026 at 3:48 pm

    I’ve hit this thing a few times myself just to remember “oh, that’s right, gdb doesn’t support dot notation so I have to use getter”. Then just do:

    (gdb) po [myObject someProperty]
    

    and all is well with the world again. Also rereading your question I see that you’re requesting a non object to be printed, hence you have to give gdb a hint of what type of property you want to print:

    (gdb) p (CGRect)[myView frame]
    (gdb) p (CGPoint)[myView center]
    

    and so on.

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

Sidebar

Related Questions

My problem is very simple, yet I feel lost while looking at it ...
I'm writing a very simple Maven plugin, and I am kind of lost with
I've come across a very interesting problem.. quite lost actually. Suppose I have a
I have recently come across a very simple Typed DataTable (without using a .XSD)(I've
This seems like a very simple question, but I'm getting lost, and need a
Something very strange happened and I have no idea why. I've lost the icon
I am very lost with this Regex. I have a HTML Table with 3
Someday i've downloaded a very nice jquery editor but i lost it and i
JIRA is a very extensible bug/task tracking tool. As such, newcomers feel lost as
Very simply put: I have a class that consists mostly of static public members,

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.