2010-12-24 6 views
0

내가 뭘 잘못하고 있니? 시뮬레이터에서 실행할 때 randomNum 값이 표시되지 않습니다. (이미 IB에서 모든 것을 연결했습니다.)라벨의 임의 번호 - iPhone

.m file: 

randomNum=arc4random() % 100; 
randomNumLabel.text=randomNum; 

.h file: 
int randomNum; 
int guess; 
IBOutlet UITextField *numberField; 
IBOutlet UILabel *randomNumLabel; 

답변

2

당신은 NSStringstringWithFormat: 방법을 사용하여 숫자를 문자열로 변환해야합니다 : (편집 실제로이 프로그램은 지금 충돌).

randomNumLabel.text = [NSString stringWithFormat:@"%i", randomNum]; 
관련 문제