My app crashes - unfortunately, it's not reproducable - this is a crash log I got, but I cannot read anything that would help me. Perhaps someone of you? Would be reeeeeeeeally great...
0 libSystem.B.dylib 0x00088c24 __kill + 8
1 libSystem.B.dylib 0x00088c12 kill + 4
2 libSystem.B.dylib 0x00088c06 raise + 10
3 libSystem.B.dylib 0x0009f902 abort + 54
4 libstdc++.6.dylib 0x00065a00 __gnu_cxx::__verbose_terminate_handler() + 588
5 libobjc.A.dylib 0x00007f1c _objc_terminate + 160
6 libstdc++.6.dylib 0x00063100 __cxxabiv1::__terminate(void (*)()) + 76
7 libstdc++.6.dylib 0x00063178 std::terminate() + 16
8 libstdc++.6.dylib 0x000632a0 __cxa_throw + 100
9 libobjc.A.dylib 0x00006504 objc_exception_throw + 104
10 CoreFoundation 0x000a01c0 +[NSException raise:format:arguments:] + 64
11 CoreFoundation 0x000a01f4 +[NSException raise:format:] + 24
12 Foundation 0x0002cbc6 -[NSPlaceholderMutableString initWithString:] + 78
13 here_my_app 0x0002c35e 0x1000 + 176990
14 here_my_app 0x00029a6c 0x1000 + 166508
15 UIKit 0x000a9248 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 644
16 UIKit 0x000a8eac -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 44
17 UIKit 0x0006f3b8 -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1100
18 UIKit 0x0006ce40 -[UITableView layoutSubviews] + 200
19 UIKit 0x00014ab0 -[UIView(CALayerDelegate) _layoutSublayersOfLayer:] + 32
20 CoreFoundation 0x000285ba -[NSObject(NSObject) performSelector:withObject:] + 18
21 QuartzCore 0x0000a61c -[CALayer layoutSublayers] + 176
22 QuartzCore 0x0000a2a4 CALayerLayoutIfNeeded + 192
23 QuartzCore 0x00009bb0 CA::Context::commit_transaction(CA::Transaction*) + 256
24 QuartzCore 0x000097d8 CA::Transaction::commit() + 276
25 QuartzCore 0x000119d8 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 80
26 CoreFoundation 0x00074244 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 12
27 CoreFoundation 0x00075d9e __CFRunLoopDoObservers + 494
28 CoreFoundation 0x000772f6 __CFRunLoopRun + 934
29 CoreFoundation 0x0001e0bc CFRunLoopRunSpecific + 220
30 CoreFoundation 0x0001dfca CFRunLoopRunInMode + 54
31 GraphicsServices 0x00003f88 GSEventRunModal + 188
32 UIKit 0x00007b40 -[UIApplication _run] + 564
33 UIKit 0x00005fb8 UIApplicationMain + 964
34 here_my_app 0x00002f52 0x1000 + 8018
35 here_my_app 0x00002efc 0x1000 + 7932
here's the code for my "cellForRowAtIndexPath"
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = #"AbfahrtszeitResultTableCell";
AbfahrtszeitResultTableCell *cell = (AbfahrtszeitResultTableCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:#"AbfahrtszeitResultTableCell" owner:nil options:nil];
for (id currentObject in topLevelObjects) {
if ([currentObject isKindOfClass:[UITableViewCell class]]) {
cell = (AbfahrtszeitResultTableCell *) currentObject;
break;
}
}
// make cell not-selectable
cell.selectionStyle = UITableViewCellSelectionStyleNone;
// background color
BOOL day = [self isDayView];
if (day) {
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:ABFAHRTSZEIT_RESULT_TABLE_CELL_BACKGROUND_IMAGE_RED]];
cell.backgroundView = imageView;
[imageView release];
} else {
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:ABFAHRTSZEIT_RESULT_TABLE_CELL_BACKGROUND_IMAGE_BLUE]];
cell.backgroundView = imageView;
[imageView release];
}
// text color
cell.textLabel.textColor = [UIColor whiteColor];
}
// Set up the cell...
AbfahrtszeitResult *result = [abfahrten objectAtIndex:indexPath.row];
cell.linienLabel.text = [TextUtil cleanUpString:result.linie];
cell.zielLabel.text = [TextUtil cleanUpString:result.ziel];
cell.zeitLabel.text = [TextUtil cleanUpString:result.zeit];
return cell;
}
You read the stack from the bottom to the top. Here's the key area:
12 Foundation 0x0002cbc6 -[NSPlaceholderMutableString initWithString:] + 78
13 here_my_app 0x0002c35e 0x1000 + 176990
14 here_my_app 0x00029a6c 0x1000 + 166508
15 UIKit 0x000a9248 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 644
It looks like 15 is UIKit trying to create cells for a UITableView. 13 and 14 are in your code, likely your tableView:cellForRowAtIndexPath: method. 12 is a Foundation method dealing with strings.
I would take a look at your tableView:cellForRowAtIndexPath: method and see what you could be doing wrong with string initialization or post your method for us to examine.
Not enough information. You're stuck. Better not strip the symbols next time :)
Anyway, the key lines are
12 Foundation 0x0002cbc6 -[NSPlaceholderMutableString initWithString:] + 78
13 here_my_app 0x0002c35e 0x1000 + 176990
14 here_my_app 0x00029a6c 0x1000 + 166508
15 UIKit 0x000a9248 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 644
From #15 we know the error is in the -tableView:cellForRowAtIndexPath: method in one of your delegates, and from #12 we know the error is due to initializing a string. The only way -initWithString: will throw is when the input argument is nil. Check the custom function called from -tableView:cellForRowAtIndexPath: and ensure the string is not nil.
Related
I have run into some kind of crash, here is the crash stack:
WebCore 0x353c81b4 WebCore::PageCache::markPagesForFullStyleRecalc(WebCore::Page*) + 20
WebKit 0x36a6a45f -[WebView(WebPrivate) _initWithFrame:frameName:groupName:usesDocumentViews:] + 139
WebKit 0x36a6a3cd -[WebView initWithFrame:frameName:groupName:] + 53
WebKit 0x36a6a393 -[WebView initWithFrame:] + 47
UIKit 0x37251bfb -[UIWebDocumentView initWithWebView:frame:] + 287
UIKit 0x372828d1 -[UIWebBrowserView initWithWebView:frame:] + 57
UIKit 0x37282891 -[UIWebDocumentView initWithFrame:] + 41
UIKit 0x37282809 -[UIWebBrowserView initWithFrame:] + 49
UIKit 0x37437d73 -[UIWebView _webViewCommonInitWithWebView:scalesPageToFit:shouldEnableReachability:] + 235
UIKit 0x374385a9 -[UIWebView initWithFrame:] + 81
SeMob 0x001c216d -[SeMobWebInternalView initWithFrame:] (SeMobWebInternalView.m:64)
SeMob 0x001e7761 -[SeMobWebReader prepareReaderInWebView:] (SeMobWebReader.m:102)
SeMob 0x000eeb0d -[SeMobWebView webViewDidFinishLoad:] (SeMobWebView.m:1475)
CoreFoundation 0x346979c4 __invoking___ + 68
CoreFoundation 0x345eefeb -[NSInvocation invoke] + 287
CoreFoundation 0x345eeb43 -[NSInvocation invokeWithTarget:] + 51
WebKit 0x36a6189b -[_WebSafeForwarder forwardInvocation:] + 375
CoreFoundation 0x3469661b ___forwarding___ + 627
CoreFoundation 0x345edf68 __forwarding_prep_0___ + 24
CoreFoundation 0x346979c4 __invoking___ + 68
CoreFoundation 0x345eefeb -[NSInvocation invoke] + 287
WebCore 0x354197eb _ZL11SendMessageP12NSInvocation + 27
WebCore 0x35456fa5 _ZL20HandleDelegateSourcePv + 81
CoreFoundation 0x34669683 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
CoreFoundation 0x34668ee9 __CFRunLoopDoSources0 + 213
CoreFoundation 0x34667cb7 __CFRunLoopRun + 647
CoreFoundation 0x345daebd CFRunLoopRunSpecific + 357
CoreFoundation 0x345dad49 CFRunLoopRunInMode + 105
GraphicsServices 0x353432eb GSEventRunModal + 75
UIKit 0x37220301 UIApplicationMain + 1121
SeMob 0x000d48a7 main (main.m:12)
and two pieces of code:
- (void)prepareReaderInWebView:(UIWebView *)webView
{
// ...omit some code here
if ([readableContent length]) {
self.innerWebView = [[[SeMobWebInternalView alloc] initWithFrame:webView.bounds] autorelease];
innerWebView.scalesPageToFit = NO;
innerWebView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
innerWebView.scrollView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.3];
innerWebView.scrollView.scrollsToTop = YES;
innerWebView.delegate = self;
...
}
#interface SeMobWebInternalView : UIWebView
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
UIMenuItem *flag =
[[UIMenuItem alloc] initWithTitle:#"search" action:#selector(search:)];
...
}
the crash always occers in the super's init method. Why it always crash? Plz help me !
Apple documentation says that UIWebView should not be subclassed:
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebView_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006950-CH3-DontLinkElementID_2
Check subclassing notes.
As #cosmin stated your not meant to subclass UIWebView, from your code it looks like your trying to customize the appearance. try this code instead:
webView.backgroundColor = [UIColor clearColor]; // changes to clear colour
webView.opaque = NO;
for(UIView *innerView in [[[webView subviews] objectAtIndex:0] subviews]) { // Hide images that make shadow
if ([innerView isKindOfClass:[UIImageView class]]) {
innerView.hidden = YES;
}
}
My application crashing ans showing following in console. How to remove this exception???
2011-11-25 17:47:56.519 ShowroomLocator[1482:707] -[ShowroomLocatorViewController length]: unrecognized selector sent to instance 0x164860
2011-11-25 17:47:56.541 ShowroomLocator[1482:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '- [ShowroomLocatorViewController length]: unrecognized selector sent to instance 0x164860'
*** Call stack at first throw:
(
0 CoreFoundation 0x308aa64f __exceptionPreprocess + 114
1 libobjc.A.dylib 0x3400bc5d objc_exception_throw + 24
2 CoreFoundation 0x308ae1bf -[NSObject(NSObject) doesNotRecognizeSelector:] + 102
3 CoreFoundation 0x308ad649 ___forwarding___ + 508
4 CoreFoundation 0x30824180 _CF_forwarding_prep_0 + 48
5 UIKit 0x35dcfed1 - [UITableView(UITableViewInternal) _delegateWantsHeaderForSection:] + 228
6 UIKit 0x35dcf2db -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] + 78
7 UIKit 0x35dcf225 -[UITableViewRowData numberOfRows] + 72
8 UIKit 0x35dcec73 -[UITableView noteNumberOfRowsChanged] + 82
9 UIKit 0x35dce7f7 -[UITableView reloadData] + 582
10 HettichShowroomLocator 0x00003487 - [ShowroomLocatorViewController viewWillAppear:] + 50
11 UIKit 0x35dbf1d9 -[UIViewController viewWillMoveToWindow:] + 64
12 UIKit 0x35d9e179 -[UIView(Hierarchy) _willMoveToWindow:withAncestorView:] + 132
13 UIKit 0x35d83a59 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 228
14 UIKit 0x35d8396b -[UIView(Hierarchy) addSubview:] + 22
15 UIKit 0x35db335f -[UIWindow addRootViewControllerViewIfPossible] + 202
16 UIKit 0x35daf333 -[UIWindow _setHidden:forced:] + 182
17 UIKit 0x35db328f -[UIWindow _orderFrontWithoutMakingKey] + 18
18 UIKit 0x35dc1c61 -[UIWindow makeKeyAndVisible] + 16
19 ShowroomLocator 0x0000285b - [ShowroomLocatorAppDelegate application:didFinishLaunchingWithOptions:] + 162
20 UIKit 0x35db3821 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 772
21 UIKit 0x35dadb65 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 272
22 UIKit 0x35d827d7 -[UIApplication handleEvent:withNewEvent:] + 1114
23 UIKit 0x35d82215 -[UIApplication sendEvent:] + 44
24 UIKit 0x35d81c53 _UIApplicationHandleEvent + 5090
25 GraphicsServices 0x35a56e77 PurpleEventCallback + 666
26 CoreFoundation 0x30881a97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
27 CoreFoundation 0x3088383f __CFRunLoopDoSource1 + 166
28 CoreFoundation 0x3088460d __CFRunLoopRun + 520
29 CoreFoundation 0x30814ec3 CFRunLoopRunSpecific + 230
30 CoreFoundation 0x30814dcb CFRunLoopRunInMode + 58
31 UIKit 0x35dacd49 -[UIApplication _run] + 372
32 UIKit 0x35daa807 UIApplicationMain + 670
33 ShowroomLocator 0x0000278b main + 70
34 ShowroomLocator 0x00002740 start + 40
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.2 (8H7)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found).
(gdb)
After adding SearchDisplayController with _tableview1 my application started crashing.
I have two tableview in same controller class. Pleas suggest something to handle this...
Edited with multiple tableview coding:
- (void)viewDidLoad {
appDelegate = (ShowroomLocatorAppDelegate *)[[UIApplication sharedApplication] delegate];
NSArray *items = [[NSArray alloc] initWithObjects:
#"Sydney Airport (SYD), Mascot NSW 2020, Australia",
#"Sydney NSW, Australia'",
#"Smithfield NSW 2164, Australia",
#"Smithfield SA 5114, Australia",
#"Smithfield QLD 4878, Australia",
nil];
self.allItems = items;
[items release];
self._tableView1.scrollEnabled = YES;
_tableView1.hidden = YES;
_tableView.hidden = YES;
[self._tableView reloadData];
self._tableView.rowHeight = 80.0;
[ self.view addSubview:_tableView] ;
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView1.delegate = self;
_tableView1.dataSource = self;
}
- (void)viewWillAppear:(BOOL)animated
{
[self._tableView reloadData];
[self._tableView1 reloadData]; }
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
if(tableView ==_tableView && tableView ==_tableView1 )
{
return 1;
}
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
if(tableView ==_tableView )
{
if(section == 0)
return [NSString stringWithFormat:NSLocalizedString(#"ShowRooms[%d]", #"Showroom format"), [appDelegate.markers count]];
}
}
// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableview numberOfRowsInSection:(NSInteger)section {
if(tableview ==_tableView )
{
return [appDelegate.markers count];
}
if(tableview ==_tableView1 )
{ NSInteger rows = 0;
if ([_tableView1
isEqual:self.searchDisplayController.searchResultsTableView]){
rows = [self.searchResults count];
}
else{
rows = [self.allItems count];
}
return rows;
}
}
In my _tableview web-service data get fill and _tableview1 array data with address get fill.....
The above error is coming on adding _tableview1.....
I suspect, in viewWillAppear, you did a reloadData specifying self rather than self.tableView.
I am trying to implement a tab bar controller, navigation controller and tableview into an application I'm working on but I am getting a SIGABRT error each time I try to run it and I don't know why and it is rather puzzling me. Below is the code that the console is referencing to (I believe):
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
// Set up the cell...
NSString *cellValue = [listOfCoffees objectAtIndex:indexPath.row];
cell.textLabel.text = cellValue;
return cell;
}
...and below is the console:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString tableView:cellForRowAtIndexPath:]: unrecognized selector sent to instance 0x6a17c00'
*** Call stack at first throw:
(
0 CoreFoundation 0x00dca5a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f1e313 objc_exception_throw + 44
2 CoreFoundation 0x00dcc0bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x00d3b966 ___forwarding___ + 966
4 CoreFoundation 0x00d3b522 _CF_forwarding_prep_0 + 50
5 UIKit 0x00091b98 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 634
6 UIKit 0x000874cc -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 75
7 UIKit 0x0009c8cc -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1561
8 UIKit 0x0009490c -[UITableView layoutSubviews] + 242
9 QuartzCore 0x016b4a5a -[CALayer layoutSublayers] + 181
10 QuartzCore 0x016b6ddc CALayerLayoutIfNeeded + 220
11 QuartzCore 0x0165c0b4 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 310
12 QuartzCore 0x0165d294 _ZN2CA11Transaction6commitEv + 292
13 QuartzCore 0x0165d46d _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 99
14 CoreFoundation 0x00dab89b __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 27
15 CoreFoundation 0x00d406e7 __CFRunLoopDoObservers + 295
16 CoreFoundation 0x00d091d7 __CFRunLoopRun + 1575
17 CoreFoundation 0x00d08840 CFRunLoopRunSpecific + 208
18 CoreFoundation 0x00d08761 CFRunLoopRunInMode + 97
19 GraphicsServices 0x010021c4 GSEventRunModal + 217
20 GraphicsServices 0x01002289 GSEventRun + 115
21 UIKit 0x0002ac93 UIApplicationMain + 1160
22 Affogato 0x00002259 main + 121
23 Affogato 0x000021d5 start + 53
24 ??? 0x00000001 0x0 + 1
)
terminate called throwing an exception
Any help would be greatly appreciated.
I'm quite sure the actual problem is somewhere else in the code, my guess would be you are using some string variable (possibly selectedCoffee ?) in place of the tableView's delegate.
The error is in the tableview delegate/datasource. CellForRowAtIndexPath is called by the tableview to query it's UITableViewCell object. Check your delegate/datasource connection.
Set a breakpoint and look where the app crash. Then we could help more.
Hell All,
I am new to iPhone and struggling with following problem.
When i remove scroll view with following statement my appli crashes.
[scrollView removeFromSuperview];
I am adding uiscrollview with following line.
[self.view addSubview:scrollView];
Hereis the log.
Thread 0 Crashed:
0 libobjc.A.dylib 0x34a80466 objc_msgSend + 18
1 UIKit 0x341aaaa8 -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 152
2 UIKit 0x341aaace -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 190
3 UIKit 0x341aaace -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 190
4 UIKit 0x341c05a0 -[UIView(Hierarchy) removeFromSuperview] + 208
5 UIKit 0x34249a76 -[UIScrollView removeFromSuperview] + 42
6 KabushikiShimbun 0x000387b6 -[PDFPageScrollViewController ReGenerateScrollViewAsperNewData] (PDFPageScrollViewController.m:1451)
7 KabushikiShimbun 0x00038aac -[PDFPageScrollViewController CheckPageUpdationWithDate:] (PDFPageScrollViewController.m:1441)
8 KabushikiShimbun 0x0003c472 -[PDFPageScrollViewController requestFinished:] (PDFPageScrollViewController.m:792)
9 CoreFoundation 0x35818bb8 -[NSObject(NSObject) performSelector:withObject:] + 16
10 KabushikiShimbun 0x0000e9ba -[ASIHTTPRequest reportFinished] (ASIHTTPRequest.m:1945)
11 CoreFoundation 0x35818bb8 -[NSObject(NSObject) performSelector:withObject:] + 16
12 Foundation 0x3118178e __NSThreadPerformPerform + 262
13 CoreFoundation 0x358307d6 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 6
14 CoreFoundation 0x358025b0 __CFRunLoopDoSources0 + 376
15 CoreFoundation 0x35801e54 __CFRunLoopRun + 224
16 CoreFoundation 0x35801c80 CFRunLoopRunSpecific + 224
17 CoreFoundation 0x35801b88 CFRunLoopRunInMode + 52
18 GraphicsServices 0x320c84a4 GSEventRunModal + 108
19 GraphicsServices 0x320c8550 GSEventRun + 56
20 UIKit 0x341dc322 -[UIApplication _run] + 406
21 UIKit 0x341d9e8c UIApplicationMain + 664
22 KabushikiShimbun 0x00002da6 main (main.m:14)
23 KabushikiShimbun 0x00002d70 start + 32
Any Idea ?
Thank you.
Check whether it has a superview before removing from superview;
if([scrollView superview]!=nil){
[scrollView removeFromSuperview];
}
Try this code
for(UIView *view in self.view.subviews)
{
if([view isMemberOfClass:[UIScrollView class]])
{
[scrollview removeFromSuperView];
}
}
Try this code. It's tested.
NSArray *subviews = [[NSArray alloc] initWithArray:self.view.subviews];
for(UIScrollView *subview in subviews) {
[subview removeFromSuperView];
}
[subviews release];
but be carefull it removes all ScrollViews present in your self.view
So, I'm debugging an app I'm building and using the description method to help me find the problem. But instead of giving me the app as a string it is printing out parentheses instead. Please help!
Here's the code:
- (void)viewDidLoad {
[super viewDidLoad];
reminders = [[NSMutableArray alloc] init];
currentTitle = [[NSMutableString alloc] init];
currentDate = [[NSMutableString alloc] init];
currentSummary = [[
NSMutableString alloc] init];
currentLink = [[NSMutableString alloc] init];
NSLog(#"IT'S HERE %#", [reminders description]);}
...
and the error:
[Session started at 2010-10-04 22:15:16 -0400.]
2010-10-04 22:15:17.434 Reminders[5824:207] ******* Accessibility Status Changed: On
2010-10-04 22:15:17.464 Reminders[5824:207] ********** Loading AX for: com.yourcompany.Reminders ************
2010-10-04 22:15:17.506 Reminders[5824:207] IT'S HERE (
)
2010-10-04 22:15:17.510 Reminders[5824:207] Hello
2010-10-04 22:15:17.512 Reminders[5824:207] (
)
2010-10-04 22:15:17.514 Reminders[5824:207] PVC: <UITableView: 0x602d600; frame = (0 20; 320 460); clipsToBounds = YES; opaque = NO; autoresize = W+H; layer = <CALayer: 0x5f3f3b0>; contentOffset: {0, 0}>
2010-10-04 22:15:17.514 Reminders[5824:207] It's here
2010-10-04 22:15:17.515 Reminders[5824:207] Loaded
2010-10-04 22:15:17.520 Reminders[5824:207] -[__NSCFArray name]: unrecognized selector sent to instance 0x6a4b640
2010-10-04 22:15:17.523 Reminders[5824:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFArray name]: unrecognized selector sent to instance 0x6a4b640'
*** Call stack at first throw:
(
0 CoreFoundation 0x0248bb99 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x025db40e objc_exception_throw + 47
2 CoreFoundation 0x0248d6ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x023fd2b6 ___forwarding___ + 966
4 CoreFoundation 0x023fce72 _CF_forwarding_prep_0 + 50
5 Reminders 0x00003aa9 -[RootViewController tableView:cellForRowAtIndexPath:] + 300
6 UIKit 0x00090d6f -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 619
7 UIKit 0x00086e02 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 75
8 UIKit 0x0009b774 -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1561
9 UIKit 0x000937ec -[UITableView layoutSubviews] + 242
10 QuartzCore 0x03f60481 -[CALayer layoutSublayers] + 177
11 QuartzCore 0x03f601b1 CALayerLayoutIfNeeded + 220
12 QuartzCore 0x03f592e0 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 302
13 QuartzCore 0x03f59040 _ZN2CA11Transaction6commitEv + 292
14 UIKit 0x0002204e -[UIApplication _reportAppLaunchFinished] + 39
15 UIKit 0x00022477 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 545
16 UIKit 0x0002c3ec -[UIApplication handleEvent:withNewEvent:] + 1958
17 UIKit 0x00024b3c -[UIApplication sendEvent:] + 71
18 UIKit 0x000299bf _UIApplicationHandleEvent + 7672
19 GraphicsServices 0x026fa822 PurpleEventCallback + 1550
20 CoreFoundation 0x0246cff4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
21 CoreFoundation 0x023cd807 __CFRunLoopDoSource1 + 215
22 CoreFoundation 0x023caa93 __CFRunLoopRun + 979
23 CoreFoundation 0x023ca350 CFRunLoopRunSpecific + 208
24 CoreFoundation 0x023ca271 CFRunLoopRunInMode + 97
25 UIKit 0x00021c6d -[UIApplication _run] + 625
26 UIKit 0x0002daf2 UIApplicationMain + 1160
27 Reminders 0x00002078 main + 102
28 Reminders 0x00002009 start + 53
)
terminate called after throwing an instance of 'NSException'
Here's the method that you asked for fluchtpunkt
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = #"cell";
cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell.
Reminder *theReminder = [reminders objectAtIndex:indexPath.row];
cell.textLabel.text = theReminder.name;
return cell;
}
those parentheses are the output I would expect if I NSLog an empty array.
This is absolutely correct.
the exception is raised because you try to call a name method on an NS(Mutable)Array. And arrays don't respond to name.
To find the cause of this Exception post the code of this method in your RootViewController
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath