我是iOS开发的新手,我有简单的目标--c类"MoneyTimer.m"用于运行计时器,从那里我想用更改的计时器值更新UI标签.我想知道如何从非UI线程访问UI元素?我正在使用Xcode 4.2和故事板.
在黑莓手机中,只需获取事件锁定即可从非UI线程更新UI.
//this the code from MyTimerClass
{...
if(nsTimerUp == nil){
nsTimerUp = [NSTimer scheduledTimerWithTimeInterval: 1.0 target:self selector:@selector(countUpH) userInfo:nil repeats: YES];
...}
(void) countUpH {
sumUp = sumUp + rateInSecH;
**//from here i want to update the UI label **
...
}
Run Code Online (Sandbox Code Playgroud) 有没有办法调节通过SKAction playSoundFileNamed播放的声音音量:waitForCompletion : .
我想在我的游戏中实现一个简单的音乐和声音效果滑块.我可以通过AVAudioPlayer轻松控制背景音乐,但所有音效都通过SKAction播放.
我试图在两个视图控制器之间传递NSMutableArray.请让我知道我能为此做些什么
在PlaylistViewController.h文件中我有
NSMutableArray *SongArray;
@property(nonatomic,retain)NSMutableArray *SongArray;
Run Code Online (Sandbox Code Playgroud)
我希望传递给另一个视图控制器