UITextField creates EXC_BAD_ACCESS in iOS 11.4 - ios

In my application, When click a thumbnail image it shows in a larger view in another viewController with textfields to edit the properties of that image. If we click the thumbnails to view in larger and close continuously, after 3 or 4 times the app getting crashed.
And finally I found it was occurred due to textfield. So I removed the textfields and check, everything works fine.
I declared UItextField as weak property and assign delegates to that.
It was happened only in ios 11. Before that i had no issues. Please help me out from this.

Related

Xcode runtime error Could not load the "_IBBrokenImage_"

I am working on an app (Xcode 11.4, iOS 13) with several view controllers. While running on simulator or device, when I navigate to a specific VC, the debugger emits a:
"`Could not load the "_IBBrokenImage_" image referenced from a nib in the bundle with identifier ...`"
This particular VC does not have any images, just text in buttons, labels and a UITable. It does not trigger standard Swift or Exception breakpoints. Is there a specific Method iOS uses to pull image resources that I might try to trap this with? Alternatively, is there a different approach to finding the issue being complained about?
Thanks!
This happened to me when I updated to Xcode 11.4. For some reason, my UIBarButtonItem's image was set as Unkown Image in storyboard. I just had to initialize the image again.
Here is the answer (and if is due to buggy IB in Xcode 11.4):
Re-examination of the XML of the storyboard file revealed that Xcode had added,
on its own, a variation for RC (landscape) orientation. I didn't do it! The variation image was a random string, basically unassigned.
Also, the IB frequently complains that it can not compile by XML from time to time.
I think a new release of Xcode would be helpful!
VC3 -- click --> VC1 -- programmatically go to --> VC2
I got this error when app is going to another viewcontroller(VC2) too quickly (programmatically - in my case) before the current viewcontroller (VC1) has finished loading all of its images in nib. In my case, the app travels from VC3 to VC1 and from VC1 to VC2 continuously. So I had changed the app to go from VC3 to VC2 directly and the error has gone. I hope this will be applied to a similar situation.
I had this issue on Xcode 13.2.1 when I unselected 'Installed' on a view in XIB. Deleting the view (I no longer needed it) resolved the error for me.
Change the image to another run and see if it shows, then change it back to the previous image.

swift 3.0 folding-cell library table not showing

