행을 탭하면 앱이 작동을 멈추고 didSelectRowAtIndexPath
의 코드이고 stringDate
은 Feb 4
과 같은 문자열입니다. 이 오류와 함께 라인 NSString *stringDate = [cellValue valueForKey:@"date"];
에 행을 도청 할 때NSString에서 NSString을 파싱 할 때 오류가 발생했습니다.
EditView *editController = [[EditView alloc] initWithNibName:nil bundle:nil];
[self.navigationController pushViewController:editController animated:YES];
NSDictionary *cellValue = [self.array objectAtIndex:[indexPath row]];
editController.savedString = [cellValue objectForKey:@"label"];
NSDateFormatter *df = [[NSDateFormatter alloc] init];
NSString *stringDate = [cellValue valueForKey:@"date"];
NSDate *parsedDate = [df dateFromString:stringDate];
editController.savedDate = parsedDate;
[editController release];
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
는이 오류를 얻을 :
* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: date'
UPDATE : 구문 분석 된 날짜, 날짜 & 시간 모드와 UIDatePicker
로 설정하고 단순히 문자열 날짜를 과 함께 사용하는 NSDate
으로 변환 중입니다.
을 만들었습니다. 0을 NSDictionary
으로 입력하면 을 작성하여 NSDictionary
을 만든 다음 NSString
형식으로 작성합니다. 그리고 array
표시 plist
배열은, 그래서 당신은 당신의 문자열이
을 충족 형식 포맷터를 가르 칠 필요 [cellValue objectForKey:@"date"]
NSDictionary *cellValue = [self.array objectAtIndex:[indexPath row]];
, NSString * stringDate = [cellValue objectForKey : @ "date"]; '를 사용하는 경우 – vikingosegundo
btw : cellValue로 반환 할 개체를 만들 때 NSDate를 만듭니다. – vikingosegundo
''ObjectForKey'를 사용해 보았지만 작동하지 않습니다. 이제는'Feb 02' 대신'2012-02-04 16:36:50 + 0000' 원시 날짜의 출력을 생성했습니다. 그렇다면'valueForKey'와'objectForKey'를 사용했지만 여전히 작동하지 않습니다. – Souljacker