collectionView.performBatchUpdates throwing Fatal Exception: NSInternalInconsistencyException - ios

I've been receiving a crash report from crashlytics-
Fatal Exception: NSInternalInconsistencyException 0 CoreFoundation
0x9e48 __exceptionPreprocess 1 libobjc.A.dylib 0x178d8
objc_exception_throw 2 Foundation 0x54594c
_userInfoForFileAndLine 3 UIKitCore 0x310db4 -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:collectionViewAnimator:]
4 UIKitCore 0x2703c8 -[UICollectionView
_performBatchUpdates:completion:invalidationContext:tentativelyForReordering:animator:animationHandler:]
5 0xd1a0dc
I am sharing a piece of code responsible for the crash, Although my collectionview have a huge code
collectionView.performBatchUpdates({
self.marketBatchUpdates(selectedOrderType: selectedOrderType)
}, completion: nil)
private func marketBatchUpdates(selectedOrderType: BrokerageTradingOrderTypeV2) {
let wasShowingSubmitButton = self.shouldShowSubmitButton()
if selectedOrderType != .Market {
if selectedOrderType == .Stop {
self.selectedOrderType = .Market
if self.showStopDisclosure == true {
collectionView.deleteItems(at: stopOrderDisclosureIndexPaths())
}
}
self.selectedOrderType = .Market
if selectedOrderType == .Limit || selectedOrderType == .StopLimit {
if self.selectedTerm == .DAY || self.selectedTerm == .GTC || self.selectedTerm == .SELECT {
collectionView.deleteItems(at: qualifierIndexPaths())
}
}
self.selectedTerm = .DAY
collectionView.reloadItems(at: termIndexPaths())
}
self.selectedOrderType = .Market
collectionView.reloadItems(at: orderTypeIndexPaths())
self.showOrderTypeSelections = false
collectionView.deleteItems(at: selectionsIndexPaths())
self.updateSubmitButton(previousSubmitButtonState: wasShowingSubmitButton)
}

Related

Firebase fetching causes crash for some users

