0

I'm working my way through Stanford's iOS 7 course and I'm stuck at Task 1 on Assignment 4.

I linked two scenes via CTRL + click to a Tab Bar Controller. I'll call them Scene A and Scene B.

If I link Scene A first, the app loads and does what it's supposed to...until I click the tab for Scene B, at which point the app crashes with the following exception:

2014-06-25 13:31:12.255 Matchismo[4976:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSRegularExpression enumerateMatchesInString:options:range:usingBlock:]: nil argument'

If I link Scene B first, the app crashes out of the gate, despite no compiler errors. Both scenes have a view controller set for them. Scene B's view controller is a subclass of Scene A's view controller.

Where should I be looking for the problem?

hackerinheels
  • 1,141
  • 1
  • 6
  • 14
iOSPadawan
  • 146
  • 2
  • 10
  • Have you tried [debugging your small program](http://ericlippert.com/2014/03/05/how-to-debug-small-programs/)? – i_am_jorf Jun 25 '14 at 17:10
  • what message appears in the console when the app crashes? – YarGnawh Jun 25 '14 at 17:23
  • 2014-06-25 13:31:12.255 Matchismo[4976:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSRegularExpression enumerateMatchesInString:options:range:usingBlock:]: nil argument' – iOSPadawan Jun 25 '14 at 17:32
  • Post code from the second view controller or whereever are you using NSRegularExpression? – hackerinheels Jun 25 '14 at 21:08
  • Thank you to those who responded. I was able to solve the problem by going to Window/Organizer in XCode, highlighting the project in the lefthand column of the view, and deleting the derived data. – iOSPadawan Jun 30 '14 at 03:28

1 Answers1

0

Always post the error message with your question. Did you google your error? Follow this link,

NSRegularExpression enumerateMatchesInString:options:range:usingBlock: giving a null result?

I believe your error is not related to your tab view controller, but what's inside your view B. They're not empty, right?

Community
  • 1
  • 1
brixtar
  • 236
  • 3
  • 17
  • I ended up nuking the derived data and the app worked. I'm not sure how or why, but it works. Thank you for answering my rookie question. – iOSPadawan Jun 30 '14 at 03:30
  • No problem. Nice it worked out. I made that mistake when I posted my first question here, so I thought I pass it on ;) – brixtar Jun 30 '14 at 14:27