Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
arduinoのredparkケーブルからシリアルデータを取り込んでいます。データを x で区切った 12x13x14x15x16 の形式の文字列でデータを受信しています。入ってくるデータを別々に表示する方法を知りたいです。したがって、各値を個別に表示する 5 つのテキスト ボックスをアプリに配置できます。
あなたの質問が arduino や赤い公園のケーブルとはまったく関係がなく、実際には区切り文字に基づいて文字列を分割する方法についての質問であると仮定すると、必要なのは次のとおりです。
NSString *data = @"12x13x14x15x16"; NSArray *parts = [data componentsSeparatedByString:@"x"];
@"12"、@"13"などの 5 つの文字列を含む配列。
@"12"
@"13"