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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:52:58+00:00 2026-05-26T10:52:58+00:00

On iOS < 5.0, this code for a grouped table cell of mine: NSLog(@%f,

  • 0

On iOS < 5.0, this code for a grouped table cell of mine:

NSLog(@"%f", cell.contentView.bounds.size.width);

returns 302.

But on iOS5, the same code returns 320 (that is, including the margin of the grouped cell layout in the width).

Is that expected behaviour?

And if so, how to I then reliable get the width of a grouped, tableview cell not including the margin?

  • 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-26T10:52:58+00:00Added an answer on May 26, 2026 at 10:52 am

    I think this change has to do with the timing of the layout of the cell and the width of 302 is set in a viewWill* or viewDid* method when more is known about accessories, tableview style, etc.

    When I ran into this I fixed it by setting the autoresizingMask property appropriately for when the contentView was adjusted to the with of 302 later in the code.

    Since I was getting the bounds width so I could add a text field on the right side of the cell, simply adding:

    valueTextField.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
    

    made it pop back to where it was before iOS5. I suspect I would get better behavior with this if the device was rotated or go in and out of edit mode but this particular tableview does not do either of these.

    Hope this helps ya!

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

Sidebar

Related Questions

I run this code normally in iOS 4.3. But when I change the project
Newbie here (to C, objective-C, and iOS)... For this code in my AppDelegate.m, why
In iOS 4 this Code worked to play a movie: -(IBAction)playMovie:(id)sender { NSURL *url
I have this code in my iOS app: - (IBAction)cameraButtonPressed:(id)sender { if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]
Hi I need the redefine an ios method (CLLocationCoordinate2DMake) with this code: static inline
I have this code now: This is iOS for(NSDictionary * dict in myMutableArray) {
I develop for iOS and use XCode 3.2.5, GCC 4.2. UPD This code works:
I have written this code to make a binary file of float numbers, but
I have the following code for iAds. [_iAdAdView setCurrentContentSizeIdentifier:ADBannerContentSizeIdentifierPortrait]; But this code throws EXC_BAD_ACCESSS
UPDATE It looks like this problem has been quietly fixed in iOS 4.3. Up

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.