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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:17:58+00:00 2026-06-12T07:17:58+00:00

I have an app that displays the nodes of a connected graph. When the

  • 0

I have an app that displays the nodes of a connected graph. When the user touches a node I highlight the paths to the adjacent nodes by showing a clearColor “connections” view behind the nodes that is sized to contain the nodes of interest. This view contains child views for each path and each of these path views has a drawRect method that draws a single line that appears behind the source node and each adjacent node. All well and good and this approach opens the potential for doing interesting things with the paths in the future.

However, I recently added code to detect an external display with the idea that the main display would be a zoomed in view inside a scroll view and the external display would show the global view of all nodes. It worked fine until I added the connection view to the external display to show what was selected by touch on the main display. My path views (and their parent and grand parent views) are identical as far as I can tell, never have their drawRect methods called, as do their main view cousins, after setNeedsDisplay has been called. They are both initialized in the same place and in the same way.

I’ve tried dozens (hundreds?) of things to isolate the problem, but haven’t figured out the problem. If I add a generic UIView to the connections view it appears in both places, but my path view, which extends UIView by adding a drawRect, only gets called on my main display and never on my external display.

I’ve run out of ideas. Does anyone have any ideas on what might be the cause of the problem?

  • 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-12T07:18:00+00:00Added an answer on June 12, 2026 at 7:18 am

    I was pulling hair trying to figure this one out. Comparing the state of the two views did not show any difference. A few days ago I finally decided to write some a python routine to run in LLDB that would dump the state of the objects and then did a diff on the two views. It turns out that they were attempting to show the same subviews!

    In order to minimize object creation I was stuffing the path subviews into an array to avoid creating more than I ever needed and hiding them when not in use. But, I had stupidly declared this array outside of the @interface block and had inadvertently made it into a global and so both views were using the last set of subviews defined. Of course, a view cannot be a child of more than one parent view. Moving the declaration into the right place fixed the problem.

    Dumb error! But perhaps this will jog something for someone else with a similar problem.

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

Sidebar

Related Questions

We have a backbone.js app that displays a number of forms to the user.
I have an app that displays products for a client. The user has the
I have a node.js app that loads a signup form when visiting localhost/user/signup: html
I have an App that displays thousands of Pin annotations on a google map
I have an app that displays a splash screen. The splash screen activity creates
I have an app that displays 9 UIImageViews, and I'm adding in the ability
I have an app that displays 9 UIImageViews, and I'm trying to add in
I have an App that downloads and displays images from URL's. This works fine
I have a winforms app that initially displays a window with two file dialog
I have a listbox for a Windows Phone 7 app that displays info parsed

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.