There are two general approaches to multiple languages in an application:First, the process to provide users with their own choice of opportunity;Nsarray *languages = [Nslocale preferredlanguages];NSString *currentuselanguage = [languages objectatindex:0];Second, according to the current user's current mobile device language automatically switch our app to the corresponding language.The first approach is relatively simple entirely by their own play, here is mainly about the second approach, the
. Delete plist contentAs with the idea of adding, it is also the first operation of a mutable array, deleting the contents of a location, then storing the variable group in its original location, and then re-reading the display: VIEWCONTROLLER.M file //delete plist content [Self.listdata removeobjectatindex:2]; [Self.listdata writetofile:path atomically:yes];//Write file array = nil; Array = [[Nsarray alloc] initwithcontentsoffile:path];//re -acquires NSLog (@ "%@", array);
Sqlite3 is an open-source, embedded relational database with good portability, ease of use, and small memory overhead sqlite3 is untyped, meaning that you can save any type of data to any field in any table.For example, the following statement is valid: CREATE TABLE T_person (name, age); • To ensure readability, it is recommended that you add the field type: Create TABLE T_person (name text, age integer);sqlite3 Common 5 Types of data: text, Integer, float, Boolean, blob in
, and the system ignores other related settings.If you simply need to rewrite the action to do some other work, you need to customize a Leftbarbuttonitem because the system-defined Leftbarbuttonitem has a higher priority than Backbarbuttonitem, When Leftbarbuttonitem is present, the Backbarbuttonitem is automatically ignored and the purpose of rewriting the backbarbuttonitem is achieved. Watch out.Generally we take the item on the navigation controll
IOS background operating mechanism and actionWhen you press the "Home" key or the system starts another application, the foreground application first switches to the Inactive state and then to the Background state. This conversion will result in successively calling the applicationWillResignActive: And applicationDidEnterBackground: Methods of the application proxy.In applicationDidEnterBackground: After the method is returned, most applications will
through, such as Get verification code, login, upload avatar, query personal data. In fact, just enter the verification code to complete the test. The input box needs to be used so that the program can continue to execute. Use a third-party pop-up input box Stalertview, which has been set up earlier.How to use Stalertview: Self. Stalertview= [[Stalertview alloc]initwithtitle:@ "Verification Code"MessageNilTextfieldhint:@ "Please enter your phone verification code"Textfieldvalue:NilCance
if(Y-tempy//slide from top down}Else if(Y-tempy>movey) {popupwindow.showatlocation (V, Gravity.bottom,0,0); } Break; }return true; }Some basic points of knowledge (N2)1. How do I control the location of the pop?Popupwindow.showatlocation ();If you just set the below space, you only need topopupWindow.showAsDropDown(控件);Left:popupWindow.showAtLocation(v, Gravity.NO_GRAVITY, location[0]-popupWindow.getWidth(), location[1]);Right:popupWindow.showAtLocation(v, Gravity.NO_GRAVITY, loc
number to achieve response-(void) Actionsheet: (Uiactionsheet *) Actionsheet Clickedbuttonatindex: (Nsinteger) buttonindex{NSLog (@ "Buttonindex =%li", (long) buttonindex);} -(Ibaction) Testalertview: (ID) Sender {//warning box described above//delegate parameter is used to set the warning window of the delegate object Uialertview *alertview = [[Uiale Rtview alloc] initwithtitle:@ "alert" message: @ "Alert text goes Here"
) Touchesshouldcancelincontentview: (UIView *) view is to send tracking before, first function this method.At the end of the ScrollView initialization, there are several properties to be set:No send scrolling notifications but even if the fingers move scroll will not move. YES Send notification scroll can move [Myscrollview Setcancancelcontenttouches:yes]; [Myscrollview Setbounces:no]; NO immediately notify TouchesShouldBegin:withEvent:inContentView to see if rolling scroll [Mysc
1.Dispatch_after (Dispatch_time (Dispatch_time_now, (int64_t) (2 * nsec_per_sec)), Dispatch_get_main_queue (), ^{The code to execute});Nsec_per_sec represents the number of seconds, and it also provides the nsec_per_msec for milliseconds.The true meaning of the above sentence is that after 2 seconds the task is added to the queue, not the execution after 2 seconds, most of the time the function can achieve our expectations, only in the case of very accurate timing requirements can be problematic
1. Determine whether an object is of a certain type: (The parent class will also return Yes)class ]2. Determine whether an object is an instantiated object of a class (the parent class does not return YES)class ]3. Determine if an agreement has been implementedConformstoprotocol: @protocol (nscopying)4. Determine if there is a method (can respond to this method)Respondstoselector: @selector (showmessage:)Dynamically generate a class5. Generate a class from a class namensstring *[email protected]
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.