-4
变成真的,我想使标签具有文本,当标签变成文字,我想, 我想播放的声音只播放声音时条件的iOS
我的意思是一个时间我有一个按钮,点击时它检查标签文本,如果标签文本是我想要它播放声音的一个(声音时间不超过2秒)
这是接口部分(viewController。 h)
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
{
UILabel *label;
}
@property (nonatomic , strong) IBOutlet UILabel *label;
-(IBAction) checkLabelText:(UIButton *)sender;
@end
this the implementation section (viewController.m)
#import "viewController.h"
@implementation ViewController
@synthesize label
-(IBAction) checkLabelText:(UIButton *)sender
{
if([label.text isEqualToString:@"hi world"])
{
//i want the code of playing the sound here
}
}
@end
Whats your bug? –
你想要的代码? –
请提供更多详情。 –