tunescare tarda software restaurar recibir realizar puede pudo problema para ocurrio ocurrido mucho llamadas extrayendo error desconocido descargar celular actualizacion iphone core-data uitableview

iphone - tarda - Intentando corregir errores:*** Error de aserción en-



no se pudo restaurar el iphone ocurrio un error desconocido 9 (7)

Tengo un simple UITableviewController que solía funcionar bien y ahora algo lo ha roto. Presenta un formulario simple que me permite agregar un registro simple de 3 campos a un objeto administrado de datos centrales.

Cuando agrego un registro, debería volver a la tabla y mostrar el contenido. Puedo ver que está escribiendo el registro en la base de datos pero la tabla está vacía y aparece el error a continuación. Puedo seguir agregando registros haciendo clic en el botón "Agregar", pero cada vez que guardo el nuevo registro y vuelvo a la tabla, está vacío.

El error completo que veo es este ...

*** Assertion failure in -[UITableView _createPreparedCellForGlobalRow:withIndexPath:], /SourceCache/UIKit_Sim/UIKit-1448.89/UITableView.m:5678 2011-10-01 22:48:11.860 Gradetrack[59617:207] Serious application error. An exception was caught from the delegate of NSFetchedResultsController during a call to -controllerDidChangeContent:. UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath: with userInfo (null)

Si detengo el simulador y lo reinicio, puedo ver en mis declaraciones de NSLog que ha descubierto el número correcto de registros de la base de datos y ha intentado cargar la tabla, pero en este punto, obtengo este error similar y el seguimiento de la pila a continuación. .

