Wednesday, October 5, 2011

Xcode and the broken pipe

Ok, today there are some items which we're going to tackle which are relatively minor. First, I want to take the JLPT level out of the starting title - it might be confusing to the users. Secondly, I would like to display a simple welcoming dialog, just saying thanks and you can change the level, maybe a couple of other things. Third, I'm getting wraps in the middle of a word on the english definitions. Fourth I'm getting a funny message when I run it on the iPod, I want to get rid of that.

Starting with that last, here is the message:

Error starting executable 'JlptQuizApp'

putpkt: write failed: Broken pipe

I can get rid if it in the simulator by resetting it, but why should I have to do that? Why does it keep coming back? Also, I'm getting on on the iPod.

Here's how one posting from SO that says how to fix it:

That's essentially an internal error in Xcode's ability to talk to your phone. It doesn't mean you've done anything wrong, it's a bug in the development system. It'll go away after quitting and restarting Xcode, and possibly after restarting your Mac. I haven't seen the error in a while-- it's possible that other voodoo like removing the app from the phone may be necessary.


Ok, I've restart my iPhone, and restarted XCode. Let's try it.

Good - it seems to have gotten rid of it. Let's hop it stays that way.

Ok, let's get rid of the title on the start page.

Well, we'll just change that one to show the level:

// build the title
NSMutableString *temp1 = [[NSMutableString alloc] initWithString:@"Level "];
NSInteger jlptLevel = [Utils getJlptLevel];
NSString *temp2 = [NSString stringWithFormat:@"%d", jlptLevel];
[temp1 appendString:temp2];
self.title = temp1;


I'm getting kind of concerned because I'm getting a blank screen sometimes, which means it's not initializing the questions, I guess.

How do I get it to repeat that?

I wonder if I delete the app if it clears the settings. Let's try that.

Right. When I first start the app, if I go directly to settings, I get an error that the end quiz number is zero if I try to save the settings, even if it's 10. This is because it's checking it against the wrong value,

[appState.questionDict count]


which hasn't even been initialized yet.

Instead, it should be getting it directly from the database. Fortunately, I've already set up a method for this:

-(NSInteger) getLastWordNum:(NSInteger) level;


Uhf. I'm getting into the twisted validation logic again. Wait, I can just use the current setting selected from the widget which only shows valid values for the jlpt level. What's that logic for getting the value?

Ok, this is better:



else if (endNumInt > [Utils getNumberOfWordsForLevel:self.jlptLevel] ) {



Ok, that seems to be working ok. That's it for now.

No comments:

Post a Comment