labelGen.text = [self, arc4random() % 1000]
give's me error => "Could not find an overload for '%' that accepts the supplied arguments"
Help me please
labelGen.text = [self, arc4random() % 1000]
give's me error => "Could not find an overload for '%' that accepts the supplied arguments"
Help me please
Though its not clear what you want to achieve, I think you want a random number as a string. You can get it as below.
NSUInteger random = arc4random()%1000;
labelGen.text = [NSString stringWithFormat:@"%d",random];
In you code,
labelGen.text = [self, arc4random() % 1000]
the arc4random()
function is c function not Objective-C function, show you can not call it on self. Also this expression will give you unsigned int
value not a NSString
value.