Whereami hangs after textFieldShouldReturn


#1

Howdy all;

I have liberally studded my methods with NSLogs all the better to watch my whereami app flow.

App launches, shows what it needs to show, I touch the txt field, add text, and hit done; keyboard dismissed. the activity indicator indicates indefinitely but the app does not progress at that point.

Based on my NSLog statements, [textField resignFirstResponder] is the last statement issued.

What should happen next, internally? Should didUpdateLocation get called?

Thompson


#2

Hi,

Yes that’s what “should” happen next but see if this post helps http://forums.bignerdranch.com/viewtopic.php?f=47&t=613

Gareth


#3

Gareth;

I am already using that code as I am on 4.2.1. It gets called earlier in the run (when the app 1st inits and places the blue dot).

Is it possible in the Xcode debugger to view the next-responder to see who the app thinks should be picking up?

Thompson


#4

Hi,

I don’t think you can see this in the debugger but you could insert some code

    UIResponder   *firstResponder = [[[UIApplication sharedApplication] keyWindow] performSelector:@selector(firstResponder)];
    NSLog(@"First Responder = %@",firstResponder);

After the textField has resigned firstResponder though our app is in the run loop waiting for the next event (user action, system event, notification etc).

So in this case we are just sat there waiting for an event to happen. We previously asked the locationManager to update the user location but this takes a few seconds and so a bit later we “should” get our didUpdateToLocation method firing or didFailWithError.

If that isn’t happening then try going through the other post I mentioned.

HTH
Gareth


#5

I must admit that this problem has defeated me. Line-for-line my app is the same as the book’s whereami (including also the updated 4.2.1 code from the forum). When I cut-and-past whereami.m into my app wholesale it runs fine, which shows that my delegating work in IB is accurate. I’m stumped, but I’m going to just go forward with the whereami.m code. So, for whatever reason, I have a working whereami app.

Thanks for your help
Thompson


#6

It would be nice if some one would at least provide some level of feedback or support on the issues that so many are reporting.

If the case is that the app does not work in the simulator, then at least it should be point out.

Frustrating.


#7

There is a sticky at the top of this forum to address the change in iOS 4.0 that affected this exercise. Other than that, there is a typo or issue in the XIB file that needs to be addressed.