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
1
vote
1 answer

How do I convert an NSInteger to the corresponding words in objective-c with indian rupees

NSInteger someNumber = 211242; I would like to know some function so that would return a string similar to "Two lakh eleven thousand two hundred forty-two Rupees only"
Khuss
  • 21
  • 2
1
vote
2 answers

iOS change Integer/NSNumber of parent ViewController

I have a viewController with a property of NSInteger (or NSNumber), What I want to do is pass the integer to the child ViewController, do some change (maybe add by some number). But when I use NSNumber as property in the parent and child controller…
FisherMartyn
  • 826
  • 1
  • 8
  • 17
1
vote
2 answers

Why does a pointer to an NSInteger multiply the value by 8?

In my header, I declared a few variables as @property (nonatomic) NSInteger *soldWindows; and used them to keep track of counts, incrementing with _soldWindows++;. The result consistently came out 8 times what it should be. I figured out my problem…
Joe
  • 33
  • 1
  • 8
1
vote
0 answers

Calculating the number of lines needed for a UILabel does not work on iOS9 but did on previous versions

The following block of code was working in iOS7 and 8 but when I updated to iOS9 the number of lines is always returning as 0. Is there anything obvious that needs to change> NSInteger lineCount = 0; CGSize textSize =…
DevC
  • 6,982
  • 9
  • 45
  • 80
1
vote
2 answers

how to convert the value of nsarray to integer value

I working on grouped table view based work in that in that i want to convert the value of NSarray into integer for specifing to section value of numberOfRowsInSection but it throws expection on putting following code. -…
sathish kumar
  • 1,061
  • 6
  • 16
  • 31
1
vote
2 answers

Initializing NSArray and adding an NSInteger to it

I am having problems initalizing an NSArray and adding integers to it. Here is my code, which I commented in what I am trying to accomplish. My app crashes when adding an object, but I don't know, if I am clearing the array correctly…
Nick LaMarca
  • 8,076
  • 31
  • 93
  • 152
1
vote
2 answers

Multidimensional array of NSInteger as instance variable

I'm attempting to understand Objective C arrays. What I want to do is create a multidimensional NSInteger instance array. Does the code immediately below create an array equivalent to initiating an array and running a double for loop containing…
1
vote
1 answer

Realm Objective C - parse NSInteger with value zero

I'm actually working with Realm Objective-C, here is my problem: I have a webservice which return this: { "id": 1, "name": "Project 1", "summary": "", "description": "description project 1 ...", "amountTargeted": 0, …
Hikosei
  • 193
  • 1
  • 11
1
vote
4 answers

Correct way to retrieve a NSInteger property from another class?

I am making a (sort of) trading card game , using SpriteKit. I created a Card class, and each card has a rank : // in Card.h @property NSInteger cardRank; In one of my another class (Game class), i'm trying to retrieve this value. I create a…
user4639961
1
vote
2 answers

Using NSInteger for type id in NSDictionary objectForKey

I'm trying to insert a key value of indexPath.row in a dictionary. When I do just indexPath (without .row) it works fine. But when I add the .row, it gives me an error saying: Implicit conversion of 'NSInteger' (aka 'long') to 'id' is disallowed…
user4645956
1
vote
1 answer

NSInteger differences between CLI and GUI?

I've been building a framework and writing unit tests in GHUnit. One of my Framework's accessor methods returns an NSInteger. I assert the expected value in the tests like this: GHAssertEquals(1320, request.port, @"Port number should be…
d11wtq
  • 34,788
  • 19
  • 120
  • 195
1
vote
2 answers

Implicit conversion loses integer precision in ZLib compression method

Implicit conversion loses integer precision: 'unsigned long' to 'uInt' (aka 'unsigned int') I am trying to update my application from 32bit to 64bit, since changing the architecture I have recived an error as decribed above. I have a method that…
HurkNburkS
  • 5,492
  • 19
  • 100
  • 183
1
vote
3 answers

Compare an int to an array of ints Obj-C

How do i go about seeing if my integer is in an array of integers... eg i want to know if 7 is in an array of [ 1 3 4 5 6 7 8] any ideas? Thanks
Sam Jarman
  • 7,277
  • 15
  • 55
  • 100
1
vote
0 answers

Nsnumber intvalue exc_bad_access

Since I upgraded to iOS 8, I have the following lines of code : NSNumber *balance = dict[@"user"][@"balance"]; [IWSession session].currentUser.balance = [balance integerValue]; which generate sometimes a exc_bad_access 1) This is totaly random 2)…
Romain Dorange
  • 831
  • 1
  • 10
  • 23
1
vote
0 answers

Updating app to support 64-bit

I have an iOS app that I'm trying to update to take advantage of the A7 64-bit processor. In many parts of my code, I created integer variables of type int. Should I change all of them to NSInteger ? I read many articles on the subject, and I…
Noam Solovechick
  • 1,127
  • 2
  • 15
  • 29