I’m trying to get tweets using the Twitter API, but for some reason this problem is coming up whenever I try to refresh the tweets:
[__NSCFDictionary isEqualToString:]: unrecognized selector sent to instance 0x6c22e70
Getting tweets for the first time and filling “tweetssofar” is happening properly, and when I NSLog fromtwitternew and existingtwitter, both are showing the same thing. Both are strings that are actually dictionaries, but why cannot I compare them this way? Thanks!
- (void)statusesReceived:(NSArray *)statuses forRequest:(NSString *)connectionIdentifier {
NSString *fromtwitternew = [statuses objectAtIndex:0];
NSString *existingtwitter = [tweetssofar objectAtIndex:0];
NSLog(@"No problem so far");
if ([fromtwitternew isEqualToString:existingtwitter]) { //No new tweets
NSLog(@"No new tweets");
contents = [[NSDictionary alloc] init];
contents = [tweetssofar objectAtIndex:counter];
}
@Prajoth with the following code , I am sure you will be able to fix your problem
The Crash is most probably because you are comparing isEqualToString: Method to compare two dictionary objects which you should not be doing. In case you need to compare two tweets you should first extract the Strings from dictionary and then compare them.