• 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: dumb question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dumb question


  • Subject: Re: dumb question
  • From: WT <email@hidden>
  • Date: Fri, 12 Jun 2009 14:58:59 +0200

I have the following in a project of mine, in a file Constants.h, which I import as needed from other source files:

#define kAppFrame ([UIScreen mainScreen].applicationFrame)
#define kScreenWidth ([UIScreen mainScreen].bounds.size.width)
#define kScreenHeight ([UIScreen mainScreen].bounds.size.height)
#define kStatusBarHeight (kScreenHeight - kAppFrame.size.height)


So, in your case, why not something like the following?

#define kScreenBounds           ([[UIScreen mainScreen] bounds])

On Jun 12, 2009, at 12:36 PM, Chunk 1978 wrote:

maybe this coffee hasn't kicked in yet and undoubtedly there is a
simple solution, but i'm trying unsuccessfully to refactor some code,
and i'd like to set the following as a static or define instead of
having it written several times in several methods

-=-=-=-
CGRect fullScreenRect = [[UIScreen mainScreen] bounds];
-=-=-=-

how can i do that?
_______________________________________________

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: 
 >dumb question (From: Chunk 1978 <email@hidden>)

  • Prev by Date: Re: problems with scripting
  • Next by Date: Re: [NSTask] -launch return
  • Previous by thread: dumb question
  • Next by thread: Re: dumb question
  • Index(es):
    • Date
    • Thread