The invention discloses an instant messaging method for collaborative office of an IOS platform. The instant messaging method comprises the following steps: creating a tcp-based long connection; creating a user object and a chat room object; after the user passes the authentication, generating a user id, storing id information and a password, connecting a chat server, and obtaining organizational structure data; after the connection between the IOS platform and the chat server is successfully established, storing data, providing an access interface, packaging chat data through an XMPPMessage model, and sending the chat data to the chat server; intercepting the presence information, and storing the login date, version and login terminal model of the chat server user each time; when the chat server receives a new message or does not push a message and after the IOS platform establishes connection with the server, enabling the chat server to send the new message to the IOS platform, and calling a didReceiveMessage method to update and store a message record. According to the method, the problem of data persistence demand is solved, enterprise-level instant messaging is realized, an employee communication platform is established, the operation cost is reduced, and the office efficiency of enterprises is improved.