Hi all, I'm new here!
I've been working with the SDK for a few days now, and am starting to get the grips with iPhone development (just about!). However, I have encountered a few issues that seem like hot-topics, and just wanted some clarification (if possible).
I've got three image files stored in my project that are ultimately going to be displayed inside a
UIImageView (that's been set up inside a NIB using Interface Builder).
Since I'm going to change which image is used inside the view depending on a mode variable, I wanted to know if the following code is suitable?
Code:
// define an image to be used for this mode
UIImage *imgBackground = [UIImage imageNamed:@"imgBack1.png"];
// assign this image to the UIImageView
[iView setImage:imgBackground];
Now, am I correct in thinking that this particular method of assigning a variable is using a
convenience method? I.e. It isn't specifically using
alloc, copy or retain, and therefore doesn't need a
release called upon it? Naturally, I have the
code in this class's
dealloc method.
Is imageNamed the correct method to use to pull images from your library?
Any help would be greatly appreciated.
Thanks!