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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:31:35+00:00 2026-06-04T13:31:35+00:00

I’m seeing some rather strange behavior as I’m debugging my iPhone project. Among other

  • 0

I’m seeing some rather strange behavior as I’m debugging my iPhone project. Among other things, in the header file for a UIViewController descendant, I have this:

@interface OOGameDetailsViewController : UIViewController <OOXMLParserDelegate,OOServerDelegate>
{
    ...

    OOXMLNode *node;
    float elheights[6];

    ...
}

@property (readwrite, retain) OOXMLNode *gameNode;

...

@end

Then in the code, I’m assigning values to this array:

- (void)setNode:(OOXMLNode *)aNode
{
    node = aNode;
    [self updateUserDefaults];

    [background setImage:[gameNode imageFromKey:@"background"]];

    CGFloat maxw = 240.0f;

    NSString *text = [gameNode elementNodeWithKey:@"title"].value;
    CGSize sizeOfText=[text sizeWithFont:[UIFont boldSystemFontOfSize:20.0f]
                       constrainedToSize:CGSizeMake(maxw, CGFLOAT_MAX)
                           lineBreakMode:UILineBreakModeWordWrap];
    ...
    elheights[0] = 10 + sizeOfText.height;

    text = [gameNode elementNodeWithKey:@"age"].value;
    sizeOfText=[text sizeWithFont:[UIFont systemFontOfSize:16.0f]
                constrainedToSize:CGSizeMake(maxw, CGFLOAT_MAX)
                    lineBreakMode:UILineBreakModeWordWrap];
    ...
    elheights[1] = 10 + sizeOfText.height;

    ...
    elheights[2] = 10 + height;

    ...
    elheights[3] = 10 + separatorHeight;

    text = [gameNode elementNodeWithKey:@"intro"].value;
    sizeOfText=[text sizeWithFont:[UIFont boldSystemFontOfSize:14.0f]
                constrainedToSize:CGSizeMake(maxw, CGFLOAT_MAX)
                    lineBreakMode:UILineBreakModeWordWrap];
    ...
    elheights[4] = sizeOfText.height;

    ...
    elheights[5] = 20 + btnHeight;

    [mainTable reloadData];
}

The ideas is quite simple: I’m assigning 6 floating point values to a 6-element array – with indices from 0 to 5. However as I’m stepping through this code in the debugger, I consistently see each of the assignments assign the element of the array with index 1 higher than indicated. That is, elheights[0] = ... actually assigns this vlaue into elheights[1] and so on. The last assignment (assigning to element with index 5 simply does nothing).

To prove that I’m not crazy, here are screenshots of the debugger (crops of the relevant part – to keep image size to minimum). The first one is right before the assignment, the second one is right after the assignment.

enter image description here


enter image description here

I cleaned the project and restarted; I closed the simulator, closed Xcode, reopened and restarted – same results. Is there something special about the way ObjectiveC handles simple C-style arrays?

Thanks in advance,
-Aleks

  • 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-04T13:31:36+00:00Added an answer on June 4, 2026 at 1:31 pm

    XCode4 uses new LLDB debugger by default, which does not always work perfectly yet. (For example, the current version does not recognize structure alignment attribute). It also has some bugs here and there.

    Switch to GDB (click Scheme / Edit Scheme in the toolbar, there is the “Debugger” popup button with two choices) if you’re having problems with it.

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
i want to parse a xhtml file and display in UITableView. what is the

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.