現在、DTMF トーンを変換し、UIImageview
. ただし、これを変更する方法が本当に必要なので、代わりに各 ImageView のコンテンツをUILabel
、生成された出力が画像ではなく文字列になるように置き換えます。これが理にかなっていることを願っています:
このタスクを担当する元のコードは次のとおりです。
- (void)setLCDString:(char*)content {
if (strlen(content) > LCD_COLS) {
content = content + (strlen(content)-LCD_COLS);
}
//NSLog(@"LCDString %d len",strlen(content));
UIImageView *disp[LCD_COLS] = {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o};
for (int in = 0; in < LCD_COLS; in++) {
//Here we start at 0, and if our INT is less than 24 (6x4) then we increase INT by 1.
[disp[in] setImage:[self charToImage:*content]];
//Here we set UIImageVIew to our INT, and convert Character to images.
if (*content) content++;
}
}
- (UIImage *)charToImage:(char) chr
{
if (isdigit(chr) || (chr == 'A') || (chr == 'B') || (chr == 'C') || (chr == 'D')
|| (chr == '*') || (chr == '#')) {
char name[10];
snprintf(name,10,"%c.png",chr);;
UIImage *img = [UIImage imageNamed:[NSString stringWithCString:name encoding:NSASCIIStringEncoding]];
return img;
}
return nil;
}
ここで、デコードによって文字列が個々の画像に変換されていることがわかりますが、UIImageView
これをテキストに置き換える必要がありUILabel
ます。
誰かが私たちを正しい方向に向けることができれば、それは大歓迎です.