I have a NavigationController that hold ViewControllers, but I want that to access to some ViewControllers an authentification via an UIAlertView. (Some ViewControllers content need a authentification).

That UIAlertView will send data to a Webservice to check first if the login and password are correct and then receive back the datas + a token to store in the Iphone (like that you need to authenticate only once).

I'm going to check on each ViewControllers before access it, if the user already authenticate, by checking if the token is registered in the Iphone.

But I don't really know how can I figure out everything, I mean especially the architecture to make all the things working : UIAlertView, NSCredential, storing light data in the Iphone, etc...

Can anyone clear my mind ?

有帮助吗?

解决方案

Here is the link fullfilling your requirement

http://knowledgetransferinobjectivec.blogspot.in/2012/01/customized-uialertview-to-input.html

&

http://harikanangi.blogspot.in/2011/09/uialertview-extended-to-allow-users-to.html

The following link creates a custom alertview and allows the user to fill credentials . Using the didSelectButtonAtIndex delegate of UIAlertView you can catch the event when the user press ok or submit button . Hope it helps you

其他提示

Lookup UIAlertView delegate methods. You will be checking the button index that was pressed from those methods to fire a method of your choice. Don't forget to add the delegate.

UIViewController <UIAlertViewDelegate> 

UIAlertView usage

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top