plist から情報を取得して電子カタログを作成するアプリを作成しています。さまざまなバージョンがありますが、各アプリのコードにアクセスして、各アプリにこの数のセクションを設定し、更新を行うたびに設定する必要がなければいいと思います.
do while ループを使用してこれを達成したいのですが、それぞれのインスタンスの名前を変更する方法がわかりません。添付のコードをご覧ください。どんな助けでも大歓迎です!
scroller = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 44, 320, 387)];
int secNum = 8;
int secTemp = 0;
int frameWidth = self.view.frame.size.width;
int frameHeight = self.view.frame.size.height;
do {
id *sectionViewController = [NSString stringWithFormat:@"svc%d",secTemp];
SectionViewController *sectionViewController = [[SectionViewController alloc] init];
[sectionViewTable setDataSource:sectionViewController];
[sectionViewTable setDelegate:sectionViewController];
sectionViewController.view = sectionViewController.tableView;
sectionViewController.view.frame = CGRectMake(frameWidth*secTemp, 0, frameWidth, frameHeight);
secTemp = secTemp + 1;
[scroller addSubview:sectionViewController.view];
} while (secTemp < secNum);
scroller.contentSize = CGSizeMake(320*secTemp, 387);
scroller.pagingEnabled = YES;
私は残りを理解することができず、自分自身を助けるためにオンラインで何も見つけられませんでした. ありがとう!