iOS/Xamarin UICollectionViewCell loads late - ios

I have a weird issue in an iOS app written in Xamarin. That happens is that the lower left item from time to time loads late.
I'm not quite sure which information is relevant to this issue, since I tried to remove almost all complexity (stuff like custom delegate and and UICollectionViewFlowLayout)
What makes this even weirder is that when it loads it is shown for about a second and then disappears, until i start scrolling past it.
Has anyone experienced a similar issue?

Related

iOS Swift 2.0 UITextView freezes app depending on text

I'm experiencing a weird issue with my Swift 2.0 app.
I have a (editable) UITextView defined in my storyboard.
If I leave the text property empty in the storyboard everything is working as expected. But when I enter the text Kaasje (in the storyboard and recompiling), the app freezes when loading the nib (navigating through segue) and the CPU jumps to 100% (the app remains stuck).
The app will never reach viewDidLoad at this point.
It makes no difference when changing between fonts or fontsizes, behavior remains.
Pausing in Xcode does not leave me with anything useful, the main thread is busy without specifying any function. Nothing is logged to output nor any logs are created.
I'm running iOS9 on a iPad Air, the app has a built target of iOS8 and runs landscape-only.
Has anyone ever experienced anything like this before, and might have an explanation for this behaviour?
As far as my assumptions: Something goes wrong when calculating the text-size which results in a infinite loop while either calculating the size or adjusting the frame.
P.S. It happens with other texts too, but "Kaasje" always fails. It seems to fail when the the text is only 1 line. Longer texts tend to succeed aswel as leaving it empty.
As suggested in the comments there seems to be a bug in Xcode 7 in combination with iOS9.
I ended up recreating the entire view, the problem did not occur again.

Slowly swiping down to refresh on refreshControl of UITableViewController causes view to jump down

I used to have a UITableView in a UIViewController. I would put a UIRefreshControl on the UITableView and on the very last bit of swiping down to refresh, the UITableView would quickly jump down.
All answers voiced the same: Undocumented/unexpected behavior (being able to use UIRefreshControl with a UITableView) yields such results. To mitigate this, I used a ContainerView to embed a UITableViewController in a UIViewController.
I have nearly solved this issue, but... if I swipe down slow enough, the problem persists.
Is there any way to mitigate this, or am I forced to live with it?
Video: http://streamable.com/8suq
Notice the first few times I swipe down look absolutely fine because I do it fast enough, but towards the end of the video I really slow it down and you notice the jump in question.
I notice that you have a mouse cursor in that video. You cannot judge graphic performance for animations in the simulator, it will not perform the same as on an actual device.
On a device you will get much better performance and a much better frames per second rate. I've seen this to be very noticable when using SpriteKit whilst learning to develop games lately.
I've only used the UIRefreshControl a couple of times previously in a UITableViewController and not noticed any major issues before. Since then I've been using other libraries such as https://github.com/samvermette/SVPullToRefresh.
Try your app on a physical device and in the meantime I will try to replicate your issue and add my findings in here

Black screen when I add UINavigationController

I am following the Udacity tutorial on Swift, and for some reason when I added the second view, I usually get a black screen (as in the screen print) right when I open the app. Occasionally I get it working but usually not.
What could be the problem?
Noticed that "Did appear" is printed before "Will appear", is that a bug or did I do something wrong?
I have read this and this but it didn't help much. I also have tried several times to clean the project and rebuild it (nothing changed).
One time I just commented out some code (from the second view that should be loaded) and it worked suddenly. When I uncommented the same code it still worked.
Another time it worked when I disconnected the second view on the story board (it was still there, just no way to reach it).
Both have worked at least one time, and not worked many times.
Sorry this seems like I throw in random pieces of information, but I have no idea what could be the reason.

iOS toolbar sometimes highlights/selects the wrong button

I have an iOS app that, in one view, makes a toolbar in code. Nothing fancy here; just a bunch of standard UIBarButtonItems (initialized with initWithImage, and each one invoking a different selector), added (along with spacers) to the toolbar using UIToolbar setItems:animated (with no animation).
This works fine most of the time... but sometimes, after going to another view and back to this one many times, the toolbar's touch-handling appears to be off. It highlights and invokes the wrong button. It's not always the same wrong button, either; sometimes it's one right next to the one I actually tapped, but other times it is further away, even clear over on the other side of the toolbar.
There is no pattern to it, but if you try long enough (switching to another view and then back to this one), it always happens. It seems to happen more often when the other view is at a different screen orientation (forced by its shouldAutorotateToInterfaceOrientation implementation), but even when all views have the same orientation, it still happens now and then. When it happens, my selector gets invoked with a sender that matches the button that was actually highlighted, rather than the one I touched. So it really seems to be a matter of something in iOS not processing the touch correctly.
My google-fu has utterly failed to turn up any other reports of this issue... seems like it must be an Apple bug, since none of my code is involved in the toolbar touch handling. This happens both in the simulator and on the device, under iOS 4.3 (haven't tried other versions yet).
Has anyone else run into this issue? Any suggestions on how to avoid it?
OK, I found the problem. It wasn't the code that creates the toolbar itself; it was where (and how often!) it was being called.
This was legacy code, and we hadn't noticed that the create-the-toolbar code was being called from the view's didRotateFromInterfaceOrientation method (for reasons we can't imagine). That method gets invoked quite frequently, and the old toolbar wasn't being torn down, so it was creating toolbars on top of toolbars. Not too surprising that the touch handling went wonky in that situation.
Deleting the call there (and putting it in viewDidLoad like one would expect) solved the problem. Sorry for wasting everybody's time... but maybe the next person to stumble across screwy toolbar behavior will find this helpful.

Could a memory leak cause problems with UITableView scrolling?

I have a program based on UITableView (the user can edit the contents of the cells). After a long time open (mostly in the background) it will sometimes suddenly stop allowing you to fully scroll to the bottom of the list. The scroll is set to bounce, so it will bounce up and you can see the last few rows, but it will bounce right back down and hide them again.
I am using the navigation controller's toolbar, so in some ways it seems like the toolbar hides the last few items, but I think that's not really what's going on. (I think the last item or two would be off the screen anyway.)
Again, there is no problem scrolling most of the time.
It happens so rarely that I haven't been able to get very close to identifying the cause. It seems like it might happen after rotating to landscape mode, but many many rotations can occur without causing the problem. It also seems to show up after my phone has gone well below 10% battery before being recharged (I notice the problem after the battery is back to full, but it could be it starts before that, or that the battery status is totally unrelated).
Since it happens after the program has been running for days (mostly in the background) and is fixed by restarting the phone, I have suspected a memory leak, but I don't get any memory warnings and the program runs normally otherwise, even when the scrolling stops behaving correctly.
I have run Leaks a few times, and only once found a 16 byte leak on exiting the program, which I haven't been able to reproduce.
Any thoughts would be deeply appreciated.
Leaks wouldn't cause such problems by themselves. Sounds like your table gets resized, either automatically with UIViewAutoresizingFlexibleBottomMargin/UIViewAutoresizingFlexibleHeight resizing mask or manually.

Resources