• 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: How to make the Contextual Menu on the tableview's empty rows unable?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to make the Contextual Menu on the tableview's empty rows unable?


  • Subject: Re: How to make the Contextual Menu on the tableview's empty rows unable?
  • From: Graham Cox <email@hidden>
  • Date: Thu, 23 Jul 2009 13:12:25 +1000


On 23/07/2009, at 1:03 PM, Bright wrote:

Hi everyone:

In the "Controller" class, I used the code as follows to finished the contextual menu

on the table view. And I succeeded.

[]

Now I hope the contextual menu disappears in the empty rows. And it is only valid in the

rows which hold data. But I don't know how to implement the purpose...




Any help greatly appreciated.


The menu is attached to the table view, so will appear no matter where you click.

You could override -menuForEvent: and check the mouse location against the rows and return nil for empty rows, or invoke super for populated rows. But that means subclassing the table.

--Graham


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >How to make the Contextual Menu on the tableview's empty rows unable? (From: Bright <email@hidden>)

  • Prev by Date: How to make the Contextual Menu on the tableview's empty rows unable?
  • Next by Date: Core Animation rendering problem
  • Previous by thread: How to make the Contextual Menu on the tableview's empty rows unable?
  • Next by thread: Core Animation rendering problem
  • Index(es):
    • Date
    • Thread