Questions tagged [nsnumber]

on Mac OS X, NSNumber is a subclass of NSValue that offers a value as any C scalar (numeric) type

NSNumber is a subclass of NSValue that offers a value as any C scalar (numeric) type. It defines a set of methods specifically for setting and accessing the value as a signed or unsigned char, short int, int, long int, long long int, float, or double or as a BOOL. (Note that number objects do not necessarily preserve the type they are created with.)

Resource

785 questions
-3
votes
3 answers

I am using an NSNumberFormatter in a Calculator display but it doesn’t parse NSStrings right

I am a beginner Objective-C programmer and I was building a calculator as my first app. I am using an NSNumberFormatter to format the Calculator’s display. It converts NSNumber to NSString correctly, but doesn’t parse NSString to NSNumber right if…
duci9y
  • 4,128
  • 3
  • 26
  • 42
-4
votes
2 answers

How to print the sum of NSMutableArray

i cannot find the way to print the sum of all the numbers between 0 to 100 in a new line in the console. Here is my code: NSMutableArray *intArray = [[NSMutableArray alloc] initWithCapacity:100]; for (int i = 1 ; i <= 100 ; i ++) …
Xtrician
  • 504
  • 3
  • 5
  • 14
-4
votes
1 answer

Initialise CATransition duration with NSNumber

I want to initialise the duration of a CATransition with a NSNumber, how do i do this, since the animation.duration is a NSTimeInterval object? - (void)startPopUpAnimation:(NSNumber *)numbers { CATransition *animation = [CATransition…
bruno
  • 2,154
  • 5
  • 39
  • 64
-4
votes
1 answer

Objective-C NSNumber Value From Entity Property

Im successfully pulling a number from a entity. But if I init that number with an NSNnumber, it seems a random number is generated... //This code works, and I can write the number to the NSLOG ok. Misc_RandomNumber *rndNum = [fetchedObjects…
user2228755
  • 397
  • 1
  • 2
  • 10
-5
votes
2 answers

Straight up convert NSNumber to NSString

How to? .h @property (nonatomic, strong) NSNumber *seasonRoundN; @property (nonatomic, strong) NSString *seasonRound; .m _weMeetAgain = [NSNumber numberWithInt:13]; _seasonRound = [NSString stringWithFormat:_weMeetAgain]; // incompatible :S Should…
user3295409
  • 23
  • 1
  • 8
1 2 3
52
53