私はiPhoneを初めて使用しています.データを取得するためにいくつかのコードを使用していますが、それがより良いアプローチであるかどうかを混乱させています. 私は3つのクラスを持っています 1.BiblePlayerAppDelegate 2.BiblePlayerViewController 3.ShowProgressViewController
BiblePlayerViewController.m では:
-(NSString *)selectedBookTitle {
//getting the text which is in the bookSelectionButton and assign that to selectedBookTitle
selectedBookTitle = [[bookSelectionButton titleLabel]text];
//return the selectedBookTitle String
return selectedBookTitle;
}
上記のメソッドを biblePlayerViewController.m に記述し、selectedBookTitle は biblePlayerViewController クラスのクラス変数です。ここで、同じクラスで、このメソッドを数回、ほぼ 30 回呼び出しています。メソッドを 30 回呼び出すためのより良いアプローチですか?これはそのクラスにあります.私はshowProgressViewControllerでこのメソッドを使用しています.それは私にとってとても役に立ちます