iPhone – Internet Strategy Guide https://phpprotip.com Together we can defeat the internet Tue, 07 Mar 2017 02:01:20 +0000 en-US hourly 1 https://wordpress.org/?v=4.7.29 55205001 Copyright © Internet Strategy Guide 2013 chance@chancegarcia.com (Internet Strategy Guide) chance@chancegarcia.com (Internet Strategy Guide) http://phpprotip.com/wp-content/plugins/podpress/images/powered_by_podpress.jpg Internet Strategy Guide https://phpprotip.com 144 144 Together we can defeat the internet Internet Strategy Guide Internet Strategy Guide chance@chancegarcia.com no no ‘UIViewControllerHierarchyInconsistency’, reason: ‘A view can only be associated with at most one view controller at a time! https://phpprotip.com/2013/07/uiviewcontrollerhierarchyinconsistency-reason-a-view-can-only-be-associated-with-at-most-one-view-controller-at-a-time/ https://phpprotip.com/2013/07/uiviewcontrollerhierarchyinconsistency-reason-a-view-can-only-be-associated-with-at-most-one-view-controller-at-a-time/#respond Wed, 24 Jul 2013 00:23:19 +0000 http://phpprotip.com/?p=579 So I was working on an iOS app for a client and received this error when trying to launch the app in iOS simulator. I was assured that the repository I was pulling from was the same codebase as the app currently in the store. After googling, I found several stackoverflow questions on this with a lot of text answers and 1 with a very short explanation with a before and after screenshot that didn’t explain much. As you can tell by the blog URL, iOS is currently not my programming strength, so I decided to make a blog post to go slightly deeper into this and compile the bits I learned from debugging this.

First of all, the reason I encountered was due to a change introduced in iOS 6. I forget what it was exactly but that’s why we’re seeing this error message.  What error message? Something that looks like this:

2013-07-12 11:07:52.775 App[3545:c07] *** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'A view can only be associated with at most one view controller at a time! View <UIScrollView: 0x89780c0; frame = (0 20; 320 548); autoresize = W+H; gestureRecognizers = <NSArray: 0x8979730>; layer = <CALayer: 0x89782c0>; contentOffset: {0, 0}> is associated with <UIViewController: 0x8979cc0>. Clear this association before associating this view with <RootViewController: 0x753ed50>.'
*** First throw call stack:
(0x172b012 0x1110e7e 0x172adeb 0x481cb9 0x518f7c 0x515440 0x845be 0x840e7 0xaeb58 0x651019 0x1124663 0x172645a 0x64fb1c 0x5147e7 0x514dc8 0x514ff8 0x515232 0x5154da 0x52c8e5 0x52c9cb 0x52cc76 0x52cd71 0x52d89b 0x52edc6 0x52f065 0x52f1a8 0x52f5b9 0x52f257 0x52f1de 0x11bfd 0x15c589 0x15a652 0x15b89a 0x15a60d 0x15a785 0xa7a68 0x1a38911 0x1a37bb3 0x1a75cda 0x16cd8fd 0x1a7635c 0x1a762d5 0x1960250 0x16aef3f 0x16ae96f 0x16d1734 0x16d0f44 0x16d0e1b 0x20657e3 0x2065668 0x433ffc 0x1fdd 0x1f15)
libc++abi.dylib: terminate called throwing an exception

So we, obviously, have the title of this article:

'UIViewControllerHierarchyInconsistency', reason: 'A view can only be associated with at most one view controller at a time!

followed by the important part:

<UIScrollView: 0x89780c0; frame = (0 20; 320 548); autoresize = W+H; gestureRecognizers = <NSArray: 0x8979730>; layer = <CALayer: 0x89782c0>; contentOffset: {0, 0}> is associated with <UIViewController: 0x8979cc0>. Clear this association before associating this view with <RootViewController: 0x753ed50>.'

This is telling us a few things:

  1. The main issue is in RootViewController
  2. UIScrollView and UIViewController are in some sort of Highland/ThunderDome situation

    Highlander: The Game
    Highlander: The Game (Photo credit: Wikipedia)

So we should open up the problem file:

full view

Hey! Look, there’s the ViewController and something called Scroll View. We’re probably on the right track. It’s right there, under Objects. Let’s take a closer look at that.

 

 

 

 

 

 

issue

 So what iOS 6 is complaining about is we have a view within a view in our view controller (kinda like Inception).
So what do we have to do to solve this? Let’s take the Scroll View child and make it a sibling.
solution
Well now that View Controller is kinda useless, let’s clean that up.
cleanup
Oh yeah, I read something about the File’s Owner Class, so let’s change that too. I’m putting a pic in of this because it’s a change I made and I’m not sure if it actually has anything to do with this but figure I’d rather have too many steps than not enough steps.

file owner classThere you have it. That’s my how I solved this issue. Hope it works for you. Hopefully someday, I can come back to this and give a more thorough explanation but for now, this is all I got.

Enhanced by Zemanta
]]>
https://phpprotip.com/2013/07/uiviewcontrollerhierarchyinconsistency-reason-a-view-can-only-be-associated-with-at-most-one-view-controller-at-a-time/feed/ 0 579
iPhone 2.1 firmware impressions https://phpprotip.com/2008/09/iphone-21-firmware-impressions/ https://phpprotip.com/2008/09/iphone-21-firmware-impressions/#comments Fri, 12 Sep 2008 18:56:11 +0000 http://magic.garciawebapps.com/?p=32 Update: so far the battery life is holding out to be good. I’m getting less call fails but not sure if that’s just a coincidence. Installs are definitely faster. Mail seems the same. Genius is awesome. Texting and contacts seem the same. Going to keep checking things out over the weekend.

Like anyone else who owns an iPhone 3G, I’ve been excited about today. I would like to right a full review on this but need to get work done so impressions will have to do. I did find a 2.1 firmware review at iSmashPhone.com.

Let’s start with what this update is according to the apple site, we get the following:

  • Decrease in call set-up failures and dropped calls
  • Significantly better battery life for most users
  • Dramatically reduced time to backup to iTunes
  • Improved email reliability, notably fetching email from POP and Exchange accounts
  • Faster installation of 3rd party applications
  • Fixed bugs causing hangs and crashes for users with lots of third party applications
  • Improved performance in text messaging
  • Faster loading and searching of contacts
  • Improved accuracy of the 3G signal strength display
  • Repeat alert up to two additional times for incoming text messages
  • Option to wipe data after ten failed passcode attempts
  • Genius playlist creation

The big thing (for me) out of this update is the “Dramatically reduced time to backup to iTunes” and OMG it is amazing. It still takes a while to back up but comparatively to before, it is like comparing a 28.8 modem to a T1. As for everything else, I haven’t had time to test and will probably play with things over the weekend. Below is a quick overview of what I noticed.

My reception at works sucks so can’t really say much on the “Decrease in call set-up failures and dropped calls” part until I get to a good area, even then, it would be best to test over the week end. The same goes with the battery claim, time will tell if that holds true. Actually everything else would also require a brief test period to have a proper impression. Though one thing I can ‘test’ is the Genius playlist, which I’m going to play with now and will update this post later.

]]>
https://phpprotip.com/2008/09/iphone-21-firmware-impressions/feed/ 1 32