• 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: Modeling a seat reservation: iPhone
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modeling a seat reservation: iPhone


  • Subject: Re: Modeling a seat reservation: iPhone
  • From: Quincey Morris <email@hidden>
  • Date: Mon, 8 Mar 2010 09:55:37 -0800

On Mar 8, 2010, at 09:13, Gustavo Pizano wrote:

> I was reading some older post about something similar. What I want to achieve is that I have a room with seats and I want to check the seats to reserve. Now I did something alike in Cocoa retrieving  the view under the hitTest, then I got the id of the view (custom identification) and then I new which number shall I reserve.
>
> Btu for iPhone I dunno how big this process might be, Im talking about 220 - 250 seats. I was thinking in  placing inside a UIScrollView my map of seats and a button with a tag identifier for each seat in a button grid, but im not happy with having so many buttons.
>
> Then I thought making CGPaths, but then to check which path contains the touch point... ???? :S:S:S  not nice.
>
> Any idea how can I achieve this in a fancy "easy" solution?
>
> knowing that the server will tell me whats reserve already I must color each seat and don't allow touch events on that area, or well at least don't respond to them.

Using hundreds of buttons seems a bit heavy-handed even for the Mac, let alone iPhone. Any kind of one-subview-per-seat solution seems undesirable.

Even constructing hundreds of paths to hit-test screen locations seems like overkill.

If you have a room with seats, likely the room has a small number of sections (maybe only one) in which seats are laid out in a grid. Therefore you only need to keep the bounds of each section. It should be straightforward to translate a touch location into a grid position mathematically.

Or, in the worst case, keep each seat as a separate rectangle and test the touch location against the rectangles.

If you need non-rectangular hit testing, then it's still likely better to test against rectangular bounds rects first, and test against a more complex shape only when the first test succeeds.



_______________________________________________

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: 
 >Modeling a seat reservation: iPhone (From: Gustavo Pizano <email@hidden>)

  • Prev by Date: Re: Weird Bug Report on 10.5
  • Next by Date: Re: CA transition suddenly too fast
  • Previous by thread: Modeling a seat reservation: iPhone
  • Next by thread: [MEET] Chicago CocoaHeads / CAWUG tomorrow 7:00 @ Apple Store
  • Index(es):
    • Date
    • Thread