Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 12-14-2009, 06:35 AM   #6 (permalink)
_sjc_
Registered Member
 
Join Date: Nov 2009
Location: London
Posts: 226
_sjc_ is on a distinguished road
Default

As far as adding the text field goes, I think adding an entire new view controller is probably the wrong way to go. You should be able to manage the whole process from the EAGLView -- since this is where most of your logic probably is, including whichever code tracks the games current state.

Since I don't know all the details of your project, this is really just a "thinking aloud" list of suggestions.

* Views are displayed in hierarchies. Your EAGLView is just another view in this respect. You'll probably want to add the UITextField as a subview under it. (You'll notice a degradation in performance when you do, but I'm guessing you won't be wanting to do much else while the user is entering their score.)

* Adding just the UITextFieldDelegate methods needed to the EAGLView controller shouldn't add much bloat to the code. You may only need to implement textFieldShouldReturn: and textFieldDidEndEditing:.

* So you'll need a "getPlayerName" method to create the textField, add it as a subview, and make it first responder (which makes the keyboard appear); an implementation of textFieldShouldReturn: to check the player entered something and if so, get the textfield to resign first responder (which dismisses the keyboard); and an implementation textFieldDidEndEditing: to remove and destroy the textfield and do something with the input.

Like I said, this is just a rough outline of the approach I would take.
__________________
SimCap - Simple iPhone and iPad Simulator screen capture
_sjc_ is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,389
Threads: 94,004
Posts: 402,463
Top Poster: BrianSlick (7,978)
Welcome to our newest member, HenryCLacey
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:11 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.