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
3 answers

Can I make an NSInteger an optional parameter on a method?

I would like to have a method along the lines of setData:(SomeClassName *)data inPosition:(NSInteger)position and in the implementation, check for nil as position. The idea is that if the position is provided, I will use it, and if not, I will…
Ben Packard
  • 26,102
  • 25
  • 102
  • 183
-1
votes
4 answers

Invalid Integer to pointer conversion in objective c

When i am Building this code i am getting WARNING that INVALID Integer to pointer conversion. But when I run the application it gets Crash ..... can any one help me... I am getting warning at withObject:[sender tag] i have frontButtonScaleUp…
DShah
  • 9,768
  • 11
  • 71
  • 127
-1
votes
1 answer

Sort a NSMutableArray of NSInteger

What is the best and fastest way to sort an NSMutableArray of NSInteger?
Maxime
  • 3,167
  • 7
  • 26
  • 33
-1
votes
2 answers

UISlider fixed postition for saved value?

In my project im having a UISlider which has fixed positions which is working fine, but when I try to save the value using NSUserDefaults the position doesn't make any sense no more and it overwrites the fixed positions. I tried to devide the saved…
Jan
  • 653
  • 1
  • 7
  • 22
-1
votes
1 answer

NSInteger vs NSNumber and retrieving JSON data from itunes

Im trying to grab the artistId from this JSON { "wrapperType": "track", "kind": "podcast", "artistId": 125443881, "collectionId": 523121474, "trackId": 523121474, when creating my podcast object. but when i try to display this variable as…
-1
votes
1 answer

Crazy problem when comparing NSInteger to int

I have a crazy problem when comparing an NSInteger to int, as follows: NSInteger count = [dictionary count]; if (count == 0) { // Do something } else { // Do something } When the count is zero, the snipped code in the if clause is run, but…
Son Nguyen
  • 3,481
  • 4
  • 33
  • 47
-1
votes
4 answers

How To convert [__NSArrayI integerValue] to integer value?

This the line i have using to convert the object to integer values,Inside For Loop I have Placed This code NSInteger tag=[[arrFullSubCategory valueForKey:@"category"] integerValue]; Inside arrFullSubCategory: ( { category = 35; …
Kishore Kumar
  • 4,265
  • 3
  • 26
  • 47
-1
votes
1 answer

Have string represent integer value - Obj C

I have a situation where there are either 4 options or less. The options are A,B,C,D (or it could just be A,C or A,C,D...ect). And each option is associated with a integer value from 0 - 4000. And if all 4 options A,B,C,D are available I want A to…
tim blue
  • 138
  • 2
  • 14
-1
votes
1 answer

mutableCopy of NSInteger

I'm trying to make a mutableCopy of an NSInteger?. However, since an NSInteger is a non-mutable object this doesn't work. If I don't make a mutableCopy of the row variable the UIPickerView jumps to the next row when selecting one. Here my code: -…
-1
votes
2 answers

NSNumber numberWithInt:nnid error

I get this error: Implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'int' and it points at nnid. How can I fix this? // databaseden haberleri cek -(NSMutableArray *)getNews: (NSInteger)nnid { [database open]; …
kryptics
  • 13
  • 5
-1
votes
1 answer

Why are my integers not adding negative values?

Really confused here. NSInteger iteration; NSInteger direction; - (void)pulse { self.position = ccpAdd(self.position, vectors[iteration]); iteration = iteration + direction; if (iteration >= totalIterations) { direction = -1; …
quantumpotato
  • 9,637
  • 14
  • 70
  • 146
-1
votes
1 answer

Test NSInteger in an if statement

I Have an if statement that is testing a that a UIDatepicker date is not being selected outside of a certain set of hours. E.g: if (hour < 9 || hour >= 17 || (hour >= 17 && minute > 30)) I now need to find out how to test that my NSInteger *day is…
Luke
  • 55
  • 8
-1
votes
1 answer

Assign value to NSUInteger in object after init

I have a subclass of NSObject. In this class I have an NSUInteger declared like this: @interface Deck : NSObject - (id)initDecks:(NSUInteger)decks; - (Card *)drawCard; @property (nonatomic, assign) NSUInteger drawnCards; In my implementation…
Jorn
  • 1,054
  • 9
  • 25
-1
votes
3 answers

Why NSInteger cannot set from parent view controller?

In my childview controller I have this property: @property (nonatomic, assign) NSInteger currentItemIndex; In parent view controller, I want to set that value. [childViewController setCurrentItemIndex:5]; [self.navigationController…
Burak
  • 5,706
  • 20
  • 70
  • 110
-1
votes
2 answers

Want to store NSRange and NSInteger inside NSMutableDictionry

I need to store both the NSRange object and NSInteger inside the NSMutableDictionary? Can I do it? If it is, Could you give me an example?
Kirubachari
  • 688
  • 11
  • 27