2014-06-09 49 views
0

是什麼@protocol有2個元素

@protocol UIPageViewControllerDelegate, UIPageViewControllerDataSource; 

是什麼意思?

這是否意味着UIPageViewControllerDelegate和UIPageViewControllerDataSource協議有一些共同的方法和屬性?

回答

2
@protocol UIPageViewControllerDelegate, UIPageViewControllerDataSource; 

相當於...

@protocol UIPageViewControllerDelegate; 
@protocol UIPageViewControllerDataSource; 

就像......

int x, y, z; 

相當於...

int x; 
int y; 
int z; 
2

某些情況下,你找到了幫助。

它看起來像是兩個協議的前向聲明,它們在同一個語句中並不意味着關聯。與int x, y相同並不意味着x和y之間有任何連接。