I have been watching iPhone development videos on iTunes U, and am still so good. I think I understood things well enough.
The point is, in the examples they provide, they never create their own class methods, similar to those you use on some Foundation classes (for example, [NSString string]), so I'm not sure how I should create my own class method to return an instance with auto-implementation of my class.
I know how to create a saved object using an instance method, but I would prefer to use a class method because I prefer it, I'm just not sure if this implementation will be most suitable for returning an object with auto-implementation:
+ (PhotoViewController*)initWithImageView:(UIImageView*)imageView
{
PhotoViewController *toreturn = [[PhotoViewController alloc] init];
toreturn.imageview = imageView;
[toreturn autorelease];
return toreturn;
}
Thanks so much for any help you can provide.
source
share