• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Sending messages to nil on Intel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sending messages to nil on Intel


  • Subject: Sending messages to nil on Intel
  • From: Felix Schwarz <email@hidden>
  • Date: Mon, 1 Aug 2005 21:49:16 +0200

Hi everybody,

after reading this ..

http://developer.apple.com/documentation/MacOSX/Conceptual/ universal_binary/universal_binary_tips/chapter_5_section_16.html#// apple_ref/doc/uid/TP40002217-CH239-291803

.. just to get things right since I'm currently writing a lot of new Objective-C code. Below simple sample code:

UInt32 maxSizeFromDict (NSDictionary *options)
{
    return ([[options objectForKey: @"MaxSize"] intValue]);
}

.. returns 0 for maxSizeFromDict(nil) on PPC. Will it return an undefinded value on x86 Macs?

.. returns 0 for maxSizeFromDict (aDictionaryThatDoesNotContainTheMaxSizeKey) on PPC. Will it return an undefinded value on x86 Macs?

And, asked more generally, should I continue to write "compact" code as above, or do I have to write less compact code like this in order to achieve compatiblity with the upcoming x86 Macs:

UInt32 maxSizeFromDict (NSDictionary *options)
{
    if (options)
    {
        NSNumber *myNumber;

        if (myNumber = [options objectForKey: @"MaxSize"])
        {
            return ([myNumber intValue]);
        }
    }

    return (0);
}

Either way, if I know which route to take, it'll probably save me tons of time when porting what I currently write to the Intel Macs. Thus, an answer would be highly appreciated. Thanks in advance.

Best regards,
Felix
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Sending messages to nil on Intel
      • From: Nat! <email@hidden>
    • Re: Sending messages to nil on Intel
      • From: Jim Correia <email@hidden>
  • Prev by Date: Re: CoreData & Bindings: How to make a predicate search a to-many rel ationship
  • Next by Date: Obj-C compiler warnings
  • Previous by thread: Re: Vu-meter
  • Next by thread: Re: Sending messages to nil on Intel
  • Index(es):
    • Date
    • Thread