What does this mean? How do I fix it?
Code:
- (id)init
{
[super init];
firstNumber = random() % 100 + 1;
secondNumber = random() % 100 + 1;
return self;
}
Error:
/Users/user/Dropbox/dev/bignerdranch_cocoa/lottery/LotteryEntry.m:15:5:{15:5-15:17}: error: the result of a delegate init call must be immediately returned or assigned to 'self' [4]
Your self
was not created ...
-(id) init {
self = [super init];
if(self != nil) {
// do init stuff
}
return self;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With