0
먼저, 나는 객관적인 -c와 ios 개발에 대해 상당히 새로운 것을 알게되었습니다.다운로드 한 plist에서 UITableView 데이터를 다시로드
인터넷에서 다운로드 된 .plist가 있으며 UITableView를 채우는 데 사용됩니다. 이 AppDelegate ApplicationDidLaunch 메서드를 사용하는 동안 작동하도록 얻을 수 있습니다.
NSString *path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *finalPath = [path stringByAppendingPathComponent:@"Data.plist"];
NSURL *theFileURL = [NSURL URLWithString:@"http://dl.dropbox.com/u/8068058/Data.plist"];
NSDictionary *replace = [[NSDictionary alloc] initWithContentsOfURL:theFileURL];
if (replace != nil){
[replace writeToFile:finalPath atomically:YES];
}
그때 그때 내가있는 TableView를 채우고를 표시, 모든 괜찮 데이터 경로
NSString *Path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *DataPath = [Path stringByAppendingPathComponent:@"Data.plist"];
NSDictionary *tempDict = [[NSDictionary alloc] initWithContentsOfFile:DataPath];
self.data = tempDict;
[tempDict release];
로 설정합니다. 테이블을 표시하는 NavgationController에 '새로 고침'버튼을 추가하면 내가 이것을 누르고 동일한 다운로드 코드를 실행하면
[self.tableView reloadData];
나는 아무 것도 얻지 못합니다. 누구든지이 문제를 해결하는 방법을 알고 있습니까?
는 귀하의 테이블 뷰입니다. – aforaudrey
나는 테이블 뷰에 대해 다음과 같은 코드를 가지고있다. self.tableDataSource = tempArray; 그런 다음 tabeDataSource를 plist에 대한 objectAtKey로 설정하는 코드가 있습니다. 처음 실행시 테이블이 잘 채워지지만 앱이 실행되는 동안 데이터를 새로 고칠 수 없습니다. – jrgrs
뜻은 Storyboard/IB의 컨트롤러 등으로 연결된 테이블보기입니까? – aforaudrey