小编Hee*_*ena的帖子

在iPhone App中寻找无法在AVAudioPlayer中运行的功能?

我正在使用下面的代码,但当我滑动滑块时,它调用updateTime方法,但卡在player.currentTime而不是进一步播放

On single sliding of slider it gets stuck

-(IBAction)slide
{
    [player setCurrentTime:slider.value];
    //NSLog(@"slider value in slide : %f",[slider value]);

}

    -(void) updateTime:(NSTimer *)timer
    {
        slider.value = player.currentTime;
        //NSLog(@"player current time in update time : %f",[player currentTime]);
       }

    - (IBAction)play:(id)sender {

        NSError *error;
        NSURL *url  = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Sing_for_me.mp3" ofType:nil]];
        player = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error];
        if(!player) NSLog(@"Error : %@",&error);
        [player prepareToPlay];
        slider.continuous=YES;

        slider.maximumValue = [player duration];
        //NSLog(@"player duration : %f",[player duration]);
       // NSLog(@"slider duration : %f",slider.value);
        //NSLog(@"player current …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c avaudioplayer ios4 ios

6
推荐指数
0
解决办法
5611
查看次数

如何在c#中将多个DataTable存储到单个DataSet中?

我有下面的代码有多个带有结果的DataTables,我需要传递一个包含所有DataTable值的DataSet.

MySqlCommand cmd = new MySqlCommand(getLikeInfo, con);
MySqlDataAdapter da = new MySqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);

MySqlCommand cmd1 = new MySqlCommand(getKnowInfo, con);
MySqlDataAdapter da1 = new MySqlDataAdapter(cmd1);
DataTable dt1 = new DataTable();
da1.Fill(dt1);

MySqlCommand cmd2 = new MySqlCommand(getHotelInfo, con);
MySqlDataAdapter da2 = new MySqlDataAdapter(cmd2);
DataTable dt2 = new DataTable();
da2.Fill(dt2);

MySqlCommand cmd3 = new MySqlCommand(getRoomInfo, con);
MySqlDataAdapter da3 = new MySqlDataAdapter(cmd3);
DataTable dt3 = new DataTable();
da3.Fill(dt3);

MySqlCommand cmd4 = new MySqlCommand(getFoodInfo, con);
MySqlDataAdapter da4 = new MySqlDataAdapter(cmd4); …
Run Code Online (Sandbox Code Playgroud)

c# datatable dataset c#-4.0

6
推荐指数
1
解决办法
3万
查看次数

c# - 当文本框为空时,如何在文本框中设置文本以显示提示?

我使用的<asp:TextBox>不是HTML文本框,我想显示提示文本.

有没有办法实现这一目标?

我已经尝试制作静态文本并将其着色为灰色,但是当光标聚焦到该文本框时却没有得到如何使其变空.

c# asp.net textbox c#-4.0

6
推荐指数
3
解决办法
2万
查看次数

iphone:如何以编程方式在导航项目中设置UISegmentedCotrol?

我需要在编程UISegmentedControl上实现导航项目,因为我do not have XIB for that.

导航项目已经有了title,left bar buttonright bar button 我可以把它放在之间left bar buttontitle

另外,我如何以语法方式向该控件提供事件?

我使用了以下代码:

segImport = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"Own",@"Imported",nil]];
                 [segImport setFrame:CGRectMake(80, 0, 200, 30)];
    [segImport setSegmentedControlStyle:UISegmentedControlStyleBar];
Run Code Online (Sandbox Code Playgroud)

iphone objective-c uisegmentedcontrol ios4

1
推荐指数
1
解决办法
3343
查看次数

如何在iPhone上更改UISwitch上的文字?

我需要更改UISwitch上的文本,为此我尝试了下面的代码,

((UILabel *)[[[[[[_agreeAgb subviews] lastObject] subviews] objectAtIndex:2] subviews] objectAtIndex:0]).text = @"Foo";
((UILabel *)[[[[[[_agreeAgb subviews] lastObject] subviews] objectAtIndex:2] subviews] objectAtIndex:1]).text = @"Bar";
Run Code Online (Sandbox Code Playgroud)

但它崩溃了 objectAtIndex

除了制作定制的UISwitch之外,还有其他方法吗?

iphone uiswitch ios4

1
推荐指数
1
解决办法
3344
查看次数