NSLog(@“%@”,indexPath);
<NSIndexPath: 0xd2897d0> {length = 2,path = 0 - 0}<NSIndexPath: 0xd290af0> {length = 2,path = 1 - 0}<NSIndexPath: 0xd2a5cd0> {length = 2,path = 2 - 0}<NSIndexPath: 0xd2a8340> {length = 2,path = 3 - 0}
的cellForRowAtIndexPath
- (UItableVIEwCell *)tableVIEw:(UItableVIEw *)tableVIEw cellForRowAtIndexPath:(NSIndexPath *)indexPath { UItableVIEwCell *cell = nil; if (indexPath.row < 3) { TextFIEldtableVIEwCell *accountCell = [tableVIEw dequeueReusableCellWithIDentifIEr: textFIEldCellIDentifIEr forIndexPath: indexPath]; accountCell.cellTextFIEld.delegate = self; accountCell.cellLabel.text = [accountArray objectAtIndex: indexPath.row]; if (indexPath.row == 0) { accountCell.cellTextFIEld.keyboardType = UIKeyboardTypeDefault; } else if (indexPath.row == 1) { accountCell.cellTextFIEld.keyboardType = UIKeyboardTypeNumberPad; } else if (indexPath.row == 2) { accountCell.cellTextFIEld.keyboardType = UIKeyboardTypeNumberPad; } cell = accountCell; } else if (indexPath.row == 3) { ACEExpandableTextCell *textVIEwCell = [tableVIEw expandableTextCellWithID:@"cellID"]; textVIEwCell.text = [self.cellData objectAtIndex:indexPath.section]; textVIEwCell.textVIEw.placeholder = @"Placeholder"; cell = textVIEwCell; } return cell;}解决方法 问题可能是这个
- (NSInteger)numberOfSectionsIntableVIEw:(UItableVIEw *)tableVIEw{ return [arry count];} - (NSInteger)tableVIEw:(UItableVIEw *)tableVIEw numberOfRowsInSection:(NSInteger)section return 1; }
代替
- (NSInteger)numberOfSectionsIntableVIEw:(UItableVIEw *)tableVIEw{ return 1;} - (NSInteger)tableVIEw:(UItableVIEw *)tableVIEw numberOfRowsInSection:(NSInteger)section return [arry count]; }总结
以上是内存溢出为你收集整理的ios – indexPath在所有行中返回0全部内容,希望文章能够帮你解决ios – indexPath在所有行中返回0所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)