When I try to fetch user data from Firebase a crash occurs for some users, I can't reproduce this crash myself but I do have the following crash log:
0 Ski Tracker 0x77bf0 closure #1 in HistoryPresenter.downloadHistory(completionHandler:) + 4340857840 (HistoryPresenter.swift:4340857840)
1 Ski Tracker 0x86c8 closure #1 in FetchFromDatabase.fetchUserHistoryFromDatabase(uid:completionHandler:) + 4340401864 (<compiler-generated>:4340401864)
2 Ski Tracker 0x8604 thunk for #escaping #callee_guaranteed (#guaranteed FIRDataSnapshot) -> () + 4340401668 (<compiler-generated>:4340401668)
3 FirebaseDatabase 0x1df28 __92-[FIRDatabaseQuery observeSingleEventOfType:andPreviousSiblingKeyWithBlock:withCancelBlock:]_block_invoke + 120
4 FirebaseDatabase 0xbf94 __43-[FChildEventRegistration fireEvent:queue:]_block_invoke.11 + 80
5 libdispatch.dylib 0x24b4 _dispatch_call_block_and_release + 32
6 libdispatch.dylib 0x3fdc _dispatch_client_callout + 20
7 libdispatch.dylib 0x127f4 _dispatch_main_queue_drain + 928
8 libdispatch.dylib 0x12444 _dispatch_main_queue_callback_4CF + 44
9 CoreFoundation 0x9a6f8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
10 CoreFoundation 0x7c058 __CFRunLoopRun + 2036
11 CoreFoundation 0x80ed4 CFRunLoopRunSpecific + 612
12 GraphicsServices 0x1368 GSEventRunModal + 164
13 UIKitCore 0x3a23d0 -[UIApplication _run] + 888
14 UIKitCore 0x3a2034 UIApplicationMain + 340
15 libswiftUIKit.dylib 0x35308 UIApplicationMain(_:_:_:_:) + 104
16 Ski Tracker 0x7160 main + 4340396384 (FriendView.swift:4340396384)
17 ??? 0x1f6938960 (Missing)
If I understand the crash log correctly the code which is causing the crash is within the fetchUserHistoryFromDatabase function:
func fetchUserHistoryFromDatabase(uid : String, completionHandler: #escaping([String : Any]?) -> Void ) {
ref?.child("users").child(uid).child("runData").observeSingleEvent(of: .value, with: { snapshot in
guard let result = snapshot.value as? [String:Any] else {
print("Error no rundata")
completionHandler(nil)
return
}
completionHandler(result)
})
}
This function is called from downloadHistory where potential nil values are handled:
private func downloadHistory(completionHandler: #escaping () -> Void) {
if let id = Auth.auth().currentUser?.uid {
FetchFromDatabase().fetchUserHistoryFromDatabase(uid : id, completionHandler: { [weak self] dict in
if dict != nil {
for run in dict! {
self?.determineTimeStamp(run : run)
}
if !(self!.tempDict.isEmpty) {
let sortedDict = self?.tempDict.keys.sorted(by: { $0 > $1 } )
self?.convertDictToArray(sortedDict: sortedDict!)
}
}
completionHandler()
}
)}
}
Any help here is greatly appreciated.
Remove the force unwrapping from your code. Every ! is an invitation for a crash.
private func downloadHistory(completionHandler: #escaping () -> Void) {
if let id = Auth.auth().currentUser?.uid {
FetchFromDatabase().fetchUserHistoryFromDatabase(uid : id, completionHandler: { [weak self] dict in
guard let self = self else {
completion()
return
}
if let dict = dict {
for run in dict {
self.determineTimeStamp(run : run)
}
if !self.tempDict.isEmpty {
let sortedDict = self.tempDict.keys.sorted(by: { $0 > $1 } )
self.convertDictToArray(sortedDict: sortedDict)
}
}
completionHandler()
}
)}
}
I notice a self! there dangerous, because a user could leave the calling context of the function and since the closure has a capture list of weak self, it should return nil but you are forcing it
try this
private func downloadHistory(completionHandler: #escaping () -> Void) {
if let id = Auth.auth().currentUser?.uid {
FetchFromDatabase().fetchUserHistoryFromDatabase(uid : id, completionHandler: { [weak self] dict in
guard let self = self else { completionHandler()
return }
if let safeDict = dict {
for run in dict {
self.determineTimeStamp(run : run)
}
if (self.tempDict.isEmpty) {
let sortedDict = self.tempDict.keys.sorted(by: { $0 > $1 } )
self.convertDictToArray(sortedDict: sortedDict)
}
}
completionHandler()
}
)}
}

Crashed: com.apple.main-thread partial apply for closure #2

Crashes are reported into firebase console. Can anyone help me. i am sending data to server using Socket.
Here is crash description:
Crashed: com.apple.main-thread
0 AppName 0x10ef40 partial apply for closure #2 in sendDataRecursively() + 4329697088 (swift:4329697088)
1 AppName 0x23824 thunk for #escaping #callee_guaranteed () -> () + 4328732708 (<compiler-generated>:4328732708)
2 libdispatch.dylib 0x1e68 _dispatch_call_block_and_release + 32
3 libdispatch.dylib 0x3a2c _dispatch_client_callout + 20
4 libdispatch.dylib 0x11f48 _dispatch_main_queue_drain + 928
5 libdispatch.dylib 0x11b98 _dispatch_main_queue_callback_4CF + 44
6 CoreFoundation 0x522f0
CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
7 CoreFoundation 0xc1f4 __CFRunLoopRun + 2532
8 CoreFoundation 0x1f6b8 CFRunLoopRunSpecific + 600
9 GraphicsServices 0x1374 GSEventRunModal + 164
10 UIKitCore 0x513e88 -[UIApplication _run] + 1100
11 UIKitCore 0x2955ec UIApplicationMain + 364
12 AppName 0x48dac main + 17 (AppDelegate.swift:17)
13 ??? 0x1008edce4 (Missing)
Here is my function:
#objc func sendDataRecursively() {
let reachability = try! Reachability()
if reachability.connection != .unavailable {
DispatchQueue.global(qos: .userInitiated).async { //previous .bakground
if self.msgCnt == 127 {
self.msgCnt = 0
}
self.msgCnt += 1
self.sendRequest()
}
} else {
DispatchQueue.main.async {
self.previousStatusWhenDisconnect = self.motionDetectionLbl?.text ?? ""
self.appDelegate.statusLbl?.text = String(format: "%# %#", (self.appDelegate.statusLbl?.text)!, StartVCStringsEnglish.disConnectedString)
}
self.networkTimer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(self.checkNetworkRecursively), userInfo: nil, repeats: true)
}
}
Here is the my other function. i am sending data to my Socket function. i did't got the crash but its reported into firebase. Also in firebase has not much more information about the crash. its just show the function name only.
private func sendRequest() {
self.calculateMessageData()
var requestData: Data?
var txData = [UInt8()]
var crc: Int
if self.msgID == Int8(EnMessageType.basicSafetyMessage.rawValue) {
requestData = self.getBasicSafetyMessage()
} else {
requestData = self.getPersonalSafetyMessage()
}
crc = computeCRC(data: requestData!, length: requestData!.count)
// wrap data in 7E, do byte stuffing and add CRC
txData = []
txData.append(0x7E)
for ii in 0..<requestData!.count {
switch requestData![ii] {
case 0x7D:
txData.append(0x7D)
txData.append(0x5D)
break
case 0x7E:
txData.append(0x7D)
txData.append(0x5E)
break
default:
txData.append(requestData![ii])
break
}
}
txData.append((UInt8)(crc >> 8))
txData.append((UInt8)(crc & 0xFF))
txData.append(0x7E)
requestData = (Data)(txData)
if AppSingletonVariable.sharedInstance.isConnected == true { AppSingletonVariable.sharedInstance.mySocket.sendDataToServer(reqData: requestData!)
}
}
Thanks,
You can see from the crash description that there is issue in 2nd closure in sendDataRecursively() function:
DispatchQueue.main.async {
self.previousStatusWhenDisconnect = self.motionDetectionLbl?.text ?? ""
self.appDelegate.statusLbl?.text = String(format: "%# %#", (self.appDelegate.statusLbl?.text)!, StartVCStringsEnglish.disConnectedString)
}
self.networkTimer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(self.checkNetworkRecursively), userInfo: nil, repeats: true)
The issue is probably '!' in this expression:
(self.appDelegate.statusLbl?.text)!
If statusLbl is nil, this code crashes. As it was mentioned in comment, it's not safe to force unwrap optionals and this is the reason.
Replace your closure with this:
DispatchQueue.main.async {
self.previousStatusWhenDisconnect = self.motionDetectionLbl?.text ?? ""
if let text = self.appDelegate.statusLbl?.text {
self.appDelegate.statusLbl?.text = String(format: "%# %#", text, StartVCStringsEnglish.disConnectedString)
}
}
self.networkTimer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(self.checkNetworkRecursively), userInfo: nil, repeats: true)

Crash with EXC_BAD_ACCESS KERN_INVALID_ADDRESS

When delegate is call, is crash with: EXC_BAD_ACCESS KERN_INVALID_ADDRESS
I can't understand what caused it..
func updateAnnotationLocation(_ annotation:Annotation,isNewAction:Bool){
self.updateAnnotationOnView(annotation)
if annotation.type == .Note {
(annotation as! NoteAnnotation).updateTextViewFrame()
}
var index = 0
while index<self.annotations.count {
if annotation.id == self.annotations[index].id {
if isNewAction {
let action = AnnotationAction(type: AnnotationActionType.UpdateAnnotationLocation, annotationBeforeAction: self.annotations[index],annotationAfterAction: annotation)
self.addActionToActionsList(action)
}
self.annotations[index] = annotation
if let selectedAnnotation = self.selectedAnnotation {
if annotation.id == selectedAnnotation.id {
self.selectedAnnotation = annotation
}
}
break
}
index += 1
}
}
Crash on:
if annotation.id == self.annotations[index].id
stack trace:
#0 Crashed: com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000020
0 libobjc.A.dylib objc_retain + 16
1 FielNoteAnnotation.swift line 0 initializeWithCopy for NoteAnnotation
2 AnnotationViewController.swift line 746 AnnotationsViewController.updateAnnotationLocation(_:isNewAction:)
3 AnnotationViewController.swift line 915 AnnotationsViewController.undo()
4 AnnotationViewController.swift line 513 AnnotationsViewController.undo(_:)
5 AnnotationViewController.swift line 0 #objc AnnotationsViewController.undo(_:)

DidSelect after SearchController is used causes crash swift

I have a TableView and a Search Controller. They both work perfectly with regards to displaying the info, searching, etc. The problem arises when you go to select one of the cells.
In my code, there are 4 ways you can select the cell... If a bool isAboutNewPost == true / false, and if the search is active or not. If the search controller is active, I am using the data from a filtered array.
When you select a cell and the search controller is not active, it works perfectly. When you select a cell and the search controller is active, but the bool is false, it works perfectly. When you select a cell and the search controller is active and the bool is true, it crashes. I have no clue why, because it is almost identical code.
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
//
self.resultSearchController.endEditing(true)
switch(segmentControl.selectedSegmentIndex)
{
case 0:
if self.theResultSearchController.active {
self.theResultSearchController.hidesNavigationBarDuringPresentation = false
print("it is in search")
let indexPath = tableView.indexPathForSelectedRow
let currentCell = tableView.cellForRowAtIndexPath(indexPath!) as! NewAddPostTableViewCell
theResultSearchController.active = false
print("Going to Did Select Name!")
// self.performSegueWithIdentifier("transferToAddChinUp", sender: currentCell.name.text)
let sb = UIStoryboard(name: "Main", bundle: nil)
if self.isAboutNewPost == true {
print("There was a new post.")
let messagesVC = sb.instantiateViewControllerWithIdentifier("AddChinUpScreen") as! AddChinUpViewController
messagesVC.userObjectId = currentCell.nameLabel.text
messagesVC.thereWasJustANewPost = true
print("i got to right here.")
self.navigationController?.pushViewController(messagesVC, animated: true)
// new line
//self.performSegueWithIdentifier("transferToAddChinUp", sender: currentCell.nameLabel.text)
} else {
print("There wasn't a new post.")
let messagesVC = sb.instantiateViewControllerWithIdentifier("AddChinUpScreen") as! AddChinUpViewController
messagesVC.userObjectId = currentCell.nameLabel.text
self.navigationController?.pushViewController(messagesVC, animated: true)
//self.performSegueWithIdentifier("didSelectName", sender: currentCell.nameLabel.text)
}
} else {
if self.isAboutNewPost == true {
print("it is not in search")
let indexPath = tableView.indexPathForSelectedRow
let currentCell = tableView.cellForRowAtIndexPath(indexPath!) as! NewAddPostTableViewCell
print("Going to transferToAddChinUp!")
self.performSegueWithIdentifier("transferToAddChinUp", sender: currentCell.nameLabel.text)
} else {
print("it is not in search")
let indexPath = tableView.indexPathForSelectedRow
let currentCell = tableView.cellForRowAtIndexPath(indexPath!) as! NewAddPostTableViewCell
print("Going to Did Select Name!")
self.performSegueWithIdentifier("didSelectName", sender: currentCell.nameLabel.text)
}
}
break
case 1:
if self.theResultSearchController.active {
self.theResultSearchController.hidesNavigationBarDuringPresentation = false
print("it is in search")
let indexPath = tableView.indexPathForSelectedRow
let currentCell = tableView.cellForRowAtIndexPath(indexPath!) as! NewAddPostTableViewCell
theResultSearchController.active = false
print("Going to Did Select Name!")
// self.performSegueWithIdentifier("transferToAddChinUp", sender: currentCell.name.text)
let sb = UIStoryboard(name: "Main", bundle: nil)
if isAboutNewPost == true {
print("There was a new post!!!!!!")
let messagesVC = sb.instantiateViewControllerWithIdentifier("AddChinUpScreen") as! AddChinUpViewController
messagesVC.userObjectId = currentCell.nameLabel.text
messagesVC.thereWasJustANewPost = true
self.navigationController?.pushViewController(messagesVC, animated: true)
// self.performSegueWithIdentifier("transferToAddChinUp", sender: currentCell.nameLabel.text)
} else {
let messagesVC = sb.instantiateViewControllerWithIdentifier("AddChinUpScreen") as! AddChinUpViewController
messagesVC.userObjectId = currentCell.nameLabel.text
self.navigationController?.pushViewController(messagesVC, animated: true)
// self.performSegueWithIdentifier("didSelectName", sender: currentCell.nameLabel.text)
}
} else {
if isAboutNewPost == true {
print("it is not in search")
let indexPath = tableView.indexPathForSelectedRow
let currentCell = tableView.cellForRowAtIndexPath(indexPath!) as! NewAddPostTableViewCell
print("Going to transferToAddChinUp!")
self.performSegueWithIdentifier("transferToAddChinUp", sender: currentCell.nameLabel.text)
} else {
print("it is not in search")
let indexPath = tableView.indexPathForSelectedRow
let currentCell = tableView.cellForRowAtIndexPath(indexPath!) as! NewAddPostTableViewCell
print("Going to Did Select Name!")
self.performSegueWithIdentifier("didSelectName", sender: currentCell.nameLabel.text)
}
}
break
default:
break
}
//AddChinUpScreen
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "didSelectName" {
let completeSignUpVC = segue.destinationViewController as! AddChinUpViewController
let selectedRowIndex = self.theTableView.indexPathForSelectedRow
let currentCell = theTableView.cellForRowAtIndexPath(selectedRowIndex!) as! NewAddPostTableViewCell
completeSignUpVC.userObjectId = currentCell.nameLabel.text
} else if segue.identifier == "transferToAddChinUp" {
let completeSignUpVC = segue.destinationViewController as! AddChinUpViewController
//let selectedRowIndex = self.theTableView.indexPathForSelectedRow
//let currentCell = theTableView.cellForRowAtIndexPath(selectedRowIndex!) as! NewAddPostTableViewCell
completeSignUpVC.userObjectId = sender as! String
completeSignUpVC.thereWasJustANewPost = true
} else if segue.identifier == "tappedOnProfilePicture" {
let completeSignUpVC = segue.destinationViewController as! AddChinUpViewController
completeSignUpVC.userObjectId = sender as! String
if self.isAboutNewPost == true {
completeSignUpVC.thereWasJustANewPost = true
} else {
//completeSignUpVC
}
}
}
Here is the Error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_UIFullscreenPresentationController adaptivePresentationController]: unrecognized selector sent to instance 0x7febc34cdf60'
*** First throw call stack:
(
0 CoreFoundation 0x00000001072e3f65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001069d5deb objc_exception_throw + 48
2 CoreFoundation 0x00000001072ec58d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000107239f7a ___forwarding___ + 970
4 CoreFoundation 0x0000000107239b28 _CF_forwarding_prep_0 + 120
5 UIKit 0x00000001084fb389 -[UISearchController _searchPresentationController] + 134
6 UIKit 0x00000001080d7755 -[_UISearchControllerTransplantSearchBarAnimator animateTransition:] + 215
7 UIKit 0x0000000107c81ede __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 2638
8 UIKit 0x0000000107b2e4be _runAfterCACommitDeferredBlocks + 317
9 UIKit 0x0000000107b407ee _cleanUpAfterCAFlushAndRunDeferredBlocks + 95
10 UIKit 0x0000000107b4c4e6 _afterCACommitHandler + 90
11 CoreFoundation 0x000000010720f9d7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
12 CoreFoundation 0x000000010720f947 __CFRunLoopDoObservers + 391
13 CoreFoundation 0x000000010720559b __CFRunLoopRun + 1147
14 CoreFoundation 0x0000000107204e98 CFRunLoopRunSpecific + 488
15 GraphicsServices 0x000000010a6c0ad2 GSEventRunModal + 161
16 UIKit 0x0000000107b22676 UIApplicationMain + 171
17 Chin Up 2 0x0000000104d180fd main + 109
18 libdyld.dylib 0x0000000109a5792d start + 1
19 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I found the solution. It had to do with how the view was loaded in the first place. Commented out code was the original code. Fixed it by making it a modal segue.
#IBAction func goToUnlockPost(sender: AnyObject) {
// let vc = self.storyboard!.instantiateViewControllerWithIdentifier("NewAddPost") as! NewAddPostViewController
// vc.isAboutNewPost = true
// vc.comingFromUnlockPost = true
// self.presentViewController(vc, animated: true, completion: nil)
self.performSegueWithIdentifier("tappedUnlockPost", sender: nil)
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "tappedUnlockPost" {
let destinationNavigationController = segue.destinationViewController as! UINavigationController
let targetController = destinationNavigationController.topViewController as! NewAddPostViewController
//targetController = segue.destinationViewController as! NewAddPostViewController
targetController.isAboutNewPost = true
targetController.comingFromUnlockPost = true
}
}

strange EXC_BREAKPOINT swift

I've got the following crash report :
Crashed: com.apple.main-thread
EXC_BREAKPOINT 0x00000001000b6b44
0 Spersy 0x1000b6b44 specialized BL_BaseTabBarController.(setUpTabBar in _D18ECB1BE2DA6194F4E8C8A0FD1C1668)(BL_BaseTabBarController) -> (forSelectedActionSignContainer : UIImageView) -> () (BL_BaseTabBarController.swift)
1 Spersy 0x1000b3ae0 #objc BL_BaseTabBarController.cameraControllerSelected(BL_BaseTabBarController) -> () -> () (BL_BaseTabBarController.swift:112)
2 UIKit 0x186050be8 -[UIApplication sendAction:to:from:forEvent:] + 100
3 UIKit 0x186050b64 -[UIControl sendAction:to:forEvent:] + 80
4 UIKit 0x186038870 -[UIControl _sendActionsForEvents:withEvent:] + 436
5 UIKit 0x186050454 -[UIControl touchesEnded:withEvent:] + 572
6 UIKit 0x186008c0c _UIGestureRecognizerUpdate + 8988
7 CoreFoundation 0x180e70728 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
8 CoreFoundation 0x180e6e4cc __CFRunLoopDoObservers + 372
9 CoreFoundation 0x180e6e8fc __CFRunLoopRun + 928
10 CoreFoundation 0x180d98c50 CFRunLoopRunSpecific + 384
11 GraphicsServices 0x182680088 GSEventRunModal + 180
12 UIKit 0x186082088 UIApplicationMain + 204
13 Spersy 0x1000ed850 main (AppDelegate.swift:19)
14 libdispatch.dylib 0x1809368b8 (Missing)
And propagating to code, user tapps the tabbar button ( i'm using custom tabbar ) :
#IBAction func cameraControllerSelected()
{
setUpTabBar(forSelectedActionSignContainer: cameraSign)
}
And the following code executes :
private func setUpTabBar ( forSelectedActionSignContainer imageView : UIImageView ) -> Void
{
var viewControllerIndex = 0
if ( imageView == feedSign )
{
feedSign.hidden = false
exploreSign.hidden = true
cameraSign.hidden = true
chatSign.hidden = true
profileSign.hidden = true
viewControllerIndex = 0
}
if ( imageView == exploreSign )
{
feedSign.hidden = true
exploreSign.hidden = false
cameraSign.hidden = true
chatSign.hidden = true
profileSign.hidden = true
viewControllerIndex = 1
}
if ( imageView == cameraSign )
{
feedSign.hidden = true
exploreSign.hidden = true
cameraSign.hidden = false
chatSign.hidden = true
profileSign.hidden = true
viewControllerIndex = 2
}
if ( imageView == chatSign )
{
feedSign.hidden = true
exploreSign.hidden = true
cameraSign.hidden = true
chatSign.hidden = false
profileSign.hidden = true
viewControllerIndex = 3
}
if ( imageView == profileSign )
{
feedSign.hidden = true
exploreSign.hidden = true
cameraSign.hidden = true
chatSign.hidden = true
profileSign.hidden = false
viewControllerIndex = 4
}
if ( !shouldDismissTopOrReload(viewControllerAtIndex: viewControllerIndex))
{
displayViewController(atIndex: viewControllerIndex)
signOnScreen = imageView
}
}
And it appears only on release builds, on debug everything fine. Is an optimising compiler issue? Cause i have the same procedure setUpTabbar() with no arguments. Other functions - such as shouldDismissTopOrReload(viewControllerAtIndex: viewControllerIndex) and displayViewController(atIndex: viewControllerIndex) are reliable, and well-covered by tests. Any ideas? I've got almost 200 crashes!!

Resources