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

NSUInteger oddities with for loops

I use AppCode to tweak the code I've written in XCode. AppCode does awesome code inspections, and tells you where things can be improved. One of the frequent inspections I come across points out that [SomeObjCFrameworkClass objectAtIndex] is…
Logicsaurus Rex
  • 3,172
  • 2
  • 18
  • 27
-1
votes
3 answers

Objective-C Substring with range

I have an NSString that points to a URL, something like this: https://.../uploads/video/video_file/115/spin_37.mp4 I want to get the filename in my iOS app from the NSString (in this example, spin_37.mp4) I'm trying the following: NSUInteger…
scientiffic
  • 9,045
  • 18
  • 76
  • 149
-1
votes
1 answer

Xcode:(user defined runtime attribute)Range with minus value. Alternative?

I made a custom UITextField with an additional user defined runtime attribute validRange, which I can set in the storyboard view. I use this property to check in the EndEditing method to validate the new set text. I works all fine, till I had to set…
Herr Derb
  • 4,977
  • 5
  • 34
  • 62
-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
-2
votes
1 answer

NSUInteger not appearing properly on TestFlight

I've been testing my app on the simulator and device. There are labels that show NSIntegers and I've formatted them as: [NSString stringWithFormat:@"%lu", (unsigned long)_qty] This works. However, when I build my app for TestFlight, these labels…
-2
votes
2 answers

%lu and %u both give me warnings....

Hi I get this warning when using %lu: "format specifies type unsigned long but the argument has type unsigned int." then when i replace to %u: the warning changes to: "format specifies type unsigned int but the argument has type unsigned long." here…
George Asda
  • 2,119
  • 2
  • 28
  • 54
-2
votes
1 answer

NSUInteger incompatible with NSUInteger?

index is a NSUInteger on both my parent and child view controller. But when I try to pass the NSUInteger value for index I get a warning on this line: controller.index = index; saying "incompatible integer to pointer conversion assigning to…
Jared Gross
  • 649
  • 3
  • 9
  • 23
-2
votes
1 answer

Type or property (NSUInteger (aka unsigned int)) does not match type of ivar (int)

I want to declare a NSInteger variable in my ViewController, but I get an error. In my ViewController.h I have @interface MainViewController : UIViewController{ NSInteger currentSection; //Other stuff } @property (assign,nonatomic)…
user1600801
  • 269
  • 7
  • 25
1 2 3 4 5
6