NSDateFormatter *formatter;
NSString *dateString;
formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"dd-MM-yyyy HH:mm a"];
dateString = [formatter stringFromDate:[NSDate date]];
[formatter release];
appDelegate.myCallLogDict = [[NSMutableDictionary alloc]init];
[appDelegate.myCallLogDict setObject:phoneNo forKey:@"CallLogPhoneNoKey"];
[appDelegate.myCallLogDict setObject:dateString forKey:@"CallLogTimeStampKey"];
I have stored phone no and time into an nsmutabledictionery and i want to access that dictionery value as like below into the –
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath method
cell.detailTextLabel.text = [[appDelegate.myCallLogDict objectForKey:@"CallLogTimeStampKey" ]objectAtIndex:row];
cell.textLabel.text = [[appDelegate.myCallLogDict objectForKey:@"CallLogPhoneNoKey"] objectAtIndex:row];
when i run the above code i get the below error
Please help me up
-[NSCFString objectAtIndex:]: unrecognized selector sent to instance 0x5b227e0
2011-12-15 10:06:09.050 MyDialer[1090:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString objectAtIndex:]: unrecognized selector sent to instance 0x5b227e0'
Thanks a lot for your help
I think you have to save your key data in an array and then use the
objectAtIndexon that array.