Hello,
I did the "Build and analyze" in xCode and get "Dereference of null pointer" when setting a normal int to 0 in my init-method. I noted in my code below for which row I get the message. I'm developing for iPhone.
Bric.m
#import "Bric.h"
@implementation Bric
- (id)initWithImage:(UIImage *)img:(NSString*)clr{
if (self = [super init]) {
image = [[UIImageView alloc] initWithImage:img];
}
stepX = 0; //It's for this line I get the message
stepY = 0;
oldX = 0;
color = [[NSString alloc]initWithString:clr];
visible = YES;
copied = NO;
return self;
}
@end
Bric.h
#import <Foundation/Foundation.h>
@interface Bric : NSObject {
int stepX;
int stepY;
}
-(id)initWithImage:(UIImage *)img:(NSString *)clr;
@end
It's not the complete code, pasted what I think is useful.
Since I am not using a pointer I find this quite strange. How come I get this message?
Thanks and Regards, Niklas