Why do i get exc bad access in cases when object is not nil? - iphone

I have an app that receives remote notifications. My view controller that is shown after push has a tableview. App crashes very randomly (1 in 20 tries) at line setting frame:
if (!myTableView) {
NSLog(#"self.myTableView is nil");
}
myTableView.frame=CGRectMake(0, 70, 320, 376);
This only happens when i open the app, then open some other apps and then receive the push notification. I guess it has something to do with memory. I use ARC (ios 5). The strange thing is that nslog is not displayed, so tableview is not nil.
Crash log:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x522d580c
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x352b1f7e objc_msgSend + 22
1 Foundation 0x37dc174c NSKVOPendingNotificationCreate + 216
2 Foundation 0x37dc1652 NSKeyValuePushPendingNotificationPerThread + 62
3 Foundation 0x37db3744 NSKeyValueWillChange + 408
4 Foundation 0x37d8a848 -[NSObject(NSKeyValueObserverNotification) willChangeValueForKey:] + 176
5 Foundation 0x37e0ca14 _NSSetPointValueAndNotify + 76
6 UIKit 0x312af25a -[UIScrollView(Static) _adjustContentOffsetIfNecessary] + 1890
7 UIKit 0x312cca54 -[UIScrollView setFrame:] + 548
8 UIKit 0x312cc802 -[UITableView setFrame:] + 182
9 POViO 0x000913cc -[FeedVC viewWillAppear:] (FeedVC.m:303)
Dealloc is not called because it is not logged:
- (void)dealloc {
NSLog(#"dealloc");
}

You are having memory issues. Your tableView is reaching a retain count of zero; so although a pointer to the tableView still exists, the system has trashed the object at that actual address, hence the EXC_BAD_ACCESS.
It's possible that your UI that showed the tableView is hidden and therefore unloaded, but you've left some logic that assumes the table view still exists when it doesn't.
It's hard to debug what's going on without seeing more of the project. The best thing for you to do is have a careful look at the design of your application and UI flow. What would be causing the UI to be be released? How are you entering the code that assumes that part of the UI is still there?
N.B. Sending messages to a nil reference would not generate any errors; this is by language design.

I found the solution here:
Using ARC and UITableViewController is throwing Observation info was leaked, and may even become mistakenly attached to some other object
Seems pull to refresh (subview to tableview) was causing problems.

Do not change frame directly,do something like this.
CGRect frame = self. myTableView.frame;
frame.x =something;
frame.y=something;
myTableView.frame=frame;
and let me know.

Related

Getting a "This application is modifying the autolayout engine from a background thread" error?

Been encountering this error a lot in my OS X using swift:
"This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes. This will cause an exception in a future release."
I have a my NSWindow and I'm swapping in views to the contentView of the window. I get the error when I try and do a NSApp.beginSheet on the window, or when I add a subview to the window. Tried disabling autoresize stuff, and I don't have anything using auto layout. Any thoughts?
Sometimes it's fine and nothing happens, other times it totally breaks my UI and nothing loads
It needs to be placed inside a different thread that allows the UI to update as soon as execution of thread function completes:
Modern Swift:
DispatchQueue.main.async {
// Update UI
}
Older versions of Swift, pre Swift 3.
dispatch_async(dispatch_get_main_queue(){
// code here
})
Objective-C:
dispatch_async(dispatch_get_main_queue(), ^{
// code here
});
You get similar error message while debugging with print statements without using 'dispatch_async'
So when you get that error message, its time to use
Swift 4
DispatchQueue.main.async { //code }
Swift 3
DispatchQueue.main.async(){ //code }
Earlier Swift versions
dispatch_async(dispatch_get_main_queue()){ //code }
The "this application is modifying the autolayout engine from a background thread" error is logged in the console long after the actual problem occured, so debugging this can be hard without using a breakpoint.
I used #markussvensson's answer to detect my problem and found it using this Symbolic Breakpoint (Debug > Breakpoints > Create Symbolic Breakpoint):
Symbols: [UIView layoutIfNeeded] or [UIView updateConstraintsIfNeeded]
Condition: !(BOOL)[NSThread isMainThread]
Build and run the app on the emulator and replicate the steps that lead to the error message being thrown (the app will be slower than usual!). Xcode will then stop the app and mark the line of code (e.g. the call of a func) that's accessing the UI from a background thread.
When you try to update a text field value or adding a subview inside a background thread, you can get this problem. For that reason, you should put this kind of code in the main thread.
You need to wrap methods that call UI updates with dispatch_asynch to get the main queue. For example:
dispatch_async(dispatch_get_main_queue(), { () -> Void in
self.friendLabel.text = "You are following \(friendCount) accounts"
})
EDITED - SWIFT 3:
Now, we can do that following the next code:
// Move to a background thread to do some long running work
DispatchQueue.global(qos: .userInitiated).async {
// Do long running task here
// Bounce back to the main thread to update the UI
DispatchQueue.main.async {
self.friendLabel.text = "You are following \(friendCount) accounts"
}
}
For me, this error message originated from a banner from Admob SDK.
I was able to track the origin to "WebThread" by setting a conditional breakpoint.
Then I was able to get rid of the issue by encapsulating the Banner creation with:
dispatch_async(dispatch_get_main_queue(), ^{
_bannerForTableFooter = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait];
...
}
I don't know why this helped as I cannot see how this code was called from a non-main-thread.
Hope it can help anyone.
I had this problem since updating to the iOS 9 SDK when I was calling a block that did UI updates within an NSURLConnection async request completion handler. Putting the block call in a dispatch_async using dispatch_main_queue solved the issue.
It worked fine in iOS 8.
Had the same problem because I was using performSelectorInBackground.
Main problem with "This application is modifying the autolayout engine from a background thread" is that it seem to be logged a long time after the actual problem occurs, this can make it very hard to troubleshoot.
I managed to solve the issue by creating three symbolic breakpoints.
Debug > Breakpoints > Create Symbolic Breakpoint...
Breakpoint 1:
Symbol: -[UIView setNeedsLayout]
Condition: !(BOOL)[NSThread isMainThread]
Breakpoint 2:
Symbol: -[UIView layoutIfNeeded]
Condition: !(BOOL)[NSThread isMainThread]
Breakpoint 3:
Symbol: -[UIView updateConstraintsIfNeeded]
Condition: !(BOOL)[NSThread isMainThread]
With these breakpoints, you can easily get a break on the actual line where you incorrectly call UI methods on non-main thread.
You must not change the UI offside the main thread! UIKit is not thread safe, so that above problem and also some other weird problems will arise if you do that. The app can even crash.
So, to do the UIKit operations, you need to define block and let it be executed on the main queue: such as,
NSOperationQueue.mainQueue().addOperationWithBlock {
}
Obviously you are doing some UI update on back ground thread. Cant predict exactly where, without seeing your code.
These are some situations it might happen:-
you might be doing something on background thread and not using. Being in the same function this code is easier to spot.
DispatchQueue.main.async { // do UI update here }
calling a func doing web request call on background thread and its completion handler calling other func doing ui update.
to solve this try checking code where you have updated the UI after webrequest call.
// Do something on background thread
DispatchQueue.global(qos: .userInitiated).async {
// update UI on main thread
DispatchQueue.main.async {
// Updating whole table view
self.myTableview.reloadData()
}
}
I had this issue while reloading data in UITableView. Simply dispatching reload as follows fixed the issue for me.
dispatch_async(dispatch_get_main_queue(), { () -> Void in
self.tableView.reloadData()
})
I had the same problem. Turns out I was using UIAlerts that needed the main queue. But, they've been deprecated.
When I changed the UIAlerts to the UIAlertController, I no longer had the problem and did not have to use any dispatch_async code. The lesson - pay attention to warnings. They help even when you don't expect it.
You already have the correct code answer from #Mark but, just to share my findings:
The issue is that you are requesting a change in the view and assuming that it will happen instantly. In reality, the loading of a view depends on the available resources. If everything loads quickly enough and there are no delays then you don't notice anything. In scenarios, where there is any delay due to the process thread being busy etc, the application runs into a situation where it is supposed to display something even though its not ready yet. Hence, it is advisable to dispatch these requests in a asynchronous queues so, they get executed based on the load.
I had this issue when I was using TouchID if that helps anyone else, wrap your success logic which likely does something with the UI in the main queue.
It could be something as simple as setting a text field / label value or adding a subview inside a background thread, which may cause a field's layout to change. Make sure anything you do with the interface only happens in the main thread.
Check this link: https://forums.developer.apple.com/thread/7399
I had the same issue when trying to update error message in UILabel in the same ViewController (it takes a little while to update data when trying to do that with normal coding). I used DispatchQueue in Swift 3 Xcode 8 and it works.
If you want to hunt this error, use the main thread checker pause on issues checkbox.
Fixing it is easy most of the times, dispatching the problematic line in the main queue.
For me the issue was the following.
Make sure performSegueWithIdentifier: is performed on the main thread:
dispatch_async (dispatch_get_main_queue(), ^{
[self performSegueWithIdentifier:#"ViewController" sender:nil];
});
Swift 4,
Suppose, if you are calling some method using operation queue
operationQueue.addOperation({
self.searchFavourites()
})
And suppose function searchFavourites is like,
func searchFavourites() {
DispatchQueue.main.async {
//Your code
}
}
if you call, all code inside the method "searchFavourites" on the main thread, it will still give an error if you are updating some UI in it.
This application is modifying the autolayout engine from a background
thread after the engine was accessed from the main thread.
So use solution,
operationQueue.addOperation({
DispatchQueue.main.async {
self.searchFavourites()
}
})
For this kind of scenario.
Here check out this line from the logs
$S12AppName18ViewControllerC11Func()ySS_S2StF + 4420
you can check that which function calling from the either background thread or where you are calling api method you need to call your function from the main thread like this.
DispatchQueue.main.async { func()}
func() is that function you want to call in the result of api call
success or else.
Logs Here
This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.
Stack:(
0 Foundation 0x00000001c570ce50 <redacted> + 96
1 Foundation 0x00000001c5501868 <redacted> + 32
2 Foundation 0x00000001c5544370 <redacted> + 540
3 Foundation 0x00000001c5543840 <redacted> + 396
4 Foundation 0x00000001c554358c <redacted> + 272
5 Foundation 0x00000001c5542e10 <redacted> + 264
6 UIKitCore 0x00000001f20d62e4 <redacted> + 488
7 UIKitCore 0x00000001f20d67b0 <redacted> + 36
8 UIKitCore 0x00000001f20d6eb0 <redacted> + 84
9 Foundation 0x00000001c571d124 <redacted> + 76
10 Foundation 0x00000001c54ff30c <redacted> + 108
11 Foundation 0x00000001c54fe304 <redacted> + 328
12 UIKitCore 0x00000001f151dc0c <redacted> + 156
13 UIKitCore 0x00000001f151e0c0 <redacted> + 152
14 UIKitCore 0x00000001f1514834 <redacted> + 868
15 UIKitCore 0x00000001f1518760 <redacted> + 104
16 UIKitCore 0x00000001f1543370 <redacted> + 1772
17 UIKitCore 0x00000001f1546598 <redacted> + 120
18 UIKitCore 0x00000001f14fc850 <redacted> + 1452
19 UIKitCore 0x00000001f168f318 <redacted> + 196
20 UIKitCore 0x00000001f168d330 <redacted> + 144
21 AppName 0x0000000100b8ed00 $S12AppName18ViewControllerC11Func()ySS_S2StF + 4420
22 AppName 0x0000000100b8d9f4 $S12CcfU0_y10Foundation4DataVSg_So13NSURLResponseCSgs5Error_pSgtcfU_ + 2384
23 App NAme 0x0000000100a98f3c $S10Foundation4DataVSgSo13NSURLResponseCSgs5Error_pSgIegggg_So6NSDataCSgAGSo7NSErrorCSgIeyByyy_TR + 316
24 CFNetwork 0x00000001c513aa00 <redacted> + 32
25 CFNetwork 0x00000001c514f1a0 <redacted> + 176
26 Foundation 0x00000001c55ed8bc <redacted> + 16
27 Foundation 0x00000001c54f5ab8 <redacted> + 72
28 Foundation 0x00000001c54f4f8c <redacted> + 740
29 Foundation 0x00000001c55ef790 <redacted> + 272
30 libdispatch.dylib 0x000000010286f824 _dispatch_call_block_and_release + 24
31 libdispatch.dylib 0x0000000102870dc8 _dispatch_client_callout + 16
32 libdispatch.dylib 0x00000001028741c4 _dispatch_continuation_pop + 528
33 libdispatch.dylib 0x0000000102873604 _dispatch_async_redirect_invoke + 632
34 libdispatch.dylib 0x00000001028821dc _dispatch_root_queue_drain + 376
35 libdispatch.dylib 0x0000000102882bc8 _dispatch_worker_thread2 + 156
36 libsystem_pthread.dylib 0x00000001c477917c _pthread_wqthread + 472
37 libsystem_pthread.dylib 0x00000001c477bcec start_wqthread + 4
)
I also encountered this problem, seeing a ton of these messages and stack traces being printed in the output, when I resized the window to a smaller size than its initial value. Spending a long time figuring out the problem, I thought I'd share the rather simple solution. I had once enabled Can Draw Concurrently on an NSTextView through IB. That tells AppKit that it can call the view's draw(_:) method from another thread. After disabling it, I no longer got any error messages. I didn't experience any problems before updating to macOS 10.14 Beta, but at the same time, I also started modifying the code to perform work with the text view.

How to know where crash for postNotificationName:object:userInfo

Is there some method to know crash reason in Xcode 4.6?
The crash stack is :
Exception Type: SIGSEGV
Exception Codes: SEGV_ACCERR at 0xd9f2c061
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x3a74f5aa objc_msgSend + 10
1 Foundation 0x33157599 -[NSNotificationCenter postNotificationName:object:userInfo:] + 73
2 UIKit 0x347830cd -[UIApplication _handleApplicationSuspend:eventInfo:] + 733
3 UIKit 0x346f91e7 -[UIApplication handleEvent:withNewEvent:] + 2459
4 UIKit 0x346f86cd -[UIApplication sendEvent:] + 73
5 UIKit 0x346f811b _UIApplicationHandleEvent + 6155
6 GraphicsServices 0x363ee5a3 _PurpleEventCallback + 591
When you add an observer to the notification centre you have to remove it when the object is being dealloced/destroyed. Otherwise Notification Centre would send the notification to the destroyed object resulting in crash.
1 - check if you properly handle the removing from notification centre. (typically you do this on dealloc method)
2 - If step 1 doesn't help, profile your application with instruments & zombies. it would point out which object is destroyed but still receiving messages.
Almost certainly an object registered with the notification centre to receive that notification and then failed to deregister before deallocation.
The easiest way to catch the problem would be to enable NSZombies — see e.g. this tutorial. If you run with zombies enabled then objects that should have been deallocated remain in memory but raise an exception if anyone attempts to call them. So you can figure out exactly what type of object the notification centre is attempting to call and therefore which object is probably making the mistake.
Given the name of the origin of the notification — _handleApplicationSuspend:eventInfo: — you might also want to have a quick check of anyone registering for UIApplicationWillResignActiveNotification, UIApplicationDidEnterBackgroundNotification and the others related to application suspension.
Might be an useful information that it appears to crash only on ios7, as my project ran perfectly on ios6.
Maybe userInfo is has nil value....
[[NSNotificationCenter defaultCenter] postNotificationName:SayLoggedInNotification object:wSelf userInfo:#{#"from": wSelf.from}];
# wSelf.form is nil

UITableView crash during animation, fixing solution found but doesn't locate root cause, wonder why?

In my iphone project I always insert UITableView into the view controller as IBOutlet, most times it works well, but random crash will occur when do animation invoked by popToRootViewControllerAnimated. Track it by zombie, find the crash dues to UITableView instance has been deallocated, but there are still system events sent to it, so crash.
I always resolve such issue by either of the following methods in view controller's dealloc method.
tableView.dataSource = nil; (work for most cases)
or
[tableView removeFromSuperview]; (work for some special cases)
Although the crash can be fixed by the above change, but I am still confusing.
Is it apple's defect that we need to set its dataSource to nil explicitly to avoid crash? Or maybe our own app code has problem?
Anyone who has also experienced such crash, do you know what's the root cause?
Any idea or discussion will be appreciated, thanks in advance.
enter code here
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x626f6d37
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x33fe0c98 objc_msgSend + 16
1 UIKit 0x364538f6 -[UITableView(UITableViewInternal) _spacingForExtraSeparators] + 58
2 UIKit 0x3645337a -[UITableView(_UITableViewPrivate) _adjustExtraSeparators] + 158
3 UIKit 0x36453218 -[UITableView layoutSubviews] + 40
4 UIKit 0x363ff5f4 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 20
5 CoreFoundation 0x30e13efc -[NSObject(NSObject) performSelector:withObject:] + 16
6 QuartzCore 0x33d8dbae -[CALayer layoutSublayers] + 114
7 QuartzCore 0x33d8d966 CALayerLayoutIfNeeded + 178
8 QuartzCore 0x33d931be CA::Context::commit_transaction(CA::Transaction*) + 206
9 QuartzCore 0x33d92fd0 CA::Transaction::commit() + 184
10 QuartzCore 0x33d8c04e CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 50
11 CoreFoundation 0x30e7da2e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 10
12 CoreFoundation 0x30e7f45e __CFRunLoopDoObservers + 406
13 CoreFoundation 0x30e80754 __CFRunLoopRun + 848
14 CoreFoundation 0x30e10ebc CFRunLoopRunSpecific + 224
15 CoreFoundation 0x30e10dc4 CFRunLoopRunInMode + 52
16 GraphicsServices 0x34efe418 GSEventRunModal + 108
17 GraphicsServices 0x34efe4c4 GSEventRun + 56
18 UIKit 0x36428d62 -[UIApplication _run] + 398
19 UIKit 0x36426800 UIApplicationMain + 664
20 ScoutFree 0x00099558 0x1000 + 623960
21 ScoutFree 0x00003618 0x1000 + 9752
You forgot to set tableView.delegate to nil, so you can still get crashes, especially when animation is going(as it asks now dead controller for new rows). It's not Apple's defect, it's programmer responsibility to clear out those references. So set dataSource and delegate properties of tableView to nil, then release tableview(by setting corresponding property to nil or releasing iVar like this [_iVar release]; iVar = nil;)
First of all, the ONLY things you should be calling in dealloc are release on your ivars, unregistering for NSNotificationCenter notifications (if registered in init), or setting delegates of UIWebViews and UIScrollView to nil (as suggested by Apple's documentation). If your UIViewController is the delegate/data source of your tableview, there is no need to set those to nil in dealloc (or anywhere else), as when the view controller is destroyed, your guaranteed it won't send any rogue messages, and you're equally guaranteed that the delegate/data source of the table view won't get destroyed before the table view does.
It's highly unlikely that the defect is Apples. What OS are you targeting? If you're using ARC, you really should have few occasions when you need to be mucking around in dealloc. If you symbolicate your crash log, you will get the line numbers and classes from your app that is causing the crash. Symbolicating in Xcode 4 is really simple, you can find info on that here: Symbolicating iPhone App Crash Reports
What do you mean you always insert the tableview as an IBOutlet? If it's an IBOutlet, that implies that you have a table view in a nib file, in which case the table view gets created for you when the nib is unloaded. If you are trying to remove the table view and re-add it to the view for the purpose of updating its information, this is not the correct approach: simply calling reloadData will do this for you, and go through all of the delegate methods again. Are the delegate and data source an object OTHER than the view controller controlling your table?

App crashes during startup with valueForUndefinedKey error

During the app startup, I show a table view. Each row shows a managed object's data in some form. One customer is reporting a crash in the app startup. I looked at his crash log and could track down to a place where I use [NSManagedObject valueForKey:] method inside cellForRowAtIndexPath method. The app crashes with [NSManagedObject valueForUndefinedKey:] exception.
How come just one device in a 1000s of devices could get this issue? Running the same version of iOS and the app, I couldn't imitate it in any of my devices. what could have gone wrong?
Last Exception Backtrace:
0 CoreFoundation 0x3549e88f __exceptionPreprocess + 163
1 libobjc.A.dylib 0x368c5259 objc_exception_throw + 33
2 CoreFoundation 0x3549e5c5 -[NSException init] + 1
3 CoreData 0x329d3b23 -[NSManagedObject valueForUndefinedKey:] + 327
4 Foundation 0x312b59d1 _NSGetUsingKeyValueGetter + 125
5 CoreData 0x3298d995 -[NSManagedObject valueForKey:] + 121
6 MyApp 0x0000c513 -[Activity isOn:] (Activity.m:371)
7 MyApp 0x0000beaf -[Activity firstMarkableDate] (Activity.m:163)
8 MyApp 0x0000c0cb -[Activity statusString] (Activity.m:220)
9 MyApp 0x0000bd51 -[Activity statusColor] (Activity.m:139)
10 MyApp 0x00004af1 -[ActivityListViewController tableView:cellForRowAtIndexPath:] (ActivityListViewController.m:418)
11 UIKit 0x3251d0a3 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 547
This may be a memory management issue. See -[Activity isOn:] where it invokes valueForKey:. The object you send valueForKey: is apparently of the wrong class. See where the object is coming from.
The object may get over-released and its memory address may get occupied by an object of a different class which isn't KVO-compliant for trackname key. If that's the case, I would bet that your app gets EXC_BAD_ACCESS even more often.
Why would that happen? NSManagedObjects have many subtleties with regard to their lifetime. They may get deleted in other parts of your app, for example, so you should always expect that and act appropriately.
I hope this will point you in the right direction.

App crashing with this error message - I cannot find anything about this after googling it- Can someone help please

Im not getting any compile time errors nor anything comes up when I run Build & Analyze. But at run time my app crashes when I click a uitextfield.
-[__NSCFType textFieldDidBeginEditing:]: unrecognized selector sent to instance 0x583cb90
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType textFieldDidBeginEditing:]: unrecognized selector sent to instance 0x583cb90'
0 CoreFoundation 0x00fa25a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x010f6313 objc_exception_throw + 44
2 CoreFoundation 0x00fa40bb -[NSObject(NSObject)doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x00f13966 ___forwarding___ + 966
4 CoreFoundation 0x00f13522 _CF_forwarding_prep_0 + 50
5 UIKit 0x00394581 -[UIControl(Deprecated) sendAction:toTarget:forEvent:] + 67
6 UIKit 0x00396e62 -[UIControl(Internal) _sendActionsForEventMask:withEvent:] +
7 UIKit 0x0039ce11 -[UITextField willAttachFieldEditor:] + 404
8 UIKit 0x003aecdf -[UIFieldEditor becomeFieldEditorForView:] + 653
9 UIKit 0x0039ef98 -[UITextField _becomeFirstResponder] + 99
Chances are that you are either not properly retaining the object you assign as the delegate of your UITextField (e.g. you don't assign it to an outlet property declared retain in IB), or you are calling release or autorelease on an object that you do not own or that you saved into an ivar.
The object eventually gets disposed of, and later a different object happens to be created at the same memory location. But that object, of course, doesn't implement the UITextFieldDelegate protocol, so when the text field tries to send the delegate messages to it it gives you that error instead. Were an object not to be created at that same memory location, you'd get a crash with EXC_BAD_ACCESS instead.
In Interface Builder (or possibly in code, but more likely IB) you have the "Editing Did Begin" Sent Event linked to a method that doesn't exist in your code; perhaps it was renamed, or maybe you neglected to delete that link after deleting the action.
When editing begins in your textField the app tries to call the method indicated in IB and fails; "unrecognized selector" is saying that it doesn't recognize a method by that name.
Either just delete the link or delete it and replace it with an appropriate link.