Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Buschmaster

macrumors 65816
Original poster
Feb 12, 2006
1,306
27
Minnesota
This one is funky...

I have a controller and a view.

The view contains a single textfield and several NSStrings.
The view will have the user enter the info and will store it in the NSStrings.
The view controller will then create a NSDictionary and send that to the delegate.

Anyway, all of that works fine and just to plan unless you use a space in the text field and in that case it crashes the app.

I tried something like this in the textFieldDidEndEditing:
Code:
myFirstNSStringValue = [[textField text] stringByReplacingOccurrencesOfString:@" " withString:@""];
As well as striping the white spaces just as a temporary fix until I can get past the spaces problem overall. But neither worked.

Any ideas?
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Sounds like there's something else is going on. What kind of crash is being generated?
 

Buschmaster

macrumors 65816
Original poster
Feb 12, 2006
1,306
27
Minnesota
Sounds like there's something else is going on. What kind of crash is being generated?
The only thing is that it works perfectly unless you use the spaces. I'll continue to test and see if there are other ways I can crash it or ways it'll work if I do use spaces.

The kind of crash is where the application just freezes and dies a painful death.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
Have you tried launching with the debugger? That'll usually show you the stack trace.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.