Questions tagged [nsinteger]

An NSInteger is a data type in Objective-C. It is used to describe an integer.

An NSInteger is data type in Objective-C used to describe an integer. When building 32-bit applications, NSInteger is a 32-bit integer. A 64-bit application treats NSInteger as a 64-bit integer.

258 questions
0
votes
1 answer

Conversion of strings to integers on arm64?

I've got a small chunk of code which I've noticed is behaving differently for arm64 targets. I'm fetching a numeric string from JSON data, and then using integerValue to convert the string to an integer. The string generally has thousands…
Radrider33
  • 557
  • 1
  • 4
  • 17
0
votes
2 answers

Is NSInteger Automatically Assigned to 0

I'm pretty new to Objective-C programming so please excuse the nebbish question. If I create NSInteger as follows: @property (nonatomic) NSInteger myNumber; is it assigned to some random integer a la 'C' or is it automatically assigned to…
ThinkBonobo
  • 15,487
  • 9
  • 65
  • 80
0
votes
2 answers

How to save a NSInteger?

Heres what I've tried NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; [prefs setInteger:HighScore forKey:@"integerkey"]; [prefs synchronize]; NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults]; HighScore =…
0
votes
2 answers

NSInteger vs int vs object

I'm quite new to objective-C, and as I've been learning I've been trying to make my own program. The idea is there is a variable (or object?) named totalSave, a method addToTotalSaved with a parameter saveAmount, and multiple objects (each object…
user107152
  • 11
  • 2
0
votes
1 answer

NSArray of UIBarButtonItem Tag (i.e. NSInteger)

Is it true that you can't have an NSMutableArray of NSIntegers? When I try to add the values to the array and then print them out they're huge numbers (when if I print out the tag to NSLog they're 0,1,2,3 etc.). I'm trying to create an array of my…
Ternary
  • 2,401
  • 3
  • 31
  • 54
0
votes
1 answer

Passing a variable of NSInteger type to a UIPageViewController

My app's storyboard looks like this. There is a list of websites defined in an array in the PageViewController. What I'm now trying to do is to let the user type the index number in the textfield in the MainViewController and when you tap the…
Isuru
  • 30,617
  • 60
  • 187
  • 303
0
votes
2 answers

NSInterger Max and Minimum Value

in my app I'm taking into account the clicks made ​​on a botton . The number of clicks is displayed in a label and I used this code ... I wish that the number of clicks started not from 0 but from 12 and stop automatically at 30. How can I give…
kAiN
  • 2,559
  • 1
  • 26
  • 54
0
votes
3 answers

NSInteger and facebookId

I made a request to facebook API using facebook SDK to get user basic data. Everything works ok, but when I try to pass the facebook ID as a NSInteger number the returned number is wrong. The facebook ID is: 100001778401161 But after convert the…
GodFather
  • 3,031
  • 4
  • 25
  • 36
0
votes
1 answer

getting multiple integer values out of textfield

I want to read many different integer values out of an textfield and for that I have this code: NSString *string1,*string2; string1= [textField stringValue]; int i,c; c=0; NSInteger values[50]; for (i=0; i<50; ) { string2=[NSString…
killerwakka
  • 31
  • 2
  • 9
0
votes
2 answers

Cocoa touch code to set NSInteger to number in a text field

I need to set an NSInteger to the number in a text field. And I've googled it and could not find any answer. Does anybody know how to do this
user2426008
0
votes
4 answers

Nsinteger accessible issue

When I try to add nsinteger value into array it shows warning, Incompatible pointer to integer conversion sending 'NSInteger *' (aka 'int *') to parameter of type 'NSInteger' (aka 'int'); dereference with * and crashed when reach the code [sizary1…
Globas techn
  • 95
  • 1
  • 6
0
votes
2 answers

Cocoa touch NSInteger plusing 4 not 1

I have this cocoa touch code where you press a button and a NSInteger adds its self with the number 1 and then a label turnes into the NSInteger value This is the code - (IBAction)out:(id)sender { outnum = outnum + 1; self.outnumberlabel.text = …
user2141310
0
votes
2 answers

Converting string to an integer in ios

I know this question has been asked many times. You can convert string to integer in this two ways: [myString intValue] which returns a "C" type or [myString integerValue] which returns NSInteger. But my requirement looks like this: int route1 =…
lakshmen
  • 28,346
  • 66
  • 178
  • 276
0
votes
2 answers

How do I display an integer from an NSArray on a UILabel?

I realize this is a dumb beginner question, but I have been stuck for at least an hour on trying to get an integer value from my array to display on a label when I press a button. The problem is that the label keeps displaying "(null)" no matter…
Louie Bertoncin
  • 3,744
  • 2
  • 25
  • 28
0
votes
1 answer

Assigning numerical value to objects in NSMutableArrary

I have an NSMutableArray of playing cards. For brevity, I'll just show the objects in the suit of clubs, but all 52 cards are present in this array. deckOfCards = [[NSMutableArray alloc] initWithObjects: @"AC", @"2C", …
Scott
  • 110
  • 1
  • 1
  • 9