Application termination due to an uncaught exception "NSRangeException", reason: "*** - [NSMutableArray objectAtIndex:]: index 1 outside the bounds [0 .. 0] '

I get the following errors, very new to iphone dev and goal C. I really want to send my project so that someone looks, I run in circles and don’t know what to do next!

2010-11-10 19:38:07.822 iShisha[2698:207] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSMutableArray objectAtIndex:]: index 1 beyond bounds [0 .. 0]'
*** Call stack at first throw:
(
 0   CoreFoundation                      0x025f9b99 __exceptionPreprocess + 185
 1   libobjc.A.dylib                     0x0274940e objc_exception_throw + 47
 2   CoreFoundation                      0x025ef695 -[__NSArrayM objectAtIndex:] + 261
 3   iShisha                             0x00003dc5 -[MapViewController tableView:cellForRowAtIndexPath:] + 1262
 4   UIKit                               0x0032dd6f -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 619
 5   UIKit                               0x00323e02 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 75
 6   UIKit                               0x00338774 -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1561
 7   UIKit                               0x003307ec -[UITableView layoutSubviews] + 242
 8   QuartzCore                          0x046d7481 -[CALayer layoutSublayers] + 177
 9   QuartzCore                          0x046d71b1 CALayerLayoutIfNeeded + 220
 10  QuartzCore                          0x046d02e0 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 302
 11  QuartzCore                          0x046d0040 _ZN2CA11Transaction6commitEv + 292
 12  QuartzCore                          0x04700ebb _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 99
 13  CoreFoundation                      0x025daf4b __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 27
 14  CoreFoundation                      0x0256fb27 __CFRunLoopDoObservers + 295
 15  CoreFoundation                      0x02538ce7 __CFRunLoopRun + 1575
 16  CoreFoundation                      0x02538350 CFRunLoopRunSpecific + 208
 17  CoreFoundation                      0x02538271 CFRunLoopRunInMode + 97
 18  GraphicsServices                    0x02ed800c GSEventRunModal + 217
 19  GraphicsServices                    0x02ed80d1 GSEventRun + 115
 20  UIKit                               0x002caaf2 UIApplicationMain + 1160
 21  iShisha                             0x00001de8 main + 102
 22  iShisha                             0x00001d79 start + 53
)
terminate called after throwing an instance of 'NSException'

[Session started at 2010-11-10 19:38:15 +0000.]
Pending breakpoint 1 - ""MapViewController.m":204" resolved
Pending breakpoint 2 - ""MapViewController.m":317" resolved
Pending breakpoint 3 - "objc_exception_throw" resolved
(gdb) 
+4
source share
2 answers

CocoaTouch . , , , . , , , ..

,

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

.

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

tableView , . iPhone , (), (). , ,

object = [array objectAtIndex:INTEGER]; //where INTEGER is an unsigned (zero or greater, no minus)

, , X , X-Y. , 10, 9, 10- , , .

hte

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

, . , .

.

+10

, ( , ). , , 0 " " . , , 1 .

, , @styfle .

+1

All Articles