While working with xcode, I saw a new line jmUIImage and i try to execute the code in my SDK. But i got a strange Error. The error is
jmUIImage is undeclared
I thought it is a predefined function of Xcode. Is it a predefined or userdefined function?
jmUIImage *buttonImageNormal = [UIImage imageNamed:@"White Button.png"];
UIImage *stretchableButtonImageNormal = [buttonImageNormal stretchableImageWithLeftCapWidth:12 topCapHeight:0]
What it indicates and why i got the error ?
It looks like the bug came from the book “Beginning iPhone Development”. On page 85 you can see
jmUIImage.This is just a typo. As you can see in the code the object that is assigned to the
jmUIImageinstance is just anUIImage. That does not make much sense because you could never use any methods defined in thejmUIImageclass on this object.If I would encounter such code I would just try it with
UIImage.Another hint for a typo is that the name
jmUIImagedoes not start with a capital letter. And classes (and only classes) should always start with a capital letter in Objective-C.And when you subclass you should not include the Prefix-Letters in your classname. A proper naming for a subclass of
UIImagewould beJMImage.If it smells like a typo and looks like a typo it probably is just a typo.