现在我定义一个委托,其中有3个方法:
@protocol A <NSObject>
-(void) a;
-(void) b;
-(void) c;
@end然后在类B中实现委托A的这三个方法,请问,这3个方法的执行顺序是按照什么来的?有没有顺序要求?谢谢
@protocol A <NSObject>
-(void) a;
-(void) b;
-(void) c;
@end然后在类B中实现委托A的这三个方法,请问,这3个方法的执行顺序是按照什么来的?有没有顺序要求?谢谢
解决方案 »
- 请教各位高手,PC和iPhone是否可以通过usb进行TCP通讯?
- 关于UItouch 点击位置的问题
- iphone windows-based application 与view-based application的区别
- 请教: AppStore中关于支付安全性的问题
- IOS7 UI状态保持和恢复
- iOS tabbar 明明设置的title为什么运行的时候不显示
- UIimage图片失真
- oc中点击button弹出新页面,纯代码怎么实现[100分求]
- 苹果App创建本地app失败 是为什么?
- 苹果9.0.2真机运行各种奔溃
- 栈是什么?有多大?栈和栈区是同一概念吗??
- 请教UIImage显示效率问题
// 方法1
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}// 方法2
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 2;
}// 方法3
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell...
cell.textLabel.text = [_days objectAtIndex:indexPath.row];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}// 方法4.....上面这几个方法有执行先后顺序吗?
numberOfSectionsInTableView方法来返回table中有几个组. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
} numberOfRowsInSection方法来返回每个组里有几行 - (NSInteger)tableView:(UITableView *)tableView
numberOfRowsInSection:(NSInteger)section
{
return [list count];
} 最后用cellForRowAtIndexPath
是乔布斯手下规定的。
ncount++;3打开 调试进入debug,打开consle控制台查看即可。这样就能达到了你的目的。不过意义不大,因为有的时候会重复调用这些方法,比如下拉菜单的时候或者重新进入页面的时候。你可以通过查看 nslog来知道这些方法都运行了没有
id<A> myDelegate;myDelegate = b;
其中,b是类B的实例,B实现了协议A