4

I'm a newbie and i'm having this error, i looked up everywhere and i can't find the solution. Any help would be really appreciated!

  0   CoreFoundation                      0x00000001102bb34b __exceptionPreprocess + 171
  1   libobjc.A.dylib                     0x000000010d61c21e objc_exception_throw + 48
  2   CoreFoundation                      0x00000001102bb299 -[NSException raise] + 9
  3   Foundation                          0x000000010d12c2ff -[NSObject(NSKeyValueCoding) setValue:forKey:] + 291
  4   UIKit                               0x000000010dbafc01 -[UIView(CALayerDelegate) setValue:forKey:] + 173
  5   UIKit                               0x000000010def9be6 -[UIRuntimeOutletConnection connect] + 109
  6   CoreFoundation                      0x0000000110260590 -[NSArray makeObjectsPerformSelector:] + 256
  7   UIKit                               0x000000010def856a -[UINib instantiateWithOwner:options:] + 1867
  8   UIKit                               0x000000010dc451e8 -[UITableView _dequeueReusableViewOfType:withIdentifier:] + 399
  9   UIKit                               0x000000010dc456e0 -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:] + 71
  10  Foodtracker                         0x000000010d0274e7 _TFC11Foodtracker23MealTableViewController9tableViewfTCSo11UITableView12cellForRowAtV10Foundation9IndexPath_CSo15UITableViewCell + 199
  11  Foodtracker                         0x000000010d027a97 _TToFC11Foodtracker23MealTableViewController9tableViewfTCSo11UITableView12cellForRowAtV10Foundation9IndexPath_CSo15UITableViewCell + 87
  12  UIKit                               0x000000010dc58ba9 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 757
  13  UIKit                               0x000000010dc58e07 -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 74
  14  UIKit                               0x000000010dc2c871 -[UITableView _updateVisibleCellsNow:isRecursive:] + 3295
  15  UIKit                               0x000000010dc62189 -[UITableView _performWithCachedTraitCollection:] + 110
  16  UIKit                               0x000000010dc489e3 -[UITableView layoutSubviews] + 222
  17  UIKit                               0x000000010dbb0344 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1237
  18  QuartzCore                          0x000000011306acdc -[CALayer layoutSublayers] + 146
  19  QuartzCore                          0x000000011305e7a0 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
  20  QuartzCore                          0x000000011305e61e _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
  21  QuartzCore                          0x0000000112fec62c _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 280
  22  QuartzCore                          0x0000000113019713 _ZN2CA11Transaction6commitEv + 475
  23  QuartzCore                          0x000000011301a083 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 113
  24  CoreFoundation                      0x000000011025fe17 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
  25  CoreFoundation                      0x000000011025fd87 __CFRunLoopDoObservers + 391
  26  CoreFoundation                      0x00000001102444b6 CFRunLoopRunSpecific + 454
  27  UIKit                               0x000000010dae5db6 -[UIApplication _run] + 434
  28  UIKit                               0x000000010daebf34 UIApplicationMain + 159
  29  Foodtracker                         0x000000010d028c4f main + 111
  30  libdyld.dylib                       0x00000001111e568d start + 1
  31  ???                                 0x0000000000000001 0x0 + 1

) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

nano_dorado
  • 89
  • 2
  • 2
  • 10
  • What are you trying to do? I can only infer that in the dequeueReusableCellWithIdentifier:forIndexPath: method, you are returning some Cell in which you must be having some property previously but you deleted that property. – Praveen Oct 12 '16 at 18:36
  • Do you have objective-c exception breakpoints turned on? If not, turn them on and when crashes like this occur you'll be taken to the line where it happens. – Mike Oct 12 '16 at 19:08
  • 2
    It takes me to the line: class AppDelegate: UIResponder, UIApplicationDelegate { – nano_dorado Oct 13 '16 at 23:53

5 Answers5

5

Check your storyboard: All the IBAction, IBOutlet connected and with their current names? It's actually happens when problem with iboutlets

Andrew Veresov
  • 321
  • 1
  • 6
3

If you just updated to Swift 4 and have issues running your app on iOS 11 device or simulator, maybe you have the same issue I had with the UIVisualEffectView, and specifically with adding subviews to it.

Apple's documentation says:

Add subviews to the contentView and not to UIVisualEffectView directly.

Basically, instead of adding subviews directly to the UIVisualEffectView, add them to its .contentView.

Example:

// create UIVisualEffectView
let blackBlur = UIVisualEffectView(effect: UIBlurEffect(style: .dark))

// adding a subview - this worked on iOS 10 - crashes the app on iOS 11
blackBlur.addSubview(someView)

// this works on both iOS 10 and iOS 11
blackBlur.contentView.addSubview(someView)

I hope this helps someone since it took me a while to figure this one out.

budiDino
  • 13,044
  • 8
  • 95
  • 91
2

If anyone is running into this problem make sure that you

  1. Go to Main.storyboard
  2. RIGHT click on the yellow box icon (view controller) at the top of the phone outline
  3. DELETE the outlet(s) with yellow flags.

What happens in instances like this is you probably named an action, then renamed it. You need to delete the old name and if that was the only issue will start right up in simulator!

NOTE: most of the time this happens because of wrong connection so double check and make sure all outlet connections are correct.

Atlas_Gondal
  • 2,512
  • 2
  • 15
  • 25
0

The raising method is setValue:forKey:, which is called after a table view cell was dequeued. Apparently in the MealTableViewController.

Check your table view cells XIB, there might be an IBOutlet remaining with a wrong name, or maybe a property set with the wrong name.

AirXygène
  • 2,409
  • 15
  • 34
0

If you are using Firebase and have this problem when you upload be careful with the key value. The keys should not include '#' or '%' or etc. I just deleted and worked fine.

Ahmadiah
  • 476
  • 5
  • 12