简体   繁体   中英

Accessing text file content and character count very slow in iOS

I am working with a text file in iOS. The file size keeps increasing and reaches to 10 MB of size.The problem is accessing the content is becoming very slow.Is there any other way that I can speed up the process.Also, I want the total character length/count of the text files.Its running in the main thread.

NSString* content = [NSString stringWithContentsOfFile:path  usedEncoding:&encoding  error:NULL];

There is too many solution for your problem :

1- Reading file with more than 1MB

2- Reading file with more than 1MB

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM