xcode - Reading file line by line in iOS SDK -
i have texfile follows:
line1 line2 line3 line4 line5 .... i want read file 2 arrays of string line1, line3, line 5,... go array1 , line 2, line 4, line 6,... go array2. each element of arrays stores 1 line.
step 1) read file ([nsstring stringwithcontentsoffile:encoding:error:] )
step 2) split string ([nsstring componentsseparatedbycharactersinset:[nscharacterset newlinecharacterset]] )
step 3) iterate on array , insert 2 arrays
Comments
Post a Comment