On Sep 4, 2013, at 7:02 AM, Matt Neuburg <m...@tidbits.com> wrote:

> 
> On Sep 4, 2013, at 4:13 AM, cocoa-dev-requ...@lists.apple.com wrote:
> 
> What you're doing has a lot of bad smells:
> 
> * If I'm only going to call instantiateViewController, why am I using a 
> storyboard here at all? If I use a .xib file instead, I can tell the view 
> controller what .xib to use at its view nib, regardless of it's class.

Storyboards give you access to static table view cells.

> 
> * If the only difference between this object and that one is 
> self.pMusicCategory, why am I bothering to subclass?

You still need to subclass to have a music category property.

> Why not set the music category of the instance as soon as it is created?

In this example, it is a constant.

> Gosh, if I weren't using a storyboard, I could even have a designated 
> initializer that takes a music category as a parameter.

You could do that, but OP is using storyboards. In that case, the proper way to 
pass that info is in -prepareForSegue:.

> 
> * Even if you must use a storyboard, you can set an arbitrary variable in the 
> resulting instance, using the user-defined runtime attributes.

You can't use symbolic constants here, and it’s shoved into some little-used 
menu. User-defined runtime attributes are a smell.

> 
> * If all else fails, implement loadView.

Why do this when -viewDidLoad is expressly provided for setting up a view after 
it’s been loaded? OP does not need to customize the loading process.

In short, none of your advice is appropriate.

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to