# Login Controller segue to TabBar Controller keeps crashing in 'MyLocations'

**URL:** <https://forums.kodeco.com/t/login-controller-segue-to-tabbar-controller-keeps-crashing-in-mylocations/15496>\
**Category:** iOS Apprentice\
**Created:** [June 3, 2016, 5:50am UTC](https://forums.kodeco.com/t/login-controller-segue-to-tabbar-controller-keeps-crashing-in-mylocations/15496 "2016-06-03T05:50:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pgmavro79](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/pgmavro79/32/38076_2.png) [@pgmavro79](https://forums.kodeco.com/u/pgmavro79)\
**Post date:** [June 3, 2016, 5:50am UTC](https://forums.kodeco.com/t/login-controller-segue-to-tabbar-controller-keeps-crashing-in-mylocations/15496/1 "2016-06-03T05:50:07Z")

</div>

I’m trying to attach a login controller to tabbar controller. My Login Controller modal segue to TabBar Controller keeps crashing in ‘MyLocations’; the file I’m working with from iOS Apprentice. Any suggestions would be great.

 ![](https://raywenderlich-com-v3-forums.s3.amazonaws.com/original/3X/1/7/17daf07f183bec73d698dd4e2267c4659eac2e67.png)

---

<div class="post-metadata">

**Author:** ![hollance](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/hollance/32/109009_2.png) [@hollance](https://forums.kodeco.com/u/hollance)\
**Post date:** [June 3, 2016, 8:44am UTC](https://forums.kodeco.com/t/login-controller-segue-to-tabbar-controller-keeps-crashing-in-mylocations/15496/2 "2016-06-03T08:44:18Z")

</div>

You have some variable that is `nil`. It’s hard to say what is going wrong without more info.

On what line does the app crash?

---

<div class="post-metadata">

**Author:** ![pgmavro79](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/pgmavro79/32/38076_2.png) [@pgmavro79](https://forums.kodeco.com/u/pgmavro79)\
**Post date:** [June 3, 2016, 9:24am UTC](https://forums.kodeco.com/t/login-controller-segue-to-tabbar-controller-keeps-crashing-in-mylocations/15496/3 "2016-06-03T09:24:26Z")

</div>

MIH. Awesome! You made ‘MyLocations’. It’s a pleasure to be chatting with you. Here’s my screenshot:

 ![](https://raywenderlich-com-v3-forums.s3.amazonaws.com/original/3X/7/4/74353e3f2f1291a18384849cf7fed528c5697bdc.png)

 ![](https://raywenderlich-com-v3-forums.s3.amazonaws.com/original/3X/4/9/49b870c9f30e55c147a6a2ec8b6f51f0eaef610d.png)

---

<div class="post-metadata">

**Author:** ![hollance](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/hollance/32/109009_2.png) [@hollance](https://forums.kodeco.com/u/hollance)\
**Post date:** [June 4, 2016, 4:02pm UTC](https://forums.kodeco.com/t/login-controller-segue-to-tabbar-controller-keeps-crashing-in-mylocations/15496/4 "2016-06-04T16:02:49Z")

</div>

Note the error message about casting Lousy\_car.DigitsViewController to UITabBarController. That’s probably related to the crash.

---

<div class="post-metadata">

**Author:** ![pgmavro79](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/pgmavro79/32/38076_2.png) [@pgmavro79](https://forums.kodeco.com/u/pgmavro79)\
**Post date:** [June 4, 2016, 10:57pm UTC](https://forums.kodeco.com/t/login-controller-segue-to-tabbar-controller-keeps-crashing-in-mylocations/15496/5 "2016-06-04T22:57:58Z")

</div>

I deleted the tabbar function in app delegate. The segue worked but the app crashes when you click a tab bar item. I added the function back in so I’m back to square one.

---

<div class="post-metadata">

**Author:** ![pgmavro79](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/pgmavro79/32/38076_2.png) [@pgmavro79](https://forums.kodeco.com/u/pgmavro79)\
**Post date:** [June 5, 2016, 9:12am UTC](https://forums.kodeco.com/t/login-controller-segue-to-tabbar-controller-keeps-crashing-in-mylocations/15496/6 "2016-06-05T09:12:15Z")

</div>

Whats your contact info?

---

<div class="post-metadata">

**Author:** ![pgmavro79](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/pgmavro79/32/38076_2.png) [@pgmavro79](https://forums.kodeco.com/u/pgmavro79)\
**Post date:** [June 5, 2016, 4:31pm UTC](https://forums.kodeco.com/t/login-controller-segue-to-tabbar-controller-keeps-crashing-in-mylocations/15496/7 "2016-06-05T16:31:49Z")

</div>

I fixed it! The mistake was I made a UIViewController when I should’ve made a TabBarController. Rookie mistake. I’m learning.

---

<div class="post-metadata">

**Author:** ![pgmavro79](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/pgmavro79/32/38076_2.png) [@pgmavro79](https://forums.kodeco.com/u/pgmavro79)\
**Post date:** [June 6, 2016, 12:55pm UTC](https://forums.kodeco.com/t/login-controller-segue-to-tabbar-controller-keeps-crashing-in-mylocations/15496/8 "2016-06-06T12:55:48Z")

</div>

Now the app crashes when 2/4 view controllers segued from the tab bar are selected. The two controllers also have a navigation controller embedded within them.
