Tutorial details

Creating A Random Number Generator  | App Code for Sale | Preview

Creating A Random Number Generator | iOS Tutorial

How to create a random number generator

Overview PAGE TOP

Reference: http://www.geekylemon.com/WEBPROTECT-xcoderandomnumber.htm

In this tutorial i will be showing you how to create a random number generator.


  • 1 round rect button
  • 1 label

A random number generator works by simply pressing the round rect button it generates a number between zero and the number you have set it to appearing in the label

ViewController.h PAGE TOP

@interface ViewController :UIViewController {
IBOutlet UILabel *textview;

ViewController.m PAGE TOP

@implementation ViewController
- (IBAction)randomnumber {
int rNumber = rand() % 100;
textview.text  = [[NSString alloc] initWithFormat:@"%d", rNumber];  

Reference PAGE TOP


0 Comments Leave a comment

Please login in order to leave a comment.

Newest first

to your Chupamobile Account.

The Easiest way to Launch your next App or Game.

Join Chupamobile and get instant access to thousands of ready made App and Game Templates.

Creating an account means you’re okay with Chupamobile’s Terms of Service and Privacy Policy.