unrecognized-selector

Not sure how to handle “Terminating app due to uncaught exception 'NSInvalidArgumentException'”

£可爱£侵袭症+ 提交于 2019-12-13 21:11:18
问题 I'm working on creating an app that uses a class I created myself, Entry , to store specific data in an array. However, I keep running into this error when I try to access one of the values stored in an Entry object. Every time I prompt the user to create one of these objects, it is added to "rawArray," which is in turn stored into [NSUserDefaults standardUserDefaults]. At these lines of code, the program crashes: Entry *currEntry = [[[NSUserDefaults standardUserDefaults] arrayForKey:@

Unrecognized selector sent to instance for my tap gesture

老子叫甜甜 提交于 2019-12-13 09:18:38
问题 I have the following code lazy private var _containerView: UIView = { let view = UIView(frame: self.view.frame) let tapGesture = UITapGestureRecognizer( target: self, action: Selector(("didtapContainerView:")) ) view.translatesAutoresizingMaskIntoConstraints = false view.backgroundColor = UIColor(white: 0.0, alpha: 0) view.addGestureRecognizer(tapGesture) tapGesture.delegate = self return view }() and this is the method @objc final func didtapContainerView(gesture: UITapGestureRecognizer) {

[NSNull length]: unrecognized selector sent to instance on keyboard keystroke?

情到浓时终转凉″ 提交于 2019-12-13 07:28:01
问题 I have added some textField and textView on static table view. the code was fine and running on xcode 6.4 / ios 8. * but it is throwing exception which i am not able to track. now i am debugging code on xcode 7.2 (swift2.2) I tried putting symbolic and and exceptional break point too but no luck :( following is stack trace of crash, Thanks in advance for your valuable help. 2015-12-14 16:07:07.989 TuteMate[3380:90711] -[NSNull length]: unrecognized selector sent to instance 0x10ccc6af0 from

iOS - [Class classMethod] results in unrecognized selector sent

孤者浪人 提交于 2019-12-13 07:18:49
问题 Due to code privacy, I have to omit part of info. Just excuse me. In TokenRequestManager.m , there is an instance method serialQueue4TokenType : - (dispatch_queue_t)serialQueue4TokenType:(TokenType)tokenType { static NSMutableDictionary *serialQueueDict = nil; if (serialQueueDict == nil) { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ serialQueueDict = [[NSMutableDictionary alloc] initWithCapacity:TokenTypeCount]; }); } dispatch_queue_t queue; @synchronized (self) { NSString

NSData Unrecognized selector sent to class

青春壹個敷衍的年華 提交于 2019-12-13 04:17:53
问题 I'm getting the following error when running my app: +[NSData dataFromBase64String:]: unrecognized selector sent to class 0x1aff66598 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSData dataFromBase64String:]: unrecognized selector sent to class 0x1aff66598' The caller looks like this: NSString* decodedData = [self base64Decode:encodedData]; And the method definitions are as follows: - (NSString *)base64Decode:(NSString *)base64String { NSData

Passing variables between view controllers using segue

狂风中的少年 提交于 2019-12-13 04:04:07
问题 I've been trying to pass variables between view controllers without much luck. I started to work backwards from the problem I was encountering but am now having problems just getting the segue to action. Whether I perform the segue with identifier method or have it actioning from the button I am using to perform a calculation I get the below error in the debugger. Any help would be appreciated. 2014-02-14 13:59:58.795 BatteryCalculator[6944:70b] Cannot find executable for CFBundle 0x8dbd110 <

Dynamic Button Problem: unrecognized selector sent to instance

和自甴很熟 提交于 2019-12-13 02:56:59
问题 I am dynamically creating buttons on iPhone app. UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [btn setTitle:atitle forState:UIControlStateNormal]; [btn addTarget:self action:@selector(buttonTouched:) forControlEvents:UIControlEventTouchUpInside]; // handle touch [buttons addObject:btn]; ---------- -(void) buttonTouched:sender{ } ---------- -[NSCFString buttonTouched:]: unrecognized selector sent to instance 0x592ef70 2010-07-28 08:59:43.551 DataManager[1707:207] ***

Having issue with UISplitViewController

喜欢而已 提交于 2019-12-13 02:09:14
问题 I have created a dictionary application and I am using UISplitViewController to search and select a word, my application crashes with this log : -[MeaningViewController topViewController]: unrecognized selector sent to instance 0x7f918945bef0 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MeaningViewController topViewController]: unrecognized selector sent to instance 0x7f918945bef0' Here is my code : in ViewController (MasterView) : - (void)prepareForSegue

UICollectionView dataSource/delegate related exception

给你一囗甜甜゛ 提交于 2019-12-13 00:55:08
问题 I'm trying to create UICollectionView dynamically but I keep getting an exception that we usually get when dataSource or delegate was not set: * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView collectionView:numberOfItemsInSection:]: unrecognized selector sent to instance 0x8a78ce0' But it’s there! This is my code: Header: #import <UIKit/UIKit.h> @interface classHeader : UIViewController <UICollectionViewDelegate, UICollectionViewDataSource> @property

Objective C: How to resolve 'unrecognized selector sent to instance' error

╄→尐↘猪︶ㄣ 提交于 2019-12-12 17:07:42
问题 I am trying to access a property of instance object using the following code for (User *user in likersArray) { //Set variables for dictionary NSString *nameLength = [NSString stringWithFormat:@"%i",[user.nickname length]]; } However, I keep getting the following error: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString nickname]: unrecognized selector sent to instance 0x8c0f780' My user class is defined as below @interface User : NSObject