|  
 
 
ackButton; // custombackButton的方法中包含popViewController和你想加的其它代码 
(二十五)category可以用来调试。除了隐藏私有方法外,我主要用它截住函数。  例1:测试时我想知道TableViewCell有没有释放,就可以这样写  @implementation UITableViewCell(dealloc)  -(void)dealloc  {  NSLog(@"%@",NSStringFromSelector(_cmd));    // allSubviews是cookBook小学教师实习报告 里的函数,可以取一个view的所有subView      NSArray *array = allSubviews(self);      NSLog(@"%@",array);  
    [super dealloc];  } .cp @end  其它的类也可以这样写,你随便输出什么  例2:我调试程序,觉得table的大小变了,想找到在哪改变的,机械厂35/366KV总降压变电所设计这样做:  @implementation UITableView(setframe)  -(void)setFrame:(CGRect)frame  {  NSLog(%"%@",self);      [super setFrame: frame];  }  @end  上一页  [1] [2] [3] [4] [5] [6]  
 |