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"];
我已存儲的電話沒有時間到nsmutabledictionery時發送到實例,我想訪問dictionery值作爲像下面進入 -[NSCFString objectAtIndex:]:無法識別選擇使用nsmutabledictionery
(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];
當我運行上面的代碼,我得到下面的錯誤
請幫我
-[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'
非常感謝您的幫助
您是否使myCallLogDict的屬性在appappDelegate中合成? – Maulik 2011-12-15 04:53:26
是的,我在應用程序代理 – user198725878 2011-12-15 04:54:20