Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Determining if a Toolbar has Overflow Items

If a toolbar is unable to display all the user's currently configured toolbar items, it pushes the additional items into the overflow menu and displays the overflow menu icon as shown in Figure 1.


Figure 1  A toolbar indicating items in the overflow menu

A toolbar indicating items in the overflow menu

An application can determine if a toolbar has overflow items by comparing the number of items returned by the method items with the number of items returned by the visibleItems method as shown in Listing 1. If these values differ, then the toolbar has items in the overflow menu.

Listing 1  Example code to test if a toolbar has overflow items

int numberOfItems=[[theToolbar items] count];
int numberOfVisibleItems=[[theToolbar visibleItems] count];
 
if (numberOfItems != numberOfVisibleItems) {
    // toolbar has overflow items
}


< Previous PageNext Page > Hide TOC


Last updated: 2007-01-08




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice