{"id":2471,"date":"2022-08-30T15:25:08","date_gmt":"2022-08-30T15:25:08","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/01\/17\/how-to-find-out-which-uiviews-are-on-the-screen-at-runtime-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:25:08","modified_gmt":"2022-08-30T15:25:08","slug":"how-to-find-out-which-uiviews-are-on-the-screen-at-runtime-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/how-to-find-out-which-uiviews-are-on-the-screen-at-runtime-collection-of-common-programming-errors\/","title":{"rendered":"how to find out which UIVIews are on the screen at runtime-Collection of common programming errors"},"content":{"rendered":"<p>I am working on an iPhone app that has a complex way of constructing its views, I am at a point where some of the UI behavior is not consistent and some UI views are not being presented properly, without going into a lot of details, I am looking for a way at runtime to find out each and every UI element on the screen, and its location and whatever information I can get about it ( the UI stack, the layering, which UIVIew is on top of what ) is that available to developers\/<\/p>\n<p>Thanks.<\/p>\n<ol>\n<li>\n<p>In debug console, send <code>recursiveDescription<\/code> message to your topmost view.<\/p>\n<pre><code>(lldb) po [self.view recursiveDescription]\n(id) $1 = 0x0929f000 \n   | \n   |    | \n   |    | \n(lldb) \n<\/code><\/pre>\n<\/li>\n<li>\n<p><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/90sg6.jpg\" \/><\/p>\n<p>I&#8217;m the author of a tool called the Spark Inspector that allows you to view and interact with your app&#8217;s UIViews while it&#8217;s running. I put it together because I found myself using <code>-recursiveDescription<\/code> all the time and pouring over the console output was annoying-I think it&#8217;s probably just what you need. Instead of calling <code>-recursiveDescription<\/code>, you add a framework to your app that lets the inspector tool connect and show you your views.<\/p>\n<p>There are two other tools I&#8217;d recommend checking out as well: PonyDebugger and DCIntrospect. They take a bit more setup, but they&#8217;re both lifesavers if you find yourself needing to debug views.<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2014-01-17 07:09:46. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I am working on an iPhone app that has a complex way of constructing its views, I am at a point where some of the UI behavior is not consistent and some UI views are not being presented properly, without going into a lot of details, I am looking for a way at runtime to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2471","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2471","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2471"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2471\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2471"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2471"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2471"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}