spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories

SortedArrayUsingSelector unrecognized Selector


The problems is this line:

animals= [NSDictionary
dictionaryWithObjectsAndKeys:_A,_B,_C,_D,_E,_F,_G,_H,
nil];

When you create a dictionary with dictionaryWithObjectsAndKeys: the list of items you supply have to be objectA, keyA, objectB, keyB, objectC, keyC, nil. Right now it looks like all you have is objectA, objectB, objectC, nil. Which looks like this if you write it out:

animals = @{@[@"Bear", @"Black Swan",
@"Buffalo"] : @[@"Camel", @"Cockatoo"],
            @[@"Dog", @"Donkey"] : @[@"Emu"],
            @[@"Giraffe", @"Greater Rhea"] :
@[@"Hippopotamus", @"Horse"]};

When you call [[animals allKeys] sortedArrayUsingSelector:@selector(compare:)] it's calling the compare: selector on all of the items in [animals allKeys] which are NSArrays which don't support the compare: method and thus the unrecognized selector error.

Not sure exactly what you want but try this:

animals= [NSDictionary
dictionaryWithObjectsAndKeys:_A, @"A", _B, @"B",
_C, @"C", nil];

Categories : IOS

Related to : SortedArrayUsingSelector unrecognized Selector
unrecognized selector sent to instance XCODE
you have written this line UINavigationController *navController = (UINavigationController *) self.window.rootViewController; you are expecting window's rootviewcontroller as navigation controller but it is returning uiviewcontroller. as a result when u are calling navController.viewControllers , application is raising an exception. because pointer is of UINavigationController but object inside i

Categories : IOS
unrecognized selector sent to instance 0x7ff971e1f920
Presumably you've defined a custom cell subclass with a configure: method. Your subclass isn't being used - that message means you're calling the method on a plain UITableViewCell. The most common cause of this is forgetting to set the cell class in the storyboard. Otherwise, you'll need to show how you're creating cell.

Categories : IOS
Unrecognized selector sent to instance NSTimer Swift
You have defined the updateTime as a local function to Stopwatch, so it is not available outside of its scope. You should move it at class level (same as Stopwatch) in order to be accessible. I notice however that there are some local variables which should probably be instance properties.

Categories : IOS
+[UIPasteboard _accessibilityUseQuickSpeakPasteBoard]: unrecognized selector sent to class
This problem appears because TapJoy has used categories in static library (that's UIPasteboard_QSExtras) The solution is super simple, you need to notify linker about that 1) Click on the project 2) Click on the target 3) Open Build Settings tab 4) Search for Other Linker Flags 5) Double click on Other Linker Flags 6) Add -ObjC and -all_load flags 7) Remove binary (delete from device/si

Categories : IOS
Cordova iOS 3.7.0 Issue - [__NSCFString JSONObject]: unrecognized selector
This is a problem if you remove the -ObjC linker switch. The libCordova.a library specifies some categories on NSString which will not get loaded if -ObjC is removed. A work around is to remove libCordova.a from the linked frameworks and add this to the Other Linker Flags build setting: -force_load $(BUILT_PRODUCTS_DIR)/libCordova.a This will cause all symbols (including the categories) in libC

Categories : Cordova
Recently Add
Graph API Error Domain=com.facebook.sdk Code=5
How do I use touch to only move my object in the y-coordinate?
Adding data from datePicker to table view
why there is a inset in tableviewcell's contentView when using xib and auto layout?
How to correctly implement protocol - delegate pattern between UIViewController and UIView in Swift
MagicalRecord several truncates, "then cannot find data for a temporary oid"
Swift - selectRowAtIndexPath not working with indexPathForSelectedRows
Hide UITableView search bar by default
How can I set the collection cell width to dynamic stretch to phone width
Tableview cell separating line disappears when tapped
Not appearing all level after SKTransition
How to transform a line during pan gesture event?
Nib View not showing menu or navigation bar
Can't unpause SKScene after adding a label
Automatic decompresion of gzipped json response data not working
Parse.com relation object specify order
How can I debounce a method call?
How to set/get a value in a multilevel dictionary?
Distinct UITableViewCell / UICollectionViewCell metrics between iPhone 6 Plus and all other smaller screens
After receiving notification on the lock screen and entering Passcode, the user is not taken to the app
When trying to build DisplayCandy, the terminal gives me this error
Asserting properties in a custom NSMutableArray
Regulating Flow of Dropbox Datastore Sync and Delta Size Error
iTMSTransporter upload behavior
Extract "alert" text from push notification
Xcode Debugger Crashes (Xcode 6.1 / LLDB / Yosemite)
Set App to run on iPhone 5+
Emulate a table cell without needing a UITableView (re-using standard iOS UI)
No clock displayed on presented Interface Controllers
adding cocoapod dependencies to a cocoa touch framework
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.