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

Badge doesn't display value

I have a barButton badge. I want to display an integer in it. @property (nonatomic) int section; @synthesize section; -(void)sendBadgeIntBack:(int)section { self.section = section; NSLog(@"The numbers of sections in tableView are: %i",…
SwingerDinger
  • 276
  • 1
  • 7
  • 21
0
votes
2 answers

Passing int back in NavigationController

I'm sitting with a issue which I can't solve in a while. I must be doing something very wrong. I have 2 views, a UIView and UITableView. They're embedded with a NavigationController. In the second view; TableView, I want to pass a NSInteger back to…
SwingerDinger
  • 276
  • 1
  • 7
  • 21
0
votes
2 answers

NSInteger release

DetailViewController.h @interface DetailViewController : UIViewController { NSInteger getInteger; NSNumber *getNumber; } @property (nonatomic, retain) NSNumber *getNumber; @property (nonatomic, retain) NSInteger getInteger => Doesn't…
Beomseok
  • 471
  • 1
  • 6
  • 22
0
votes
1 answer

Efficiency NSString vs NSInteger/int - only for textual representation

I'd like to know if it would make any sense to cast/convert a number, parsed from a csv file, e.g. customer id, to a NSString? Or maybe better a simple int? As I'm quite new to obj-c, I'm not really sure, wether to consistently use the NSxyz types,…
0
votes
1 answer

NSUserDefaults not incrementing

I am trying to increase an NSInteger using NSUserDefaults like this: NSInteger attempts = [[NSUserDefaults standardUserDefaults]integerForKey:@"tries"]; NSInteger newA = attempts++; [[NSUserDefaults standardUserDefaults]setInteger:newA…
Abdullah Shafique
  • 6,878
  • 8
  • 35
  • 70
0
votes
5 answers

Using multiple else if statements for NSInteger

I have a section of code, in which I want a different accessoryView for the TableView cell, based off the number for that cell's entry. The code I have set up is: NSInteger warriors = [entry.prayerWarriors intValue]; if (warriors == 0) { …
user717452
  • 33
  • 14
  • 73
  • 149
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

TableViewController property changing whilst app is in the background

I'm slowly working on my first simple timer app, which is starting to slowly come to life. At the moment I've done no saving of data for when my app enters the background, for the moment whilst writing my app it is always staying loaded during my…
0
votes
0 answers

Why can't ViewController send correct integer?

I'm developing an application for iPhone. I wrote this code. SelectYearTableViewController.m ... - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { SelectAWeekTableViewController_iPhone *saw =…
Rukkora
  • 186
  • 2
  • 11
0
votes
1 answer

Create enum values default to NSInteger

I understand that when we declare enum like the ones below, the values are default to type "int" enum{ category0, category1 }; However, I am getting issues now that iOS supports 64-bit. The solution I am thinking to prevent changing a lot…
iPhoneJavaDev
  • 821
  • 5
  • 33
  • 78
0
votes
2 answers

NSInteger increments absurd value

I have the following code which increments an existing value of a new variable: -(NSString *)increaseId:(NSInteger *)config_id{ NSLog(@"%d",config_id);//Show 0 NSInteger *varfg = 0;//Init varfg = config_id +1;//In logic here the compiler…
user3372120
  • 134
  • 1
  • 10
0
votes
2 answers

Xcode 5.1 NSInteger to int, loss of precision

This might be a mundane question, but I would like to know the best practice. Since upgrading to Xcode 5.1, I got a ton of warnings about loss integer precision from NSInteger (aka 'long') to 'int' assuming because of the arm64 switch. I have been…
Alan
  • 9,331
  • 14
  • 52
  • 97
0
votes
1 answer

NSInteger used in calculation, warning 'local declaration of '' hides instance'

I am a beginner. And I was trying to transform arabic numbers to ordinal numbers by having the following class. num is NSInteger, while, during the calculation, the warning pop out "local declaration of '' hides instance" #import…
Coconut
  • 184
  • 1
  • 15
0
votes
1 answer

int value not passing, unrecognized selector sent to instance Terminating app due to uncaught exception 'NSInvalidArgumentException'

I'm trying to pass two integer values between different files but getting a error as mentioned in title. Error at this line: - (NSString *) lookup: (NSString *)in get:(int)dictio get1:(int)dictio1; Error File: 2014-02-05 13:27:48.019…
0
votes
2 answers

encode NSInteger doesn't work on 64 bit simulators - objective c

I'm quite new to Objective c. In my app I want to save in a .plist file an object made of a NSString and three NSInteger token from three segmented controls. It is working fine on 32 bit simulators and devices, but in 64 bit a null object is passed,…
Bebo Yasu
  • 1
  • 3