ios - NSDictionary Strange Behaviour with NSString key -
nsstring *downloadeditemidstring = [dict objectforkey:@"id"]; nslog(@"downloadeditemidstring = %@", downloadeditemidstring); if([storedrecordsdict objectforkey:downloadeditemidstring] != nil) nslog(@"1) item id %@ exists!", downloadeditemidstring); if([storedrecordsdict objectforkey:@"6226691114401792"] != nil) nslog(@"2) item id 6226691114401792 exists!"); log :
2014-04-15 20:51:37.336 appdemo[2201:60b] downloadeditemidstring = 6226691114401792
2014-04-15 20:51:37.337 appdemo[2201:60b] 2) item id 6226691114401792 exists!
i'm new obj c , i've been trying solve hours..please me understand why not find object when supplied nsstring key?
nsstring *downloadeditemidstring = [dict objectforkey:@"id"]; nslog(@"downloadeditemidstring = %@", downloadeditemidstring); if([downloadeditemidstring isequaltostring:@"6226691114401792"]) { if([storedrecordsdict objectforkey:downloadeditemidstring] != nil) nslog(@"1) item id %@ exists!", downloadeditemidstring); if([storedrecordsdict objectforkey:@"6226691114401792"] != nil) nslog(@"2) item id 6226691114401792 exists!"); } first of check downloadeditemidstring equal @"6226691114401792" both if condition execute.
Comments
Post a Comment