unrecognized-selector

Unrecognized Selector Sent to Instance [NSCFString subarrayWithRange:]

十年热恋 提交于 2019-12-03 13:32:46
I have the following code which is producing this error. I cannot understand why the subarrayWithRange message is being sent to a string? When it is clearly an array? static const int kItemsPerView = 20; NSRange rangeForView = NSMakeRange( page * kItemsPerView, kItemsPerView ); NSMutableArray *temp = [[APP_DELEGATE keysArray] mutableCopyWithZone:NULL]; NSArray *itemsForView = [temp subarrayWithRange:rangeForView]; for (int loopCounter = 0;loopCounter < r*c;loopCounter++){ NSLog(@"%i: %@ ", loopCounter, [itemsForView objectAtIndex:loopCounter]); } Error: -[NSCFString subarrayWithRange:]:

Unrecognized selector calling category method in static iOS library

◇◆丶佛笑我妖孽 提交于 2019-12-03 11:21:23
I am using some third party software to aid in writing an iPad application using Xcode 4.3.2. The software is open source and is usually set up so its code will be compiled along with whatever code the developer writes for the application. Because I was using the software in numerous places, I decided to build it as a static library for the iOS simulator. I was able to build the library, and convert one application to link to that library instead of compiling the original source code. However, when I go to run the application on the simulator, I get an error that says, unrecognized selector

“unrecognized selector sent to class” when calling category method from a library

自古美人都是妖i 提交于 2019-12-03 03:06:48
Problem This question may seem a bit long, but I try to give as much information as possible, since I am really staggered by this. I am currently working an a library which should automate XML document parsing. But I am running into a problem now testing the library for the first time. I have a library class called CSXDocumentLayout which represents the layout of a document. This class contains the private method - (NSError *)readLayoutDocument:(NSString *)fpath called from an init method. /* MARK: Reading in Layouts */ - (NSError *)readLayoutDocument:(NSString *)fpath { CSXDocumentLayout

Unrecognized selector error for isEqualToString: when setting text of a label

这一生的挚爱 提交于 2019-12-02 10:49:58
I am trying to set the text of a label from one of the properties of my model object ( searchRecipeDetailsVariable ), but I get an error //Extract number of servings from dictionary and place in model self.searchedRecipeDetailsVariable.numberOfServings = [self.detailedSearchYummlyRecipeResults objectForKey: @"numberOfServings"]; //log number of servings to check that it works NSLog(@"Number of Servings, %@",self.searchedRecipeDetailsVariable.numberOfServings); self.numberOfServingsLabel.text = self.searchedRecipeDetailsVariable.numberOfServings; When I print the value, I can see the number

Unrecognized selector with UITapGestureRecognizer

邮差的信 提交于 2019-12-02 08:41:11
I'm trying to add in my app the possibility to dismiss the keyboard when the user taps somewhere else out of the text fields. I'm implementing this functionality using UITapGestureRecognizer. I create a new UITapGestureRecognizer object using the Unrecognized selector with UITapGestureRecognizer(target: Any?, action: Selector?) and set the action parameter to a function that resigns the first responder of both the text fields I'm using in this view. I set everything properly adding the keyword @objc before the method I pass as action and using the #selector(dismissKeyboard) form, but when I

Swift 4: Timer Crashing - unrecognized selector sent to instance

无人久伴 提交于 2019-12-02 06:25:58
问题 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

NSMutableArray addObjects - unrecognized-selector

荒凉一梦 提交于 2019-12-02 05:38:27
This is how I initialize my NSMutablearray. I copy the content of cityList into cityArray. Both are NSMutableArray. FYI, I declared the'cityArray' using extern. cityArray = [[NSMutableArray alloc] init]; [cityArray addObjectsFromArray:cityList]; Then, in other method in another class, I tried to to add one more object into 'cityArray' This is how I do it. But it keep crashing when it run this line of code. NSString *allCities = @"All Cities"; [[cityArray valueForKey:@"cityName"] addObject:allCities]; This is from the console '[__NSArrayI addObject:]: unrecognized selector sent to instance

BUTTON SHAPE on in device (iPhone) setting result app crash if its off app working

耗尽温柔 提交于 2019-12-02 05:37:44
问题 Recently i switch my app to iOS 7 compatibility and the app working fine but if i switched on the Button Shape option (Available in iOS 7.1) in device setting (Setting--> Accessblity--> Button shape switch) then app crash and gives following error:- -[NSAttributeDictionary textContainerForAttributedString:containerSize:lineFragmentPadding:]: unrecognized selector sent to instance 0x17e4e310 CoreFoundation And the app work fine when button shape option switched off. crash stack trace:- -

How can I isolate third-parties' C/C++/ObjC libraries' symbols from each other?

大憨熊 提交于 2019-12-02 05:17:22
问题 I have a project that needs to incorporate two third-party libraries, libA and libB. I have little, if any, influence over the third-party libraries. The problem being is that both libA and libB include different versions of a common library, ASIHTTPRequest. As a result, I'm getting errors like: -[ASIFormDataRequest setNumberOfTimesToRetryOnTimeout:]: unrecognized selector sent to instance 0x3b4170 , which I can only assume are because libA is referring to libB's implementation of

BUTTON SHAPE on in device (iPhone) setting result app crash if its off app working

烈酒焚心 提交于 2019-12-01 23:51:08
Recently i switch my app to iOS 7 compatibility and the app working fine but if i switched on the Button Shape option (Available in iOS 7.1) in device setting (Setting--> Accessblity--> Button shape switch) then app crash and gives following error:- -[NSAttributeDictionary textContainerForAttributedString:containerSize:lineFragmentPadding:]: unrecognized selector sent to instance 0x17e4e310 CoreFoundation And the app work fine when button shape option switched off. crash stack trace:- -[NSAttributeDictionary textContainerForAttributedString:containerSize:lineFragmentPadding:]: unrecognized