Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/112.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios iphone应用程序中字符串的幻灯片放映_Ios_Xcode_Ios4 - Fatal编程技术网

Ios iphone应用程序中字符串的幻灯片放映

Ios iphone应用程序中字符串的幻灯片放映,ios,xcode,ios4,Ios,Xcode,Ios4,在iphone应用程序的UILabel中,是否有任何方法可以对字符串数组进行幻灯片放映?(即,字符串将逐个显示)。有人请帮帮我。看 这可以让您每X秒重复一次回调。您可以使用它来交换数组中的字符串 [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(swapStrings:) userInfo:nil repeats:YES]; _myStrings = @[ @"a" , @"b", .....

在iphone应用程序的UILabel中,是否有任何方法可以对字符串数组进行幻灯片放映?(即,字符串将逐个显示)。有人请帮帮我。

这可以让您每X秒重复一次回调。您可以使用它来交换数组中的字符串

[NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(swapStrings:) userInfo:nil repeats:YES];

_myStrings = @[ @"a" , @"b", ..... ];

... 

- (void) swapStirings:(id)sender 
{
    myInt ++;
    if (myInt >= [_myStrings count]) myInt = 0;
    myLabel.text = [_myStrings objectAtIndex:myInt];
}

这可以让您每X秒重复一次回调。您可以使用它来交换数组中的字符串

[NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(swapStrings:) userInfo:nil repeats:YES];

_myStrings = @[ @"a" , @"b", ..... ];

... 

- (void) swapStirings:(id)sender 
{
    myInt ++;
    if (myInt >= [_myStrings count]) myInt = 0;
    myLabel.text = [_myStrings objectAtIndex:myInt];
}

不,没有。但是,好消息是,它的实施应该是微不足道的。我建议创建一个uilabel的子类,该子类有一个字符串数组作为ivar。子类有一个init方法,用于设置数组和时间间隔。然后,它使用nstimer更改其标签并重新显示自己。祝你好运

不,没有。但是,好消息是,它的实施应该是微不足道的。我建议创建一个uilabel的子类,该子类有一个字符串数组作为ivar。子类有一个init方法,用于设置数组和时间间隔。然后,它使用nstimer更改其标签并重新显示自己。祝你好运