• 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
Re: Beginner problem with multiple NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Beginner problem with multiple NSTableView


  • Subject: Re: Beginner problem with multiple NSTableView
  • From: James Housley <email@hidden>
  • Date: Thu, 20 Jan 2005 19:13:25 -0500

Guy English wrote:
Hi,

On Thu, 20 Jan 2005 18:50:07 -0500, James Housley <email@hidden>

This will work as long as you keep _numFeeds and _numItems updated.
Why don't you just return [_feedsList count] and [_numItems count] respectively?

Probably because that is what the example I started with did. But that looks much better.



- (int)numberOfRowsInTableView:(NSTableView *)aView
{
       if (aView = Feeds_Required_Files) {
               return _numFeeds;
       }
       else if (aView = Items_Required_Items) {
               return _numItems;
       } else {
               NSLog(@"numberOfRowsInTableView returning 0");
               return 0;
       }
}


This code is correct except you're assigning in your if statement.

if ( aView = Feeds_Required_Files ) will always be true you need:
if ( aView == Feeds_Required_Files )

You do the same thing with the if ( aView = Items_Required_Items ) line.


DUH!!!!!!!!!!!!!!!!!!!!!!! You are right and I feel soooo stupid for that.

Since you're using the valueForKey thing and you're getting your keys
directly from the table view column headers - make *sure* you spelt
them correctly in IB.


Thanks, back to our regularly scheduled programming

--
/"\   ASCII Ribbon Campaign  .
\ / - NO HTML/RTF in e-mail  .
 X  - NO Word docs in e-mail .
/ \ -----------------------------------------------------------------
email@hidden      http://www.FreeBSD.org     The Power to Serve
email@hidden  http://www.TheHousleys.net
---------------------------------------------------------------------
The wise man built his network upon Un*x.
    The foolish man built his network upon Windows.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

 _______________________________________________
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

References: 
 >Beginner problem with multiple NSTableView (From: James Housley <email@hidden>)
 >Re: Beginner problem with multiple NSTableView (From: Jonathan Jackel <email@hidden>)
 >Re: Beginner problem with multiple NSTableView (From: James Housley <email@hidden>)
 >Re: Beginner problem with multiple NSTableView (From: mmalcolm crawford <email@hidden>)
 >Re: Beginner problem with multiple NSTableView (From: James Housley <email@hidden>)
 >Re: Beginner problem with multiple NSTableView (From: Guy English <email@hidden>)

  • Prev by Date: Re: Creating Cocoa Windows from Command Line Apps
  • Next by Date: Basic Array Access Strategy
  • Previous by thread: Re: Beginner problem with multiple NSTableView
  • Next by thread: Re: Beginner problem with multiple NSTableView
  • Index(es):
    • Date
    • Thread