2011-10-01 23:08:50.332 Gradetrack[59795:207] >>> Enumber of courses entered thus far: 4 2011-10-01 23:08:50.334 Gradetrack[59795:207] *** Assertion failure in -[UITableView _createPreparedCellForGlobalRow:withIndexPath:], /SourceCache/UIKit_Sim/UIKit-1448.89/UITableView.m:5678 2011-10-01 23:08:50.337 Gradetrack[59795:207] *** Terminating app due to uncaught exception ''NSInternalInconsistencyException'', reason: ''UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'' *** Call stack at first throw: ( 0 CoreFoundation 0x00fd05a9 __exceptionPreprocess + 185 1 libobjc.A.dylib 0x01124313 objc_exception_throw + 44 2 CoreFoundation 0x00f88ef8 +[NSException raise:format:arguments:] + 136 3 Foundation 0x000e43bb -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116 4 UIKit 0x0035ec91 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 883 5 UIKit 0x003544cc -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 75 6 UIKit 0x003698cc -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1561 7 UIKit 0x0036190c -[UITableView layoutSubviews] + 242 8 QuartzCore 0x01f70a5a -[CALayer layoutSublayers] + 181 9 QuartzCore 0x01f72ddc CALayerLayoutIfNeeded + 220 10 QuartzCore 0x01f180b4 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 310 11 QuartzCore 0x01f19294 _ZN2CA11Transaction6commitEv + 292 12 UIKit 0x002eb9c9 -[UIApplication _reportAppLaunchFinished] + 39 13 UIKit 0x002ebe83 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 690 14 UIKit 0x002f6617 -[UIApplication handleEvent:withNewEvent:] + 1533 15 UIKit 0x002eeabf -[UIApplication sendEvent:] + 71 16 UIKit 0x002f3f2e _UIApplicationHandleEvent + 7576 17 GraphicsServices 0x01928992 PurpleEventCallback + 1550 18 CoreFoundation 0x00fb1944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52 19 CoreFoundation 0x00f11cf7 __CFRunLoopDoSource1 + 215 20 CoreFoundation 0x00f0ef83 __CFRunLoopRun + 979 21 CoreFoundation 0x00f0e840 CFRunLoopRunSpecific + 208 22 CoreFoundation 0x00f0e761 CFRunLoopRunInMode + 97 23 UIKit 0x002eb7d2 -[UIApplication _run] + 623 24 UIKit 0x002f7c93 UIApplicationMain + 1160 25 Gradetrack 0x00002034 main + 102 26 Gradetrack 0x00001fc5 start + 53

Según las declaraciones de NSLog, esta es la última subrutina ejecutada.

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // Return the number of rows in the section. NSLog(@">>> Enteringg %s [Line %d] ", __PRETTY_FUNCTION__, __LINE__); id <NSFetchedResultsSectionInfo> sectionInfo = [[_fetchedResultsController sections] objectAtIndex:section]; NSLog(@">>> Enumber of courses entered thus far: %d ", [sectionInfo numberOfObjects]); return [sectionInfo numberOfObjects]; }

Nota: la salida del Número de cursos ingresados ​​hasta ahora ... fue 4, lo cual fue correcto.

Aquí es donde devuelvo las células al UITableViewController

- (UITableViewCell *)tableView:(UITableView *)tableView atIndexPath:(NSIndexPath *)indexPath { NSLog(@">>> Entering %s [Line %d] ", __PRETTY_FUNCTION__, __LINE__); static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; } // Set up the cell... [tableView setAllowsSelectionDuringEditing:NO]; [self configureCell:cell atIndexPath:indexPath]; // load the cell with an appropriate image NSString *path = [[NSBundle mainBundle] pathForResource:@"studentprofile" ofType:@"png"]; UIImage *theImage = [UIImage imageWithContentsOfFile:path]; cell.imageView.image = theImage; return cell; }

Basándome en estos errores y en mi seguimiento de pila, ¿puede alguien apuntarme en la dirección correcta?

Muchas gracias,

Phil


Basado en UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath: parece que se le puede haber olvidado establecer un identificador de celda en la instanciación:

cell = ((DetailCell *)[tableView dequeueReusableCellWithIdentifier:DetailCellIdentifier]); if (! cell) { // build the cell here }

Si no, ¿en qué parte del código se produce el error?


En mi caso, iOS 5.0 ~ 6.0 con storyboard debería tener el mismo identificador de celda entre los métodos.

(- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath) and **storyboard file**. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; ... }

Si usó @ "Celda" para el identificador de celda, debe usar el nombre en el Identificador de tableViewCell correspondiente en el inspector de atributos del archivo del guión gráfico.

Cuando crea una subclase de archivo UITableView, el código predeterminado usa @ "Celda", pero no el guión gráfico, en blanco. Así que hay que prestar atención.


Me encontré con el mismo problema, pero declaré descuidadamente:

<UITableViewDelegate, UITableViewDelegate>

en lugar de correctamente:

<UITableViewDelegate, UITableViewDataSource>

Joe

* actualización: también noté en xCode 4.3 que a la plantilla generada al crear una nueva Clase UITableViewController le falta un elemento clave en cellForRowAtIndexPath. Es decir:

if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; }


Ok, lo siento, alerta SNAFU.

No estoy seguro de cómo ocurrió esto, pero si observa en mi declaración de función para "cellForRowAtIndexPath" ... solo tiene atIndexPath en lugar de cellForRowAtIndexPath. Debo haber hecho algún tipo de búsqueda y reemplazo global mal aconsejado y destruyó mi proyecto.

Trabajando ahora. Gracias.

Pregunta: ¿por qué se compilaría el código sin error ni advertencia? Guau: esto tomó demasiado tiempo para encontrarlo.


Solo luché con esta afirmación por unas horas. Estaba intentando agregar un UIButton como una subvista en la celda que también estaba en la punta. Aparentemente, a "Autolayout" no le gusta esto, así que después de desmarcar la opción en mi plumilla, ya no recibo el bloqueo.


Una de las razones más comunes de este error es que, en el archivo de punta, la vista de la interfaz de usuario de nivel superior debe ser del tipo UITableViewCell y, si ese no es el caso, produce este error de aserción.


tableView:cellForRowAtIndexPath: esta excepción cuando borré accidentalmente la return cell en tableView:cellForRowAtIndexPath: Esta excepción se produce cuando no se crea o devuelve ninguna celda.