On Jun 16, 2014, at 4:24 PM, Trygve Inda <cocoa...@xericdesign.com> wrote:

> I guess the only way to prevent this is to check to see if
> 
> [coder decodeObjectForKey:kValueAKey]
> 
> returns non-nil before assigning it to valueA.

Well, if you're not afraid of terse idioms and GCC extensions, you can avoid 
all the hooha of a temporary variable and if statement:

valueA = [coder decodeObjectForKey:kValueAKey] ?: valueA;

-- 
Scott Ribe
scott_r...@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice





_______________________________________________

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