0

If i have a string like "Help, Support and More" in an NSArray which is content of an UITableView it crashes on startup. If i remove the whitespace after "," there is no Problem.

Is there any solution for this?

This crashes:

cell.textLabel.text = @"Help, Support and More"; 

This works:

cell.textLabel.text = @"Help,Support and More"; 

Here is more code:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; //cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; } // Configure the cell. NSLog(@"%@", [[sportstypes objectAtIndex: [indexPath row]] title]); cell.textLabel.text = @"Tes t:, ,,,,,"; //cell.textLabel.text = @"Blubber"; return cell; } 

FIX: Xcode 4.6.2 app crashes on every second run Thanks to ice_2

15
  • Can you please provide us with the code ? On which line it is crashing? Commented Jun 6, 2013 at 9:41
  • I added some code above. Commented Jun 6, 2013 at 9:43
  • 3
    what? Never.Show us your datasource code Commented Jun 6, 2013 at 9:45
  • What does the crash error say? Commented Jun 6, 2013 at 9:48
  • Is this code-snippet more helpful? Commented Jun 6, 2013 at 9:49

3 Answers 3

0

If you get error Thread 1: signal SIGABRT on every second launch. Please open the menu Product -> Scheme -> Edit Scheme, select Run YouAppName.app on the left, tab Info. Then choose GDB instead of LLDB in debugger field.

Seems to be a combination of OS X 10.8.4 and LLDB. As kenster says, switching to GDB makes the problem go away.

Sign up to request clarification or add additional context in comments.

4 Comments

This is all i got from GDB:GNU gdb 6.3.50-20050815 (Apple version gdb-1824) (Wed Feb 6 22:51:23 UTC 2013) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-apple-darwin".sharedlibrary apply-load-rules all Attaching to process 4202. Current language: auto; currently objective-c (gdb)
After this the app is dead.
what osx version you have?
i updated this morning to 10.8.4. I tried something, reverted it back and now the crash is no more reproduceable.
0

I think you are doing something wrong. Because your code is correct no problem in your code and second thing you can put any special character in double quot " ". It wont create any problem.

Comments

0

This may be because of memory issue.Make sure the array is not deallocated or removed anywhere.Enable zombie and run it so that you can recieve some log in the debugger console

Issue may be in this line

NSLog(@"%@", [[sportstypes objectAtIndex: [indexPath row]] title]); 

comment it and execute and see for yourself what happens

4 Comments

I do not use ARC. Could this be the problem, that i have a hugh amount of zombies around?
does the word "Zombie" sound like it is a good idea to collect them?
I do not collect them, but my question was if it could be the main problem that i do not use ARC?
did you comment the line in the answer and execute?Still it shows the crash?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.