Adding a “close” button to Three20 TTWebController - iPhone?

Probably what you actually want is your own view controller, that either inherits from or contains a TTWebController. Create and map to that instead of the raw TTWebController put the button wherever you like and wire up the on touch up inside to self dismissModalViewControllerAnimated:YES That should do the trick.

Probably what you actually want is your own view controller, that either inherits from or contains a TTWebController. Create and map to that instead of the raw TTWebController, put the button wherever you like and wire up the on touch up inside to self dismissModalViewControllerAnimated:YES; That should do the trick. EDIT: So now you have a custom web view of type myWebView that I am assuming inherits from TTWebController.

That's good. As an aside, you don't really need to initialize a new instance of it just to get the class, you can do that with just myWebView class because the class message is on the class, not the instance. However, even though you have decided to create a new instance using a xib, I don't think TTNavigator will be instantiating your controller instance in that same way.

Instead I believe it will launch with this constructor (extracted from TTWebController. M) - (id)initWithNavigatorURL:(NSURL*)URL query:(NSDictionary*)query { if (self = self init) { NSURLRequest* request = query objectForKey:@"request"; if (request) { self openRequest:request; } else { self openURL:URL; } } return self; } So, in your child implementation, you can provide a customized version of this implementation like so: - (id)initWithNavigatorURL:(NSURL*)URL query:(NSDictionary*)query { if (self = super initWithNavigatorURL:URL query:query) { // code that creates a button and puts it somewhere } return self; } I haven't tested it, I'd be interested in seeing what it actually is doing if it isn't doing that. If you prefer xibs (like me, unlike three20) then you'll need to do an extra step of loading that.

I have a category in my utility framework that helps with this: NSBundle+LoadNibView. H #import @interface NSBundle(LoadNibView) + (id) loadNibView:(NSString*)className; @end NSBundle+LoadNibView. M #import "NSBundle+LoadNibView.

H" @implementation NSBundle(LoadNibView) + (id) loadNibView:(NSString*)className { return NSBundle mainBundle loadNibNamed:className owner:nil options:nil objectAtIndex:0; } @end The objectAtIndex part is because all xibs contain an array, even if there is only one view inside. This will just return the first UIView in the xib.

I was using TTWebController because there doesn't seem to be a way to extract the URL and pass it to a another view. – Chris Jan 6 at 16:23 If I'm correct in understanding what you are doing, you've already setup the Navigator and the Map. TTNavigator passes the information for you.

– slf Jan 6 at 16:27 If you just want to extract the URL, I'm sure there are ways of doing that as well, but you'll need to post some more code – slf Jan 6 at 16:28 @Chris updated post with more detail – slf Jan 7 at 15:47 I added that to myWebView and it is receiving the URL. I've got other problems now ... thanks for your help. – Chris Jan 7 at 19:20.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions