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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:16:16+00:00 2026-05-11T11:16:16+00:00

I have a UITableView that when scrolled to far bounces bag. This also means

  • 0

I have a UITableView that when scrolled to far bounces bag. This also means the user can drag the table so that only half of it is visible and the other half of the main view is white. This causes some weird behavior in my app. I create an array in the AppDelegate. In RootViewController’s viewDidLoad, I get a reference to the AppDelegate and keep it around until the app shuts down. In RootViewController’s cellForRowAtIndexPath, I reference the AppDelegate instance’s array to get objects that will fill cell labels. That works fine until the user scrolls as mentioned above. Once that happens, in can see in the debugger that object 7, for instance, in the array has turned into UICachedDeviceRGBColor. I have no idea why that happens. The array is only assigned once in AppDelegate on app creation. It is only read referenced from then on.

From what I can tell, I must first click a row in the table. The new view is pushed, which also has a UITableView. in the cellForRowAtIndexPath of this 2nd view, I check the delegate.array, since 2nd view also has a reference to the array. I immediately see that object 2 in the array is:

2 : UIDeviceRGBColorSpace 1 1 1 1 

which it shouldn’t be. Then when I click back and the main table displays again, do the above scroll technique to get the weirdness. I scroll the table just enough to hit my breakpoint in cellForRowAtIndexPath and see the array has been altered. Object two is the correct type but now object 7 isn’t.

The problem is that if I try to access object 7 and call a property on the type I’m casting to, that property of course doesn’t exist on UICachedDeviceRGBColor. It’s an ‘Inavlid’ and so I get the “EXC_BAD_INSTRUCTION’ because of bad memory access.

What causes this alter of the array under this specific condition? Or at the least, how can I guard against it?

  • 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. 2026-05-11T11:16:16+00:00Added an answer on May 11, 2026 at 11:16 am

    This is on the device but looks as though I’ve figured it out.

    In didSelectRowAtIndexPath of RootViewController, I get one of the objects out of delegate.thearray. Just before 2nd View is pushed, I release this object. That’s wrong since I didn’t alloc the object. Removed that line and no more weirdness in the array. Things seem to be functioning as normal now.

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

Sidebar

Related Questions

I have a UITableView with several cells. This table is to be scrolled vertically.
I have a UITableView that I want to edit inside of a UITableViewController. This
I have a UITableView that uses the UITableViewCellStyleDefault style. I also have set the
I have a UITableView that is re-using cells when the user scrolls. Everything appears
I have a UITableView that loads content into a UIWebView like this: //MainViewController.m -
I have a UITableView that uses prototype cells to recreate a table. I have
I have a UITableView that looks like this: In the first cell I display
I have UITableView that will have several child UITableViews which may also have 1
I have a UITableView that is blank be default until the user edits and
I have a UITableView that gets populated my a NSMutableArray. This is how I

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.