How to parse a string for an integer matrix in Objective C
Can someone help me extracting a 2D matrix of integers from a string like the one below in Objective C?
1 1 0 0 -1
-1 0 1 1 0
0 -1 0 开发者_运维百科1 0
0 0 -1 -1 1
The easiest way is probably to use an NSScanner object. See the Strings Programming Guide for further info.
精彩评论