iOS7 UIWebView Memory leak

后端 未结 2 715
灰色年华
灰色年华 2021-02-08 20:31

We have an comprehensive iOS app with Hybrid mode - a UIWebView hold the major part of the web application in JS. It works fine on iOS6, but recently we found serious out of mem

2条回答
  •  暖寄归人
    2021-02-08 21:11

    Both the UIWebView and the native safari browser with iOS7 seems to have a problem in memory management when handling json object. If you have a dictionary with a deep nested structure, and you happen to have one of the key to be a numeric string, and it is less than 99999, you might have received memory warnings frequently.

    something like,

     {"**98304**":
         {"key":
             {"2ndLevelKey":
                 {
                    "address":"10928 Homestead rd","city":"Cupertino","Zip":95014
                 }
             }
         }
     }
    

    The work around is simple, try to replace the key "98304" something like "ID98304". Hope you have tackled the problem already. :)

提交回复
热议问题