开发者

A number box (jump from 0 to 9) in the view in iPhone . How should I do? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center开发者_运维问答. Closed 11 years ago.

I mean I have a UIImageView, and I want to put a number on it. And then the number jumps from 0 to 9.


I guess (you should definitely explain in more detail what you want to do) you want to display a number that is changing over time.

Suppose you have an UILabel which displays the number:

@interface MyViewController : UIViewController {
  UILabel *myNumberLabel;
}
@end

@implementation MyViewController
  - (id)init {
    if ((self = [super init])) {
      myNumberLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,0,50,50)]; //or some other rect..
      [self.view addSubView:myNumberLabel];
    }
    return self;
  }

  - (void)dealloc {
    [myNumberLabel release];
    [super dealloc];
  }

  - (void)updateNumber:(NSNumber*)number {
    [myNumberLabel setText:[number stringValue]];
  }
@end
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