例如,我的ListViewController符合UITableViewDataSource和UITableViewDelegate协议……我在哪里放置cellForRowAtIndexPath或numberOfRowsInSection方法? …在ListViewController中实现它们或者像这样:
<<Protocol>> UITableViewDataSource --------------------- --------------------- -numberOfRowsInSection
如果我做了后者,ListViewController类和协议盒之间的关联是什么?我必须展示的是我如何与Cocoa Touch挂钩.
谢谢.
解决方法
此外,从http://en.wikipedia.org/wiki/Class_diagram:
In UML modeling,a realization
relationship is a relationship between
two model elements,in which one model
element (the client) realizes the
behavior that the other model element
(the supplier) specifies. A
realization is indicated by a dashed
line with an unfilled arrowhead
towards the supplier.…
A realization relationship between
classes and interfaces and between
components and interfaces shows that
the class realizes the operations
offered by the interface.
因此,如果我正确读取,ListViewController将有一个虚线,其中未填充的箭头指向UITableViewDataSource.