보기 컨트롤러 클래스의 SecondViewController에서 단추가있는 배열을 삭제하는 데 도움이 필요합니다. 순간 C-Objective의 다른 클래스에서 NSMutableArray를 삭제 하시겠습니까?
나는이 있습니다- (IBAction)deleteArrayFromSeconViewController:(id)sender // is the Button which should
// delete the array
{
self.textLabel2.text = @""; // this work fine
ViewController *vc = [[ViewController alloc]init];
[vc.textViewArray removeAllObjects]; // do not remove the objects?
}
나는 ViewControllerClass에서 SecondViewControllerClass에서 주문을 추월하기 위해 어떻게해야합니까?
나는 SecondViewControllerClass 또한이 시도 :
- (void) deleteTheArray
{
[textViewArray removeAllObjects];
}
새 "컨트롤러를 만드는 것보다 현재"다른보기 컨트롤러 "가 필요합니다. – Krizz
배열을 지우기 위해 호출하는 다른 ViewController에서 메소드를 작성하여 데이터를 그 아래에서 꺼내는 대신 모든 가사 코드를 실행하도록 선택할 수 있습니다. 필요한 정리 작업이 없어도 향후 리팩터링을 쉽게 할 수 있습니다. :) – matthias