The invention relates to a safe
parsing method for an IOS (Iphone
Operating System) dictionary. The method comprises the following steps that: inputting dictionary
parsing data: firstly, judging whether the dictionary
parsing data is a basic
data type or not, secondly, judging whether a default value is required or not, if the default value is required, storing the default value, then, judging whether an input value is empty or not, and carrying out further parsing when the input value is not empty; during further parsing, firstly, judging whether the input is a
category type or not, if the input is the
category type, further judging whether the
category type is in the presence or not, and otherwise, further judging whether a basic
data type function is in the presence or not; and when a judgment result shows that the category type and the basic
data type function are both in the presence, continuously carrying out parsing, i.e., calling a parsing
algorithm to convert the dictionary parsing data into OC data, outputting a parsing value if the dictionary parsing data is successfully converted into the OC data, if the dictionary parsing data fails to be converted into the OC data, judging whether the default value is in the presence or not, outputting the default value if the default value is in the presence, and otherwise, outputting a null value. By use of the method, when theOC data is obtained by parsing, reliability is good, safety is high, an App is effectively protected, the App is not influenced by wrong data, program
crash is effectively avoided, and data safety isimproved.