NSTabView - selector not recognized using selectLastTabViewItem and friends

Hi, I'm new to Xcode, Cocoa, and Objective-C (not new to development though). I am using Xcode 2.4.1 on OS X 10.4.11.
I've gotten on pretty well doing general stuff with most of the widgets, but I'm hung up trying to do something (commonplace) with tabs. I have a NSTabView with 3 tabs, and want to force one of them to become the active tab.
After a couple hours of screwing with this, I have created a new Xcode project just to test selectLastTabViewItem on a NSTabView. This is exactly what I do:
1) In Xcode, create new Cocoa application project.
2) Add class Controller there
3) Open the MainMenu.nib
4) In IB, drop the Controller.h file so it appears with the classes.
5) Instantiate a Controller class
6) Drop a NSTabView in the Window
7) Create an outlet of NSTabView type for Controller
8) Click and drag from Controller instantiated object to the NSTabView object in the GUI - connect it as an outlet. I've verified this has added properly, and in the list of outlets it picks up the "type" of NSTabView i.e. Under Controller's Connects, I see NSTabView (Tab, View)
9) Create code for Controller, Overwrite code in Xcode with this. (No more work done in IB)
10) Back in Xcode, edit the source and make Controller.m read as follows:
#import "Controller.h"
@implementation Controller
// Simplest case is to have this code run when awakeFromNib happens
// I've also tried it tied to a button click action
- (void)awakeFromNib
[tabView selectLastTabViewItem]; // select the Tab View Item called 'View'...
// I've used the other similar methods, such as the one that selects tab view based on
// identifier. I get the same error with all of them, this one seems easiest to debug
// since there's the least involved
@end
What I get is:
[Session started at 2009-08-02 16:00:12 -0400.]
2009-08-02 16:00:12.955 NSTabViewTest[10808] * -[NSTabView selectLastTabViewItem]: selector not recognized [self = 0x3515f0]
2009-08-02 16:00:12.956 NSTabViewTest[10808] An uncaught exception was raised
2009-08-02 16:00:12.956 NSTabViewTest[10808] * -[NSTabView selectLastTabViewItem]: selector not recognized [self = 0x3515f0]
2009-08-02 16:00:12.956 NSTabViewTest[10808] * Uncaught exception: <NSInvalidArgumentException> * -[NSTabView selectLastTabViewItem]: selector not recognized [self = 0x3515f0]
I've looked up code online and I don't seem to be doing anything different than examples, although I don't know what their nib's look like.. any help would be wonderful. Thanks!
Message was edited by: Robert Is Confused, fixing to use code tags

