I'm new to iOS and have just started leaning it. I want to develop a small app for bus passengers where-in all users in the bus must login using the app.
我是iOS新手,刚刚开始学习它。我想为公交车乘客开发一个小应用程序,其中公交车的所有用户必须使用该应用程序登录。
If user is using the app for 1st time, he must sign up . User must enter all details like Name,Age,Emergency Contact,Address,Source,Destination,Phone number etc.
如果用户第一次使用该应用程序,他必须注册。用户必须输入所有详细信息,如姓名,年龄,紧急联系人,地址,来源,目的地,电话号码等。
If user already exist, then login with existing user name and password.
如果用户已存在,则使用现有用户名和密码登录。
All details must be stored somewhere (not sure) and retrievable format.
所有细节必须存储在某个地方(不确定)和可检索的格式。
Here comes all my question and doubts based on above app requirements :
基于以上应用程序要求,我的所有疑问和疑问都出现了:
- do i need to follow client-server architecture ?(mobile app being client )
- where all user details will be stored ( on mobile or server )
- when user tries to login, how check if user already exists or not ?
- if any communication protocol to be used for mobile app communication then which will be good considering the performance of app should be fast.
- mobiles internet data should be available ?
- which database to use to store user details ?
我需要遵循客户端 - 服务器架构吗?(移动应用程序是客户端)
将存储所有用户详细信息(在移动设备或服务器上)
当用户尝试登录时,如何检查用户是否已经存在?
如果任何用于移动应用程序通信的通信协议那么考虑到应用程序的性能将是很好的应该是快速的。
移动互联网数据应该可用吗?
用于存储用户详细信息的数据库?
considering all above things i need to design my app.
考虑到以上所有我需要设计我的应用程序。
thanks
1 个解决方案
#1
I will try to give some points to start from.
1) I think yes (its really depends what you want to achive but if you only want to get/pos resources to/from server, http request should be enough to start from).
2,6) Depends which details.
我会尝试给出一些要点。 1)我认为是(它真的取决于你想要实现的目标,但如果你只想获得/来自服务器的资源,http请求应该足以从中开始)。 2,6)取决于哪些细节。
- For simple details which no need in protection NSUserDefaults Sqlite or Core data can fit. (also there are some nice wrappers for them for instance TMcache, you will need to investigate it).
- If you need to save private details you will probably need to use keychain.(honestly I would avoid saving important details on the device everything can be hacked so try to limit it).
对于不需要保护的简单细节,NSUserDefaults可以使用Sqlite或Core数据。 (也有一些很好的包装器,例如TMcache,你需要调查它)。
如果您需要保存私人详细信息,您可能需要使用钥匙串。(老实说,我会避免在设备上保存重要的细节,一切都可以被黑客攻击,所以尽量限制它)。
3) One of the common ways which come to my mind is to check in run time if the user already logged in is by saving login status in NSUserdeFaults and check it in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
. If you need to check Existence of user in your system than probably some server help will be need.
3)我想到的一个常见方法是检查运行时是否已经登录的用户是通过在NSUserdeFaults中保存登录状态并将其签入 - (BOOL)应用程序:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary) *)launchOptions。如果您需要在系统中检查用户的存在,那么可能需要一些服务器帮助。
4) Please refer to apple Docummentation NSURLSession should fit.Also AFNetworking is really good library.
4)请参考苹果Docummentation NSURLSession应该适合。而且AFNetworking是非常好的库。
Edit:
5) Usually IOS will use Current Internet Connection which is available and more efficient for the system it will start with WIFI then CellularData (Check Reachability for testing availability of internet connection its also included in AFNetworking library) .
-All those questions/answers can be found on stack.Hope I helped.
List of common IOS frameworks
5)通常IOS将使用当前互联网连接,该系统可用于系统,它将从WIFI开始,然后是CellularData(检查可访问性以测试互联网连接的可用性,它也包含在AFNetworking库中)。 - 所有这些问题/答案都可以在堆栈上找到。希望我帮忙。常见的IOS框架列表
#1
I will try to give some points to start from.
1) I think yes (its really depends what you want to achive but if you only want to get/pos resources to/from server, http request should be enough to start from).
2,6) Depends which details.
我会尝试给出一些要点。 1)我认为是(它真的取决于你想要实现的目标,但如果你只想获得/来自服务器的资源,http请求应该足以从中开始)。 2,6)取决于哪些细节。
- For simple details which no need in protection NSUserDefaults Sqlite or Core data can fit. (also there are some nice wrappers for them for instance TMcache, you will need to investigate it).
- If you need to save private details you will probably need to use keychain.(honestly I would avoid saving important details on the device everything can be hacked so try to limit it).
对于不需要保护的简单细节,NSUserDefaults可以使用Sqlite或Core数据。 (也有一些很好的包装器,例如TMcache,你需要调查它)。
如果您需要保存私人详细信息,您可能需要使用钥匙串。(老实说,我会避免在设备上保存重要的细节,一切都可以被黑客攻击,所以尽量限制它)。
3) One of the common ways which come to my mind is to check in run time if the user already logged in is by saving login status in NSUserdeFaults and check it in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
. If you need to check Existence of user in your system than probably some server help will be need.
3)我想到的一个常见方法是检查运行时是否已经登录的用户是通过在NSUserdeFaults中保存登录状态并将其签入 - (BOOL)应用程序:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary) *)launchOptions。如果您需要在系统中检查用户的存在,那么可能需要一些服务器帮助。
4) Please refer to apple Docummentation NSURLSession should fit.Also AFNetworking is really good library.
4)请参考苹果Docummentation NSURLSession应该适合。而且AFNetworking是非常好的库。
Edit:
5) Usually IOS will use Current Internet Connection which is available and more efficient for the system it will start with WIFI then CellularData (Check Reachability for testing availability of internet connection its also included in AFNetworking library) .
-All those questions/answers can be found on stack.Hope I helped.
List of common IOS frameworks
5)通常IOS将使用当前互联网连接,该系统可用于系统,它将从WIFI开始,然后是CellularData(检查可访问性以测试互联网连接的可用性,它也包含在AFNetworking库中)。 - 所有这些问题/答案都可以在堆栈上找到。希望我帮忙。常见的IOS框架列表