nsinteger Questions
3
Solved
A NSInteger is 32 bits on 32-bit platforms, and 64 bits on 64-bit platforms. Is there a NSLog specifier that always matches the size of NSInteger?
Setup
Xcode 3.2.5
llvm 1.6 compiler (this is im...
Groschen asked 10/12, 2010 at 1:58
4
Solved
How can I tell in objective-c coding if an integer is positive or negative. I'm doing this so that I can write an "if" statement stating that if this integer is positive then do this, and if its ne...
Herculie asked 17/6, 2010 at 21:17
5
Solved
I'm trying my hand at the iPhone course from Stanford on iTunes U and I'm a bit confused about pointers. In the first assignment, I tried doing something like this
NSString *processName = [[NSProc...
Herringbone asked 18/6, 2009 at 17:29
4
Solved
I need to store the maximum value of an NSInteger into an NSInteger? What is the correct syntax to do it?
Thanks.
8
Solved
When should I be using NSInteger vs. int when developing for iOS? I see in the Apple sample code they use NSInteger (or NSUInteger) when passing a value as an argument to a function or returning a ...
Atherosclerosis asked 14/12, 2010 at 23:3
7
I want to convert string data to NSInteger.
4
Solved
Basically I am storing an index of an array in a NSInteger. I now need it as an NSIndexpath, I'm struggling to see and find a way to convert my NSInteger to NSIndexpath so I can reuse it.
Musket asked 23/6, 2011 at 13:21
5
Solved
NSInteger myInt = 1804809223;
NSLog(@"%i", myInt); <====
The code above produces an error:
Values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long'...
Redingote asked 18/4, 2013 at 6:1
9
How does one convert NSInteger to the NSString datatype?
I tried the following, where month is an NSInteger:
NSString *inStr = [NSString stringWithFormat:@"%d", [month intValue]];
Spiccato asked 25/11, 2009 at 11:36
2
Solved
Is each value of a typedef enum treated as an int?
E.g., given the following typedef enum:
// UIView.h
typedef enum {
UIViewAnimationCurveEaseInOut,
UIViewAnimationCurveEaseIn,
UIViewAnimati...
Tubb asked 21/4, 2012 at 0:35
3
Solved
With the 64 bit version of iOS we can't use %d and %u anymore to format NSInteger and NSUInteger. Because for 64 bit those are typedef'd to long and unsigned long instead of int and unsigned int.
...
Peraea asked 19/9, 2013 at 11:51
4
Solved
I am trying to convert a NSInteger to a NSUInteger and I googled it and found no real answer. How would I do this?
Herbie asked 7/8, 2011 at 5:38
4
Solved
I am trying to sort an array of NSObjects (a object is of a class). The object class has several variables which I am wanting to use to sort the objects in the array, the variables I am using to so...
Sclerite asked 14/8, 2012 at 0:2
4
Solved
I am trying to comprehend how development is affected when developing for both 32-bit and 64-bit architectures. From what I have researched thus far, I understand an int is always 4 bytes regardles...
Mack asked 26/5, 2014 at 2:15
4
Solved
I'm having some trouble passing a number as an argument for a method:
- (void)meth2:(int)next_int;
And to call that method I need this:
int next_int = 1;
[self performSelectorOnMainThread:@sele...
Endolymph asked 28/3, 2010 at 21:25
1
Solved
I am trying to set an NSInteger to NULL.
Though the compiler does not give any error, but I am not sure if this is the right way to do it.
Can you set an NSInteger as NULL in ios..? Or is it forbid...
Gerhart asked 15/5, 2014 at 14:27
4
Solved
For example when passing a value message to an NSInteger instance like so
[a value] it causes an EXC_BAD_ACCESS.
So how to convert an NSInteger to int?
If it's relevant only small numbers < 3...
Aldarcie asked 17/11, 2009 at 23:50
1
Solved
I turned 'Signed Comparision' (aka -Wsign-compare) warnings for my iOS project in XCode (surprisingly, it was off by default). After that lots of warnings like this appeared:
/Users/michalciuba/pr...
Koroseal asked 12/2, 2014 at 10:13
4
tl;dr Version
How are the data types of an enum's constants guaranteed to be NSUInteger instead of unsigned int when declaring an enum thusly:
enum {
NSNullCellType = 0,
NSTextCellType = 1,
NS...
Fatsoluble asked 13/12, 2011 at 22:7
5
Solved
What's the difference between NSNumber and NSInteger? Are there more primitives like these that I should know about? Is there one for floats?
Bs asked 16/8, 2009 at 19:15
7
Solved
I'm trying to make one string out of several different parts. This below is what i have right now. I don't get any errors in my code but as soon as i run this and do the event that triggers it i ge...
Couldst asked 22/2, 2012 at 22:32
3
Solved
Is it possible to cast a NSInteger to a NSNumber object?
I need to convert the tag of a UIImageView object to a NSNumber object because I need to pass it as an argument to a function.
Shy asked 14/3, 2012 at 7:12
6
Solved
Is there way to solve the string equations in ios ?
For example
Input:
NSString * str =@"1+2";
Output:
NSInteger result = 3 // i.e sum of 1+2 from str
How to go about this and get expected r...
Imprecision asked 28/5, 2013 at 7:11
6
Solved
I have a large NSArray containing NSNumbers like 3, 4, 20, 10, 1, 100, etc...
How do I get the total sum of all these NSNumbers (3 + 4 + 20 + 10 + 1 + 100 + etc...) as one total NSInteger?
Thank ...
Affiance asked 25/6, 2012 at 15:37
4
Solved
How do we compare two NSInteger numbers ? I have two NSIntegers and comparing them the regular way wasnt working.
if (NSIntegerNumber1 >= NSIntegerNumber2) {
//do something
}
Eventhough, the...
Trix asked 28/2, 2012 at 5:13
1 Next >
© 2022 - 2024 — McMap. All rights reserved.