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…
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…
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…
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…
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')
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…
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;
…
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…
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…
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…
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…
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…
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…
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…
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…