I am using https://github.com/Ramotion/folding-cell library into my Swift 3.0 projects. It works nice without any editing or changing on storyboard/auto layout changing.
I faced some issues when tried to:
Add few IBOUTLET (in DemoCell.swift)
Add Data to them (in DemoCell's didSet() method)
Now the view is blank. But i can scroll the tableview(it is just not showing), can click and can see folded cell perfectly.
I tried to add constrains as it given in documentation. I get fatal crash.
I am using Xcode 8, swift 3.0. This is happen always even when i download the fresh source code and add new uilabel or anything change on storyboard.
Does anybody tried this library recently ?
Blank Screenshot:
When click in the cell, Other cell is hidden.But clickable.
Foreground view:
It was an issue with the library. Now its solved.
Thread: https://github.com/Ramotion/folding-cell/issues/69#event-819438913

iOS 9 Segue Causes App To Freeze (no crash or error thrown)

I have been working on this app for months now and from as far back as I can remember I have never had an issue with segues. The code is unchanged in terms of calling performSegueWithIdentifier but since my recent update to Xcode 7 and iOS 9 I have not been able to tack this issue.
I have tried:
Deleting button and creating new button w/ segue link
Using a direct segue from button to view, without the use of performSegueWithIdentifier
Connecting button to new blank viewController
When I press the button, no initial load functions are called on the destination VC (Ex: ViewDidLoad, ViewWillAppear, etc). When I connect it to a blank view, the segue works fine with the same code in place.
Since the code never stops, or breaks, and just seems to "freeze" in place while still running on Xcode I can't seem to even narrow this down to whats causing the issue. I have a similar segue that is also called from another button on the same ViewController that has no issues whatsoever.
Any thoughts on the matter are greatly appreciated!
EDIT: I have narrowed the issue down to the UITextView's causing the problem. Once the Text Views were removed the page loads fine via segue. I wonder what changed between iOS 8 and iOS 9 in terms of UITextView as I will have to remove the text views and completely re add new text views.
So basically the segue was freezing because of the UITextView's I was using in the destinationViewController. The following fixed the issue:
Delete all UITextView's
Add new UITextView's
you must leave the default lorem imposed text and change this programmatically in the viewDidLoad()
This was the fix for me, and from the research I have done on the issue it seems this is a bug in iOS 9 and Xcode 7.
Cheers!
NOTE: Removing the text in the UITextView (or making it longer then ~12 characters) is sufficient to work around it, no need to delete and recreate them. This is fixed in Xcode 7.1.1 and later.
I ran into the same issue and the fixes in this post (Xcode 7 crash: [NSLocalizableString length] 30000) solved the issue for me.
The first is to enable a localisation other than the base for the storyboard (see https://stackoverflow.com/a/32688815/3718974)
The second is to turn off the base localisation (see https://stackoverflow.com/a/32719247/3718974)
I think I have the same problem: I have a UITabelView with cells created from a nib file, when a user tap a cell this method is called:
and when I have the following method prepareForSegue:: the application crashes:
if I delete the line 129 Everything is ok , the method prepareForSegue:: open the right view and the label contactName is shown with its default text.
If I modify the method as follows prepareForSegue:: get exactly what you expect, without having any type of error:
let me know if you also get the same result
Any one who is facing this issue, i solved it by turning off the "Optimize rendering for windows scale" option in Debug of simulator window. I already had tried all of the above answers but could not solve the issue.
In the method in the first viewController where you activate the segue, do you have beginIgnoringInteractionEvents anywhere? If so the screen you segue to will be frozen and will ignore interaction events like you describe. If this is the case you can fix this by adding an endIgnoringInteractionEvents method before your segue method:
UIApplication.sharedApplication().endIgnoringInteractionEvents()
self.performSegueWithIdentifier("editItemToMyGearSegue", sender: self)
I realize this is an old topic, but appears to be still relevant. I was facing the same problem in Xcode 9, iOS11. My UITextViews are embedded inside UITableViewCells. Same symptoms as described here. The tricks with default text and placeholders did nothing for me, but I solved it by turning off the scrolling indicators for the text view in the xib. They were on by default, I guess, though unused.
Edit: this is probably an important detail... the views that were hanging all had an image NSTextAttachment in the attributed string of the text view. I think the image was wider than the available table cell content. With scrolling turned off, they appear to downscale.

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...

UICollectionView not showing when running on iOS 7

I have a UIViewController subclass called FLProfileViewController that contains a UICollectionView. The view of FLProfileViewController is added as a subview to another UIViewController's view. The problem is that the UICollectionView doesn't render.... only if I execute the code from XCode 5 (final release). Even when running the same project from XCode 5 DP 6, the UICollectionView is rendered.
What is more, another instance of the same class is actually rendered when adding its view to a different UIViewController of the project.
Debugging the code, I see that numberOfSectionsInCollectionView: is called and returns 1, collectionView:numberOfItemsInSection: is called and returns 47.
But collectionView:cellForItemAtIndexPath: and collectionView:layout:sizeForItemAtIndexPath: are not being called.
Has anyone find a similar problem? Any ideas about what could be going on?
I have found the problem.
My UICollectionView is shown in the first screen of the app. To avoid showing it empty I have a fake app splash screen that extends the default one. The fake splash is shown with presentViewController:animated:completion: and doesn't disappear until I receive the data from the server.
The problem seems to be that with the final released version of the iOS7 SDK, the UICollectionView is not rendered if it is not visible to the user. In my case I was rendering the UICollectionView while the fake splash screen was still on top.
As I said, my solution worked in iOS6, and the iOS7 version shipped with XCode 5 DP 6.
Anyway, this might help someone else.

Resources