As indicated in the post Apple iPhone SDK 3.0: first incompatibility of the Apple SDK 3.0 show different behaviors with respect to release 2.2.1. Support service for developers gave me the answer, and then the solution to the problem. . The answer was that the technical support [UIButton buttonWithType:] already called - inside - the initWithFrame . It follows that, according to the technical support, writing:
1 | [ [ UIButton buttonWithType : UIButtonTypeRoundedRect ] initWithFrame : CGRectMake ( 0 , 0 , 100 , 40 ) ] ; UIButton * myButton = [[UIButton buttonWithType: UIButtonTypeRoundedRect] initWithFrame: CGRectMake (0, 0, 100, 40)]; |
It invokes initWithFrame twice, resulting in the loss of the label text. Basically just replace the code above with:
1 2 | [ UIButton buttonWithType : UIButtonTypeRoundedRect ] ; UIButton * myButton = [UIButton buttonWithType: UIButtonTypeRoundedRect]; 0 , 0 , 100 , 40 ) ; myButton.frame CGRectMake = (0, 0, 100, 40); |
The original response:
1 2 3 | + [UIButton buttonWithType:] Already calls initWithFrame: for you. Calling it twice Causes That Erases internal information you see the problem with the disappearing text. Changes in the Code Revealed 3.0 bug. In your code, just say: UIButton restart_button * = [UIButton buttonWithType: UIButtonTypeRoundedRect]; restart_button.frame CGRectMake = (40,430,100,40); |










There are no comments for this post
Leave a comment