Questions tagged [nsuinteger]

An Objective-C unsigned integer

An Objective-C unsigned integer

typedef unsigned long NSUInteger;

Reference: https://developer.apple.com/Library/ios/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_DataTypes/index.html#//apple_ref/c/tdef/NSUInteger

83 questions
0
votes
1 answer

Invalid receiver type 'NSUInteger'

I have a Core Data entity whose header file looks like this: @interface MyEntity : NSManagedObject { } @property (nonatomic, retain) NSNumber * index; @end And it's implementation file looks like this: @implementation MyEntity @dynamic…
CJ.
  • 1,034
  • 1
  • 9
  • 20
0
votes
1 answer

Does a value update inside a block/completion block, if changed in a different thread?

I have a UIView animateWithDuration (in a method being called by a button) that animates a UIImageViews. The important code before the animation code: (the title is appropriate, just keep reading) //Sets _squareOneNumber to 0 (this is going to be…
Minestrone-Soup
  • 399
  • 1
  • 16
0
votes
1 answer

Define a minimum number character in UITextfield

I wish verify a number letter in UITextfield, and also if my textfield is empty. But, I have a problem between NSUInteger and int. Thanks for your answers. - (void)saveProfile { NSUInteger *minID = [_userID.text length]; if ([_userID.text…
Kevin Py
  • 2,459
  • 2
  • 22
  • 33
0
votes
1 answer

Using NSUInteger Input to insertObject:___ atIndex:___

I'm trying to create a simple commandline tic-tac-toe game using an NSMutableArray. Created a class called "Board" with the method "getPosition" (I'm assuming this is the best way to get a user input) I'm asking for position, then casting from int…
zamanfu
  • 1
  • 1
0
votes
1 answer

I can't seem to divide NSUInteger by 2

The snippet of code: NSUInteger *lengthOfLine =100; NSUInteger *half = lengthOfLine/2; The compile error for line 2: Invalid operands to binary expression ('NSUInteger *' (aka 'unsigned long *') and 'int')
learner
  • 11,490
  • 26
  • 97
  • 169
0
votes
1 answer

Returning Factorials greater than 12 in Objective-C

I have the following code, and I want it to give me factorial values up to 20. -(NSUInteger)factorialofNumber(NSUInteger n){ static NSUInteger f[N + 1]; static NSUInteger i = 0; if (i == 0) { f[0] = 1; i = 1; } while (i <= n) { f[i] = i…
arc4randall
  • 3,275
  • 3
  • 27
  • 40
0
votes
1 answer

NSUInteger in iOS7

I'm having a really weird problem here with NSUInteger in iOS7, everything is perfect before iOS7, I guess it's related to the 64-bit support in iOS7. My code is like this, very simple: if (blah blah blah) { NSUInteger firstRow = 0; …
Wang Liang
  • 941
  • 2
  • 15
  • 34
0
votes
1 answer

Pass a variable to decimalNumberHandlerWithRoundingMode?

Forgive me if I use the wrong terminology as I'm still a little new at iOS development. I've built a calculator-type app and I want users to be able to control how numbers are rounded. Here's the code I'm…
Paul B.
  • 458
  • 3
  • 6
0
votes
2 answers

NSUInteger in reversed loop confusion?

I wonder if someone can explain something, I setup a loop where I wanted to count backwards from 10 to 0 : for(NSUInteger index = 10; index >= 0; index--) { NSLog(@"INDEX: %ld", (long)index); } This loop runs forever, it does not stop at 0, but…
fuzzygoat
  • 26,573
  • 48
  • 165
  • 294
0
votes
1 answer

Error Message: Incompatible pointer to integer conversion sending 'NSArray *__strong' to parameter of type 'NSUInteger'

Why am I getting this issue error? Incompatible pointer to integer conversion sending 'NSArray *__strong' to parameter of type 'NSUInteger' #import "FSConverter.h" #import "FSVenue.h" @implementation FSConverter - (NSArray…
user3429966
  • 95
  • 1
  • 10
0
votes
2 answers

Got 23 warnings overnigth regarding NSUInteger

I'm updating an old project of mine. I'm doing good progress and everything goes smooth. Yesterday when I finished working everything was ok with my project, no errors, no warnings. Suddenly, when today I started the project and without pressing a…
Marcal
  • 1,371
  • 5
  • 19
  • 37
0
votes
1 answer

int to NSUINteger conversion issue

i have a situation like this. i want to remove some object in a particular index in a mutable array. so i have a method for do that by passing the index. but it takes NSUInteger as a parameter. but i got an integer value as the index. when i call my…
Darshana
  • 314
  • 2
  • 4
  • 22
0
votes
3 answers

int or NSInteger to NSUInteger for index

I'm trying to (in Xcode5) use the 'removeObjectAtIndex' for an 'MutableArray' which takes an NSUInteger but the variable I'm using is an integer so I casted with (NSUInteger *) but I get a warning that says cast to 'NSUInteger *' (aka unsigned long…
snapfish
  • 175
  • 1
  • 14
0
votes
2 answers

How do i get the key value from dictionary when the key is a random number?

I just started learning objective-c and I'm trying to use a random number to get the value for the key of that number. Obviously (for most of you) this won't compile since NSNumber and NSUInteger are of different data type. But this was my best shot…
XT_Nova
  • 1,110
  • 5
  • 17
  • 32
0
votes
1 answer

NSMutableIndexSet addIndex: Method Throws Error

In trying to delete some objects from Core Data, I am running into some difficulty using the NSMutableIndexSet class and it's method 'addIndex:'. In core data I have folder objects, which contain a set of thread objects. Each thread has a threadId…
jac300
  • 5,182
  • 14
  • 54
  • 89