在这项法典中,似乎睡觉发生在藏匿纽州之前。 为什么如此?
-(void)buttonPressed{
NSLog(@"Button pressed!");
button.hidden=true;
sleep(rand()%10);
NSLog(@"out of sleep!");
}
在这项法典中,似乎睡觉发生在藏匿纽州之前。 为什么如此?
-(void)buttonPressed{
NSLog(@"Button pressed!");
button.hidden=true;
sleep(rand()%10);
NSLog(@"out of sleep!");
}
隐蔽的设置立即发生,并触发了一条滚.的<条码>。 然后该方法睡觉。 然后在睡觉后,露骨会铺设,显示器具更新。 因此,在睡觉结束之前,睡觉才阻止放映。
我的猜测是,hidden
property是成功确定的,但该屏幕是经过更新的,因为你穿透了胎面。
随后将进行筛查更新。
I don t have any specific objective-c knowledge on this point - but it is a common case that UI is single threaded and that the update of your button state is put on a queue for execution. The call to sleep then suspends all current thread activity and therefore halts UI updating.
证券交易所基本上树立了旗帜,将使得控制权在万国证券交易所的下一个时间重新投放。 它立即取得成效,因为它通常会稍微推迟,以便各种家庭单元的复习能够共同进行。
如果你在躲藏你的ton子后想采取某些行动,那么,我建议打电话<条码>performSelector:有目标:继:。
How to use performSelector:withObject:afterDelay: with primitive types in Cocoa?
In general, you want to have the UI thread block as little as possible, as any blocking code (e.g. sleep) will cause the UI to lag, be generally unresponsive, or beach-ball (SPoD).
I ve got the problem when I tried to do asynchronous requests to server from background thread. I ve never got results of those requests. Simple example which shows the problem: @protocol ...
i have a void, like -(void) doSomething in a specific controller. i can call it in this controller via [self doSomething], but i don t know how to call this void from another .m file. I want to call ...
Is there any way to obfuscate Objective-C Code ? Thanks
Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...
I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...
I have a simple Core Data app which displays a list of entities in the main window. To create or add new entities, I use a second modal window with a separate managed object context so changes can be ...
I m trying to show a database information in a tableview and then the detailed information in a view my problem is as follow: I created a NSMutableArray: NSMutableArray *myArray = [[NSMutableArray ...
I am writing an iPhone application which requires the user to enter several values that may contain a decimal point (currency values, percentages etc.). The number of decimal places in the values ...