unrecognized-selector

Swift 4: Timer Crashing - unrecognized selector sent to instance

流过昼夜 提交于 2019-12-01 22:44:56
I'm trying to call an instance of Timer and print "A second has passed" for each second that elapses. I'm following The Complete iOs 11 & Swift Developer Course on Udemy. The instructor does exactly this and his code works, yet mine is crashing. Here's the code: var timer: Timer! = Timer() @IBAction func cameraPressed(_ sender: Any) { timer.invalidate() } func processTimer() { print("A second has passed") } override func viewDidLoad() { super.viewDidLoad() timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: Selector("processTimer"), userInfo: nil, repeats: true) It should

UIImageView | unrecognized selector sent to instance | Xcode 6.4 | iOS 8.4

白昼怎懂夜的黑 提交于 2019-12-01 13:22:33
I'm new at Xcode, and my task was to migrate the code from iOS 6.1 to 8.4 , but there where so many deprecated methods. I solved them (I hope so), but now I got a new problem. The code I'm using is this one: [self.clientImageView sd_setImageWithURL:[NSURL URLWithString:_client.imageURL] placeholderImage:[UIImage imageNamed:@"placeholder.png"]]; And I get this error: [UIImageView sd_setImageWithURL:placeholderImage:]: unrecognized selector sent to instance 0x7fbe937a88b0 And finally, I get this: * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView sd

UIImageView | unrecognized selector sent to instance | Xcode 6.4 | iOS 8.4

人走茶凉 提交于 2019-12-01 10:36:34
问题 I'm new at Xcode, and my task was to migrate the code from iOS 6.1 to 8.4 , but there where so many deprecated methods. I solved them (I hope so), but now I got a new problem. The code I'm using is this one: [self.clientImageView sd_setImageWithURL:[NSURL URLWithString:_client.imageURL] placeholderImage:[UIImage imageNamed:@"placeholder.png"]]; And I get this error: [UIImageView sd_setImageWithURL:placeholderImage:]: unrecognized selector sent to instance 0x7fbe937a88b0 And finally, I get

`unrecognized selector sent to instance <OBJ_ADR>`after sending `dismissViewControllerAnimated:completion` to a UIViewController

空扰寡人 提交于 2019-11-29 16:51:13
Lots of similar questions but non with a solution that works in my case. I try to write a simple FlipSideApp. Just two views with a single button each (flipBtn | flopBtn) to present the other view vice versa. flip on the first view works fine. flop on the other view causes a unrecognized selector sent to instance 0x6c3adf0 . The App crashes after calling [self dismissViewControllerAnimated:YES completion:nil]; in file FlipSide.m (see code below). Where 0x6c3adf0 is the current address of self which is an instance of FlipSide : UIViewController in that case. So I think the unrecognized selector

iOS app crash after UITextField text entry, pop, then push on my navController (NSISObjectiveLinearExpression coefficientForVariable)

試著忘記壹切 提交于 2019-11-29 15:52:16
问题 My iOS app crashes when I: present my "Login" view controller in a navigation controller enter text into a UITextField on it, then try and fail the login pop back to the above view controller push to a different view controller (crashes here) It doesn't crash if I skip the step where I enter text into the UITextField . Does anyone have any idea why? Here is the error message I am getting. [NSISObjectiveLinearExpression coefficientForVariable:]: unrecognized selector sent to instance

Unrecognized selector sent to instance Swift 3

匆匆过客 提交于 2019-11-28 11:39:28
I want to implement TapGestureRecognizer with the selector , below is the code where I added tapGestureRecognizer to my imageView let tapFirstGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(assignImage(_:))) firstImageView.isUserInteractionEnabled = true firstImageView.tag = 1 firstImageView.addGestureRecognizer(tapFirstGestureRecognizer) Here is the action method func assignImage(_ sender: UIImageView){ imagePicker.allowsEditing = false imagePicker.sourceType = .photoLibrary imageViewTag = sender.tag present(imagePicker, animated: true, completion: nil) } Compiler

Breaking on unrecognized selector

荒凉一梦 提交于 2019-11-28 11:02:13
Is it possible to set a break point on this bit of feedback in the console? This would make handling this problem so much easier. Unrecognized selector is an exception, and you can set a breakpoint on exceptions. In Xcode 4, go to the breakpoint navigator, click the +, and choose "Add Exception Breakpoint". Under Exception, choose Objective-C. Under Break, choose On Throw. It should look like this when you're done: 来源: https://stackoverflow.com/questions/7354169/breaking-on-unrecognized-selector

Add image to UIAlertController [closed]

偶尔善良 提交于 2019-11-28 05:05:28
问题 I want to add an image to UIAlertController. Image does not need to be on a button, just presented in the middle of the controller. The code I have is below but crashes with message "unrecognised selector sent to instance". func showAlert () { let alert = UIAlertController(title: "Title of Alert", message: "none", preferredStyle:UIAlertControllerStyle.ActionSheet) // add an image let image = UIImage(named: "example") var imageView = UIImageView(image: image) imageView.frame = CGRectMake(0, 0,

Using global variables in Objective-C

烂漫一生 提交于 2019-11-28 04:01:33
First of all, I tried almost all the solutions given in stackoverflow but I didn't succeed in implement global vars, I even did a step by step tutorial and still I get the same errors. heres the issue: I have a program with severals views, I'd like to use variables on all of the views, so I used global variables, I have: GlobalVars.h #import <UIKit/UIKit.h> extern NSArray *truckBoxes; extern NSArray *farmerlist; extern NSString *farmerCardNumber; extern NSString *fName; @interface GlobalVars : NSObject { } @end GlobalVars.m #import "GlobalVars.h" NSArray *farmerlist; NSArray *truckBoxes;

Unrecognized selector sent to instance Swift 3

本小妞迷上赌 提交于 2019-11-27 06:26:56
问题 I want to implement TapGestureRecognizer with the selector , below is the code where I added tapGestureRecognizer to my imageView let tapFirstGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(assignImage(_:))) firstImageView.isUserInteractionEnabled = true firstImageView.tag = 1 firstImageView.addGestureRecognizer(tapFirstGestureRecognizer) Here is the action method func assignImage(_ sender: UIImageView){ imagePicker.allowsEditing = false imagePicker.sourceType =