Hi Robert, and welcome to the Dev Forums!
selectLastTabViewItem: takes one arg which passes the sender's address to the tabView.
- (void)awakeFromNib { // this line starts with a -, but apple forum prevents it
NSLog(@"Controller awakeFromNib");
[tabView selectLastTabViewItem:self]; // select the Tab View Item called 'View'...
I think your compiler should have given you a warning: 'NSTabView' may not respond to '-selectLastTabViewItem'. These are easy to miss if you don't have your Build Results window open, since the warning bubble may not show up in the source editor until that window is reselected.
Btw, there's a yellow alert notice in the 1st slot of the forum topics page with code formatting instructions in the subject line (and a link to lots of other handy formatting tricks). You can see how your post will look by clicking the Preview tab on top of the Reply editor panel. If you reply to my post, click the double-quote icon under Preview to see exactly how my message was formatted.
- Ray

Similar Messages

  • OS 10.2.0 Update after reinstall: "selector not recognized"

    I received an iMac G3 400MHz running OS 10.2.x (I don't remember which exactly, but probably 10.2.8), but noticed that certain things were missing in Utilities, like Terminal, System Profiler, Disk Utility, etc. Ran the Software Update, which applied, as I remember, a security update. But the Utilities things were still missing, so I reinstalled the OS using an original OS 10.2 (Jaguar) installation disk set. That did an "Archive and Install", so the old OS is in "Previous System".
    But now I can't apply any of the Combo Updates to 10.2: I've downloaded and tried 10.2.1, 10.2.2, 10.2.4, 10.2.6, and 10.2.8. All fail, with a message in the Console which says:
    Mac OS X Version 10.2 (Build 6C115)
    Installer[493] * +[IFGlobals isRunningOSInstall]: selector not recognized
    I notice that the usual suggestion is to go back to an earlier update, but, as I said, I've tried them all.
    I've also run the disk utility and repaired permissions. Also tried running this from another admin
    account.
    Can anyone suggest something?
    Thanks,
    Frank Huddleston

    Frank,
    Also check to see if, the Firmware Update was ever upgraded.
    This is a requirement, before OS X can be successfully installed.
    If one is required, you must start the computer from a Mac OS 8 or Mac OS 9 System Folder on the computer's hard disk, not from a CD, in order to install it.
    If it was updated, in System Profiler, the Boot ROM Version should be 4.1.9
    If it was never installed, you can call Apple Support 1-800-767-2775, provide the serial number and specifications of the iMac, and for a fee, order a set of the original system discs.
    If you do an Erase & Install of the original OS, you can then update the Firmware.
    ali b

  • IPOD Shuffle not recognized by computer, and caused a  USB power surge

    Device is not recognized by computer, and I tried the listed support recommendations.
    The problem originated when I plugged the IPOD shuffle directly into the computer USB ( not using a hub), and this caused a warning window to appear saying unknown device has caused a power surge to this port, and most be removed. Prior to this event, the IPOD shuffle has worked (with direct contact with computer usb or through a powered highspeed usb hub) without issue for nearly 1 year. Any taker's on this issue? Thanks.

    Hi JBR,
    Go to your control panel and click on Install/Uninstall programs. Scroll down and see if you have multiple versions of the ipod updater installed on your computer. If you do, then uninstall both versions. Reboot your computer.
    Next, go to the downloads page and download/install the 1-10-2006 ipod updater. Once installed, go to your start programs and select ipod updater from there. Plug in your ipod and wait a moment. If it's like mine, it'll recognize your ipod and then you can do a "restore" for a clean format.
    After that, open itunes and life should be good.
    Hope this helps!

  • HT6001 the version 11.1.4 of iTunes not working good because it's not recognizing my iPhone and I can't do anything.

    the version 11.1.4 of iTunes not working good because it's not recognizing my iPhone and I can't do anything.

    Go to Control Panel > Add or Remove Programs (Win XP) or Programs and Features(Later)
    Remove all of these items in the following order:
    iTunes
    Apple Software Update
    Apple Mobile Device Support (If this won't uninstall press on)
    Bonjour
    Apple Application Support
    Reboot, download iTunes, then reinstall, either using an account with administrative rights, or right-clicking the downloaded installer and selecting Run as Administrator.
    See also HT1925: Removing and Reinstalling iTunes for Windows XP or HT1923: Removing and reinstalling iTunes for Windows Vista, Windows 7, or Windows 8
    Should you get the error iTunes.exe - Entry Point Not Found after the above reinstall then copy QTMovieWin.dll from:
    C:\Program Files (x86)\Common Files\Apple\Apple Application Support
    and paste into:
    C:\Program Files (x86)\iTunes
    The above paths would be for a 64-bit machine. Hopefully the same fix with the " (x86)" omitted would work on 32-bit systems with the same error.

  • I just purchased Adobe Photoshop Elements 13 but my computer is not recognizing my CDRom and I cannot download the program. I tried copying the files on the program disc to my hard drive but get a message the installer will not work. I have the redemption

    I just purchased Adobe Photoshop Elements 13 but my PC is not recognizing my CDRom and I cannot download the program. I tried copying the files on the program disc to my hard drive but get a message the installer will not work. I have the redemption code and serial numbers. Can I download the program online somewhere? If I download a trial version for instance will it allow me to enter my serial number and use it for the full program?

    Downloads available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4 | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  13 | 12 | 11, 10 | 9, 8, 7 win | 8 mac | 7 mac
    Photoshop Elements:  13 |12 | 11, 10 | 9,8,7 win | 8 mac | 7 mac
    Lightroom:  5.6| 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • Illustrator not recognizing some fonts and colors.

    My recently installed Illustrator is not recognizing certain fonts and colors which is producing problems in my designs.
    1. When I drag in a PDF to edit, the letters will appear as gibberish (random numbers, letters and signs) (the font was "arquitectura" which is installed on my OS X I Mac)
    2. When I try to change the color of a font using the eyedropper tool, it shows the proper color in the color box, but the font remains black.
    After googling it, these problems seem frequent back in 2009 but not so much today.  Im thinking it has something to do with this, which prompts when I open the application:
    "Your application install seems to be damaged, Please reinstall the application."

    sugarfactory,
    "Your application install seems to be damaged, Please reinstall the application."
    Obviously, you should. It is best to run the Cleaner Tool between uninstalling and reinstalling.
    Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6

  • I recently did a factory restore on my imac mountain lion, but when i try to download OS x again apple is not recognizing my id and password

    I recently did a factory restore on my imac mountain lion, but when i try to download OS x again apple is not recognizing my id and password

    So, what exactly did you do for a "factory restore"? Which method did you try?
    Did you go to the app store > Purchases? Is it listed there?
    Or, did you try using the recovery method (Command + R keys or Command + Option + R keys while restarting)? Are you able/unable to reach Apple's servers to download the OS?

  • My ipod touch is not recognized on itunes and will not turn on or give me the battery sign. I have tried toubleshooting it by holding down the home button and the sleep/wake button, but it doesn't work. What do I do to fix it?

    My ipod touch is not recognized on itunes and will not turn on or even give me the battery sign that it is dead. I turned it off and it won't turn back on now. The screen is completely black and won't do anything. I have tried charging it over night and nothing happened. It was never near water. I have tried troubleshooting it by holding down the home button and the sleep/wake button, but nothing happened and it didn't work. What can I do to fix it?

    Device Not Recognised
    For PC
    http://support.apple.com/kb/TS1538
    For Mac
    http://support.apple.com/kb/ts1591

  • Iphone 4 is not recognized by itunes and is only on emergency mode, keeps telling me to connect to itunes but when I connect iphone to computer it does not recognize it

    iphone 4 is not recognized by itunes and is only on emergency mode, keeps telling me to connect to itunes but when I connect iphone to computer it does not recognize it

    Did you try recovery mode?  Hold down the home button as you connect it to iTunes.  iTunes should pop up a window that says "iTunes has detected a device in recovery mode" and give you the option to restore.

  • Ipod touch is not recognized by itunes and i have executed all steps in the apple suggested troubleshooting, the device will not reboot either.  Any suggestions?

    ipod touch is not recognized by itunes and i have executed all steps in the apple suggested troubleshooting, the device will not reboot either.  Any suggestions?

    Does it light up at all? If not, you could have a battery issue.
    Basic troubleshooting steps  
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 
    Got problems with your Apple iDevice-like iPhone, iPad or iPod touch? Try Troubleshooting 101

  • Ipod not recognized in windos and itunes after udating software

    My ipod was working just fine. But then itunes said that my ipod software was not updated so I went ahead and updated, after that is not recognized in windows and itunes.it does not even turn on, when i press a button in the screen apears a electric plug, like if it was saying connect to charge. but the only thing that happens when i plug it to the computer is that the same plug apears again in the screen.
    thank you for your help

    If your iPod is showing a picture that looks like the wall plug, then it does need to be connected to the USB wall charger. Sometimes other devices that will charge the iPod (such as a car charger or a docking station) will do the trick.
    If you're near any Apple retail stores you could take your iPod there and see if they have one they can connect your iPod to for you, and then you'll have it up and running again.
    CG

  • My Ipod touch 4G is not recognized by Itunes and by any computer... what can I do?

    My Ipod touch 4G is not recognized by Itunes and by any computer... what can I do?

    Take a look at this link, http://support.apple.com/kb/TS1591

  • TS3648 great, but my MBA did not come with an installion disc, only a tiny jump drive that is not recognized by windows; and I can't get the contents of that burned to a DVD either. So how the heck do I get the drivers into Windows 7? My MBA has bootcamp

    great, but my MBA did not come with an installion disc, only a tiny jump drive that is not recognized by windows; and I can't get the contents of that burned to a DVD either. So how the heck do I get the drivers into Windows 7? My MBA has bootcamp 3.0.4.

    Here's what I get:
    lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    inet 127.0.0.1 netmask 0xff000000
    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
    gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
    stf0: flags=0 mtu 1280
    en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 00:11:24:7d:e7:1e
    media: autoselect (none) status: inactive
    supported media: none autoselect 10baseT/UTP <half-duplex> 10baseT/UTP <full-duplex> 10baseT/UTP <full-duplex,hw-loopback> 100baseTX <half-duplex> 100baseTX <full-duplex> 100baseTX <full-duplex,hw-loopback>
    en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    inet6 fe80::211:24ff:fe28:2e71%en1 prefixlen 64 scopeid 0x5
    inet 169.254.115.141 netmask 0xffff0000 broadcast 169.254.255.255
    ether 00:11:24:28:2e:71
    media: autoselect status: active
    supported media: autoselect
    fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 2030
    lladdr 00:11:24:ff:fe:7d:e7:1e
    media: autoselect <full-duplex> status: inactive
    supported media: autoselect <full-duplex>

  • Ipod nano not recognized by pc and will not turn on

    ipod nano not recognized by pc and will not turn on

    iPod not recognized in 'My Computer' and in iTunes for Windows 

  • HT1339 My ipod was not recognized by itunes and not does not power on after I restarted the ipod service in the Windows admin tools. I cannot restore the ipod since it is not recognized by my PC now. Any suggestions?

    My ipod was not recognized by itunes and not does not power on after I restarted the ipod service in the Windows admin tools. I cannot restore the ipod since it is not recognized by my PC now. Any suggestions?

    Time to replace it: $49 2nd Gen shuffle at online Apple Store...

Maybe you are looking for

  • External Hard Drive that Both OS and Windows can use

    I just bought a MacBook Pro for my son @ college. I've installed bootcamp because we have a large volume of windows software. (I also like the features of the Apple). I'm trying to make this as bulletproof as I can (since I won't be around to act as

  • Is there a way to track an Iphone 5 or add "findmy iPhone" app to the phone after the pnone has been lost?

    My daughter lost her iPhone 5 in Las Vegas. She said that it has Findmy iPhone app however, it does not show up on the site. Can I access the phone remotely to leave a message that it is lost? Can I set up find my iPhone if it does not have it after

  • Missing features on iPhoto for iOS 7

    After the announcement of redesigned apple apps, I immediately downloaded the new iPhoto for iOS. Aesthetically, this new iphoto is more clutter free than the previous version. However, a lot of very important features on the previos version is missi

  • Cannot find role xi_jpr_register_bindings

    I get into the Identity management of NWA, I cannot find  any xi_* or XI_*  roles. Please help understand why?   Version is PI7.00 SPS 09.   Points guaranteed. Thanks!

  • Setting user permissions when running commands

    Here's a doosey, Looking to implement a system which will run "commands" being recieved from the network from a bunch of different users. I want the users to have different permissions depending on their username. I'm thinking the backing store as be