Tableview crash when deleting rows in UITableView - Style:plain and section footers - ios

I've got a tableview backed by a fetchedresultscontroller. When I delete a row that causes the bottom row of a tableview to scroll up so the tv doesn't fill the entire screen, I get the crash below.
Here are the workarounds I've found.
If I change the tableview to be grouped rather than plain - the error goes away.
If I remove the section footers - the error goes away. This is not a viable workaround for me.
The error occurs after "controllerWillChangeContent" and prior to the "controllerDidChangeContent" - the code here is just copy/pasted from Apple's FRC protocol reference.
Anyone know why this occurs? Since it works fine with Grouped tableview it seems like it's likely an Apple bug - but I thought I'd ask here first before reporting it.
Assertion failure in -[UIViewAnimation initWithView:indexPath:endRect:endAlpha:startFraction:endFraction:curve:animateFromCurrentPosition:shouldDeleteAfterAnimation:editing:], /SourceCache/UIKit_Sim/UIKit-2903.23/UITableViewSupport.m:2661
2014-03-08 17:13:29.226 workbox[7527:70b] CoreData: error: Serious application error. An exception was caught from the delegate of NSFetchedResultsController during a call to -controllerDidChangeContent:. Cell animation stop fraction must be greater than start fraction with userInfo (null)
Sample program

I have download your project on github, tested on a iPad Air.
I have clicked on some elements and even when the app should scroll up because you have many elements, no problems/crash at all
I have tested on a xCode 7.3.2 and iPad Air 9.2. simulator
Could you please, say with wich device it's crash?

Related

_hideForKeyboardAppearance error when clicking on UITextView

I have a UITextView, and whenever I click on it, the app crashes with the following error:
-[__NSSetM _hideForKeyboardAppearance]: unrecognized selector sent to instance 0x7fb8aa76cd60
If I run the app multiple times, it always crashes at the same place, but the intercepting object that is throwing the "unrecoginzed selector" can be different. Sometimes it is UIImage instead of NSSetM, sometimes, it is a UIConstraint, etc.
Even if I don't assign the UITextView to a specific outlet in my class, or have it assigned to a delegate, I get the same behavior. This happens on both simulator and hardware.
Any ideas what is going on?
p.s. this is iOS 8. Crash happens on both iPhone and iPad.
Edit: Note that this happens even though the UITextView calls no code. I removed any outlet connections in the storyboard, and even made it so my class doesn't implement UITextViewDelegate. Still crashes. That is why I am so puzzled and wondered if anyone has ever encountered something like this. One thing to note is that the view controller having this issue is buried several screens deep within a UISplitViewController. Not sure if someone UI elements buried deep in the nav stack are somehow intercepting the keyboard call?

drawWithRect crashing with an exception breakpoint on iOS 8 (Does not crash without exception breakpoint)

Happy iPhone Day everyone! I hope everyone managed to get their hands on one.
I have a strange issue. In my code, I have a UITableView and if the user selects the Email icon in the UINavigationBar, it does two things:
1) Opens up the MFMailComposer
2) Creates a PDF in the background of the contents of the UITableView and attaches it to the email
This has so far been working very well in iOS 7. With iOS 8, if I set an exception breakpoint in my code and run it on an iOS 8 device, it will crash when I click the email icon (iPhone 5s), pointing to the code below:
[strheader drawWithRect:CGRectMake(65, -670, 1024, 100) options:NSStringDrawingUsesLineFragmentOrigin attributes:#{NSFontAttributeName:headerFont} context:nil];
It doesn't let me jump in or out of this breakpoint or do anything to find out what's going on. If I remove the Exception breakpoint, there's no crash. If I run the app on my device and disconnect the device from Xcode, run it again, there's no crash.
So ultimately, there's no crash when running my app, but it makes me extremely nervous that with an exception breakpoint, it crashes at that code above which means something isn't right somewhere.
There are no warnings in my code. The method that does the saving of the PDF to the email (which contains that code) is extremely long; if it's required, I'll paste it here but I don't want to make this question longer than it needs to be.
If I remove the exception breakpoint from that line and just set a regular breakpoint, as expected, it stops at that point. I run through and there are no errors at all. If I run through the whole breakpoint, it does what it needs to and then shows the MFMailComposer in the App. So it's not actually "crashing", but the exception breakpoint clearly has a problem with it.
How can I find out WHY it's crashing? More importantly, how can I fix it? (which will probably only be answerable after the first question gets answered).

What is UITableViewCell setIndexBarWidth

I have a UITableView which contains UIImageView and UILabel. The values for UIImageView and UILabel are taken from web service.
My problem is when I scroll the tableview down it shows error
-[UITableViewCell _setIndexBarWidth:]: message sent to deallocated instance 0x1681c470
(only if Enabled Zombie Objects) and crashes. I googled but cannot find a single word about this error. The error not comes frequently. It may happens some time or may not. Also the error occurs only if internet is available. In offline mode everything works fine.
Am using Xcode 5 with ARC.
Thank You...

UITableViewCells with UITextView causing Bad shift in DDTokenCacheMoveStreamOffset

I have a UITableViewController that is populated with several cells, each with its own UITextView that displays a given string from an array. About one time in twenty, opening the UITableViewController causes a crash with the following message in the console:
assertion on
/SourceCache/MobileDataDetectorsCore_Sim/MobileDataDetectorsCore-355/Sources/PushDown/DDTokenCache.c:360
"delta >= 0" failed :Bad shift in DDTokenCacheMoveStreamOffset,
aborting
The only other reference to a similar problem is this, but my TextViews don't have long links in them-- they do have data detectors enabled for links and phone numbers, but few of the TextViews have either.
What should I do to fix this? And can it be done without removing the data detectors?
I'm only getting this in the simulator and not on the device itself.. I believe it is a bug.

app freezes on deletion of last row in section ios7

I created an app that used NSManagedDocument and NSFetchedResultsController to populate a NSTableViewController. In ios6 when I deleted the last row of a section it just disappeared and carried on as expected whereas in ios7 the app just freezes and seems to be consuming memory exponentially. I have used the code from the Stanford CS193p lectures to allow the fetchedresultscontroller and tableviewcontroller to combine.
Is this problem a bug in ios7 or does older code need to be updated?
thanks for any answers!
The problem may be that despite deleting the row, the section still exists in memory, try deleting the section using the following method:
[self.table deleteSections:<#(NSIndexSet *)#> withRowAnimation:<#(UITableViewRowAnimation)#>];
Hope this helps!
I found that when I slide the cell to the left to delete it, doing it changes the editing property of the tableview. I had changed the setEditing method to do some custom code for a previous version and so for some reason it kept creating NSIndexPaths. Hope this helps someone in the future!

Resources