小编Scu*_*ool的帖子

断言失败 - [UITableView _endCellAnimationsWithContext:]

希望这将是一个快速解决方案.我一直试图弄清楚我一直在犯的错误.下面列出了错误,并且appdelagate低于该错误.

任何帮助表示赞赏.

谢谢

2012-04-12 21:11:52.669 Chanda [75100:f803] ---断言失败-[UITableView _endCellAnimationsWithContext:],/SourceCache/UIKit_Sim/UIKit-1914.84/UITableView.m:1037 2012-04-12 21:11:52.671 Chanda [75100:f803] ---由于未被捕获的异常终止app' NSInternalInconsistencyException' ,原因:'无效更新:第0节中的行数无效.更新后的现有部分中包含的行数(2)必须等于更新前该部分中包含的行数(2),再加上或减去从该部分插入或删除的行数(插入1个,删除0个),加上或减去移入或移出该部分的行数(0移入,0移出).

#import "AppDelegate.h"

@implementation AppDelegate

@synthesize window = _window;
@synthesize databaseName,databasePath; 

- (BOOL)application: (UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions {
    self.databaseName = @"Customers.db";

    NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentDir = [documentPaths objectAtIndex:0];
    self.databasePath = [documentDir stringByAppendingPathComponent:self.databaseName];
    [self createAndCheckDatabase];

    return YES;
}

- (void)createAndCheckDatabase {
    BOOL success;

    NSFileManager *fileManager = [NSFileManager defaultManager];
    success = [fileManager fileExistsAtPath:databasePath];

    if (success) return; 

    NSString *databasePathFromApp …
Run Code Online (Sandbox Code Playgroud)

crash objective-c uitableview ios

89
推荐指数
4
解决办法
7万
查看次数

NSInvalidArgumentException',原因:' - [UITableViewWrapperView indexPathForCell:]

好吧,我有从iOS 6升级到7的问题.iOS 6工作正常,但我在iOS7中收到以下错误

我不确定,但我认为错误发生在这里.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Events Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}

// Configure the cell...
Event *event = [self.fetchedResultsController objectAtIndexPath:indexPath];
cell.textLabel.text = event.name;
return cell;
}
Run Code Online (Sandbox Code Playgroud)

基本上当我调用TableViewCell时,它会调出一个Datepicker但是当我点击"完成"按钮时它会崩溃.有线索吗?

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITableViewWrapperView indexPathForCell:]: unrecognized selector sent to instance 0xc133070'



2013-09-24 17:26:14.056 CRM4Life[36587:a0b] -[UITableViewWrapperView indexPathForCell:]:     unrecognized selector sent to instance 0xc133070
2013-09-24 17:26:14.097 …
Run Code Online (Sandbox Code Playgroud)

datepicker tableviewcell ios7

11
推荐指数
1
解决办法
3715
查看次数

试图在Swift 2.0中仅在UIDatePicker中设置时间

我试图设置UIDatePicker只提出时间.按下文本字段时,DatePicker会通过操作启动.我没有使用DatePicker Viewer.任何帮助表示赞赏.谢谢

let starttimedatePicker = UIDatePicker()
    startTimeDiveTextField.inputView = starttimedatePicker
    starttimedatePicker.addTarget(self, action: "startTimeDiveChanged:", forControlEvents: .ValueChanged)


func startTimeDiveChanged(sender: UIDatePicker) {
    let formatter = NSDateFormatter()
    formatter.timeStyle = .ShortStyle
    startTimeDiveTextField.text = formatter.stringFromDate(sender.date)
}
Run Code Online (Sandbox Code Playgroud)

uidatepicker ios swift

3
推荐指数
2
解决办法
1万
查看次数

上下文?.save(nil)出现错误

如果在上下文中出现以下错误,请使用Xcode 7和swift 2.0?.save(nil).

任何帮助表示赞赏

"不能对'NSManagedObjectContext'类型的非可选值使用可选链接

func newItem() {
    let context = self.context
    let ent = NSEntityDescription.entityForName("CallList", inManagedObjectContext: context)

    let nItem = CallList(entity: ent!, insertIntoManagedObjectContext: context)

    nItem.firstname = firstName.text
    nItem.lastname = lastName.text
    nItem.phonenumber = phoneNumber.text
    context?.save(nil)
Run Code Online (Sandbox Code Playgroud)

ios xcode7 swift2

2
推荐指数
1
解决办法
1351
查看次数