nsnumber Questions

3

Solved

I am new to iPhone development. I want a Nsmutable array to hold numbers from 1 to 100. How can I do it? How can I implement in a for loop? Is there any other way to hold numbers in array in iPhone...
Eyeleteer asked 10/4, 2010 at 15:3

2

Solved

According to Swift 3 documentation, NSNumber is bridged to Swift native types such as Int, Float, Double,...But when I try using a native type in Dictionary I get compilation errors that get fixed ...
Skyler asked 23/4, 2017 at 8:20

7

Solved

So I have an NSArray "myArray" with NSNumbers and NSStrings. I need them in another UIView so i go like this: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)inde...
Sind asked 19/10, 2010 at 15:26

7

Solved

I have a string that contains words as well as a number. How can I extract that number from the string? NSString *str = @"This is my string. #1234"; I would like to be able to strip out 1234 as ...
Marivaux asked 11/1, 2011 at 22:32

2

Solved

For some reason, certain Doubles in my Swift app are giving me trouble when converting to NSNumber, while some are not. My app needs to convert doubles with 2 decimal places (prices) to NSNum...
Welltodo asked 24/8, 2016 at 15:42

4

Solved

I used core data in my iOS swift project and declared a variable as Int32, in the class file it was initialised to NSNumber and while I tried to increment the variable by creating a object for that...
Bullhead asked 18/8, 2016 at 5:47

5

Let's say I have an NSArray of NSNumbers like this: 1, 2, 3 Then the set of all possible permutations would look something like this: 1, 2, 3 1, 3, 2 2, 1, 3 2, 3, 1 3, 1, 2 3, 2...
Marva asked 24/9, 2010 at 21:49

1

Solved

Question Is it possible to replicate Swifts numeric value bridging to Foundation:s NSNumber reference type, for e.g. Int32, UInt32, Int64 and UInt64 types? Specifically, replicating the automatic...
Bullpup asked 9/3, 2016 at 13:52

3

Solved

I could convert English numbers to Arabic numbers in Xcode. but now I want to convert Arabic/Persian numbers to English numbers in iOS ... Please guide me about this... This is my code for conver...
Wahoo asked 12/2, 2015 at 11:10

2

Solved

I have a number for an example 1329094. I want to get only the first two digits that I make see 13 I create NSNumberFormatter like func setReceivedChart(description: [String], value: [Double]) ...
Bespeak asked 31/1, 2016 at 9:22

2

Solved

I'm working with a range of number from 0.00 to 9999.99 . I need to add the "˙" thousands separator, so 1300,00 should became 1˙300,00. NSNumberFormatter use "," as separator so it isn't good for m...
Karleenkarlen asked 27/12, 2015 at 13:40

5

Solved

How do I check if a NSNumber object is nil or empty? OK nil is easy: NSNumber *myNumber; if (myNumber == nil) doSomething But if the object has been created, but there is no value in it becaus...
Tyne asked 15/9, 2010 at 10:4

4

Solved

In my app, I accidentally used "==" when comparing two NSNumber objects like so: NSNumber *number1; NSNumber *number2; Later on, after these objects' int values were set, I accidentally did this...
Cladding asked 5/12, 2015 at 11:4

4

Solved

How do I get the line below to compile? UIView.setAnimationCurve(userInfo[UIKeyboardAnimationCurveUserInfoKey].integerValue) Right now, it gives the compile error: 'NSNumber' is not a subtype o...
Pepin asked 22/6, 2014 at 15:55

5

Solved

NSDictionary *regionDict = (NSDictionary *) region; NSNumber *lat = [regionDict objectForKey:@"lat"]; //[latitude addObject:lat]; NSNumber *lng = [regionDict objectForKey:@"lng"]; //[longitude...
Hundredweight asked 24/3, 2014 at 13:26

4

Solved

What is the best way of checking if a NSNumber is a fraction? NumberIsFraction(@(0)); // NO; NumberIsFraction(@(0.5)); // YES; NumberIsFraction(@(1.0)); // NO; "Best" in terms of border case han...
Crimmer asked 3/9, 2012 at 11:57

2

Solved

I have an NSArray with NSNumber objects that have int values: arrayOfValues = [[[NSArray alloc] initWithObjects: [NSNumber numberWithInt:1], [NSNumber numberWithInt:3], [NSNumber numberWithInt:5],...
Broadcaster asked 1/8, 2012 at 3:48

4

Solved

I want to have a simple NSSet which is loaded with some NSNumbers and then find out if those numbers are already added in the set or not. When I do this: NSMutableSet *set = [[NSMutableSet alloc]...
Gallbladder asked 8/11, 2011 at 14:42

1

Solved

It seems to me that any valid number can also be expressed as a String, so I don't know why this function returns a String? instead of a String.
Ecdysiast asked 23/1, 2015 at 4:35

6

Solved

In objective c, how can i check if a string/NSNumber is an integer or int
Dostie asked 13/8, 2010 at 3:58

2

Solved

I used the below code to extract numbers from inputString using NSScanner NSString *inputString = @"Dhoni7 notout at183*runs in 145andhehit15four's and10sixers100"; NSString *numberString; NSArray...
Markitamarkka asked 24/5, 2015 at 15:3

3

Solved

An NSNumber containing a Bool is easily confused with other types that can be wrapped in the NSNumber class: NSNumber(bool:true).boolValue // true NSNumber(integer: 1).boolValue // true NSNumber(i...
Hannon asked 13/5, 2015 at 13:4

2

I'm stuck with some sort of casting in Swift as I am very new to Swift. Here is my code: if let matchDateTime = item["matchDate"].number { _matchDateTime=matchDateTime } println(_matchDateTi...
Impartible asked 12/5, 2015 at 15:49

2

I'm successfully using the setValue(value, forKey: key) method in my NSKeyValueCoding compliant Swift NSObject subclass. This works perfectly well on String optionals, e.g. var name:String? How...
Zootoxin asked 30/9, 2014 at 10:44

2

Solved

Is each value of a typedef enum treated as an int? E.g., given the following typedef enum: // UIView.h typedef enum { UIViewAnimationCurveEaseInOut, UIViewAnimationCurveEaseIn, UIViewAnimati...
Tubb asked 21/4, 2012 at 0:35

© 2022 - 2024 — McMap. All rights reserved.