2013-09-25 52 views
-4
-(IBAction)Back:(id)sender{ 

NSString *path = [NSString stringWithFormat:@"%@%@", 
[[NSBundle mainBundle] resourcePath], 
@"/Dtmf-star.wav"]; 

//declare a system sound id 
SystemSoundID soundID; 

//Get a URL for the sound file 
NSURL *filePath = [NSURL fileURLWithPath:path isDirectory:NO]; 

//Use audio sevices to create the sound 
AudioServicesCreateSystemSoundID((CFURLRef)filePath, &soundID); 

//Use audio services to play the sound 
AudioServicesPlaySystemSound(soundID); 
[Buttonback setImage: nil forState:UIControlStateNormal]; 

int size = [PhoneUrl length]; 
if (size>0) { 
    PhoneUrl = [PhoneUrl substringToIndex:size-1]; 
} 
dspText.text = PhoneUrl; 

} 

这个我done..i我能够删除一个数字,但如果有一个以上的数字应用程序中获取崩溃...... 它在工作正常iOS6的。点击时,在iOS 7我AAP碰撞后退按钮

+3

[没有足够的上下文。](http://apaczai.elte.hu/~13akga/content/emclstcd.php) – 2013-09-25 05:40:30

回答

0

除非您发布几乎完整的代码,否则这些问题实际上很难为我们解决。但是,将程序与监视内存的调试功能结合使用可能是一个好主意,因为您的问题很可能与此有关。

+0

我已经完成it.in console(int size = [PhoneUrl length];)在这一行我得到一个类似EXC_BAD_ACCESS的警告消息(代码= 1,地址= 6f)。它在这里没有任何事情发生。但它发生在我点击按钮时。 – apple10

+0

然后它确实是一个内存错误 –

+0

它的工作原理是我错分配dspText.text = PhoneUrl;因为它会崩溃。 – apple10