0
これらの3行のコードには、この "代理人"があります.FruitsAppDelegateではなく、コード内のどこにでも見つけられません。私はそれが何を表しているのか覚えていない:それは大会ですか?自動的にAppDelegateを表しますか?あなたは共有アプリケーションの代理人ですか?
// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
FruitAppDelegate *appDelegate = (FruitAppDelegate*)[[UIApplication sharedApplication] delegate];
return appDelegate.fruits.count;
}
おかげ
ありがとうございますが、具体的には: '[[UIApplication sharedApplication] delegate]'デリゲートの単語はデリゲートの権利としてアプリケーションによって自動的に認識されますか? – Paul
はい。委任は、プロジェクトの作成時に自動的に設定されます。だから、 "代理人"プロパティはあなたのFruitAppDeleagteを指し示すだけです。 – nagan
ご協力いただきありがとうございます – Paul