• 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
Can anyone confirm this IB Bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can anyone confirm this IB Bug?


  • Subject: Can anyone confirm this IB Bug?
  • From: Jonathan Dann <email@hidden>
  • Date: Sat, 2 Aug 2008 19:08:18 +0100

Hi all,

I recently made an IBPlugin for one of my custom controls, which I linked to my own framework. The framework had an NSArray category with the method, -firstObject. When trying to run IB it kept crashing before loading any of my custom control's code, the stack trace showed that my -firstObject method was getting called (and not by me).

Here's my implementation

- (id)firstObject;
{
	return (id)CFArrayGetValueAtIndex((CFArrayRef)self, 0);
}

Which will raise an exception if the array has no elements. What I think was happening is that somewhere in IB or InterfaceBuilderKit a - firstObject method had been defined that returned nil when the array was empty, so when my method was called, the caller was expecting a method that *could* return nil. Am I right in my diagnosis? In my mind such a method should raise for index out of bounds, and I shouldn't insulate myself in framework code from attempting to access out of bounds. It has caused me to refactor a bunch of my code that called my -firstObject method; nothing big, just annoying as I'd used it a lot.

Thanks,

Jonathan

http://espresso-served-here.com

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Can anyone confirm this IB Bug?
      • From: Stephane Sudre <email@hidden>
    • Re: Can anyone confirm this IB Bug?
      • From: "Adam R. Maxwell" <email@hidden>
  • Prev by Date: Re: Turning off the garbage collector for Xcode 3.0
  • Next by Date: SVN newbie....
  • Previous by thread: Re: Turning off the garbage collector for Xcode 3.0
  • Next by thread: Re: Can anyone confirm this IB Bug?
  • Index(es):
    • Date
    • Thread