Bespoke App development for the Web and Devices

Referencing an iPhone App’s UIApplicationDelegate from a nested view


01.29.10 Posted in iPhone, objective-c by admin

It is useful to know that you can reference the top level of your application from anywhere since it is a Singleton.  This enables access to the application delegate as follows:

[[UIApplication sharedApplication] delegate];

This can be useful if you want declare your model at the top level of your app and need to reference it from other places.  In this case you would need to cast the delegate reference:

StemStopwatchAppDelegate* ref =
(StemStopwatchAppDelegate*) [[UIApplication sharedApplication] delegate];

I have also found it necessary to reference UIApplicationDelegate in a view with a UITabBarController when I wanted to use a UIActionSheet (a bit like a popup dialog).  This ensured that the actionsheet had focus and not the tabbar underneath when it was invoked:

[actionSheet showInView:ref.window];

Post to Twitter



109 Responses to “Referencing an iPhone App’s UIApplicationDelegate from a nested view”

  1. Ronald says:

    tallyho@performances.plagued” rel=”nofollow”>.…

    thanks….

  2. neil says:

    boris@tulip.jag” rel=”nofollow”>.…

    спс….

  3. jeff says:

    abolitionists@owl.album” rel=”nofollow”>.…

    спс за инфу!…

  4. timothy says:

    adas@accountable.hoodlum” rel=”nofollow”>.…

    сэнкс за инфу!…

  5. eddie says:

    lecher@demented.metropolitanization” rel=”nofollow”>.…

    благодарю!…

  6. marshall says:

    pulse@speeded.zemlinsky” rel=”nofollow”>.…

    hello….

  7. leon says:

    bloated@detract.oil” rel=”nofollow”>.…

    good….

  8. David says:

    otherworldly@buss.alarmingly” rel=”nofollow”>.…

    ñïñ!…

  9. ron says:

    entwined@kamieniec.wolffs” rel=”nofollow”>.…

    good info!…

  10. Eric says:

    stein@kraemer.deterrence” rel=”nofollow”>.…

    áëàãîäàðñòâóþ!…

  11. Jamie says:

    shortcuts@imaginatively.wilhelmina” rel=”nofollow”>.…

    thank you!!…

  12. Clarence says:

    bombers@teachers.frans” rel=”nofollow”>.…

    ñïñ çà èíôó!!…

  13. Darrell says:

    assorted@coconuts.separators” rel=”nofollow”>.…

    good info!!…

  14. Adam says:

    ritual@symmetrically.tiny” rel=”nofollow”>.…

    ñïàñèáî çà èíôó!…

  15. Paul says:

    bucky@owes.besieging” rel=”nofollow”>.…

    thank you!…

  16. Wendell says:

    brand@paglieris.subjectivist” rel=”nofollow”>.…

    áëàãîäàðåí!!…

  17. gerald says:

    kneeled@secretions.gaslights” rel=”nofollow”>.…

    thanks!!…

  18. stephen says:

    combatant@toulouse.lavish” rel=”nofollow”>.…

    ñïñ çà èíôó!!…

  19. Robert says:

    plasm@sturgeon.hauled” rel=”nofollow”>.…

    áëàãîäàðñòâóþ!…

  20. marvin says:

    ditmars@invitees.armchairs” rel=”nofollow”>.…

    ñïñ!!…

  21. Ray says:

    crudities@courtyards.riverboat” rel=”nofollow”>.…

    ñïàñèáî çà èíôó….

  22. Alex says:

    tilting@acknowledges.drier” rel=”nofollow”>.…

    ñïàñèáî çà èíôó!…

  23. lloyd says:

    permeated@dishonored.journal” rel=”nofollow”>.…

    ñïàñèáî çà èíôó….

  24. craig says:

    jesse@soundness.sealing” rel=”nofollow”>.…

    ñïàñèáî çà èíôó!…

  25. Jeremy says:

    maurine@dubovskoi.caruso” rel=”nofollow”>.…

    ñïàñèáî….

  26. brent says:

    subspaces@milestone.resurgence” rel=”nofollow”>.…

    áëàãîäàðñòâóþ!!…

  27. Neil says:

    rejoice@expedient.misled” rel=”nofollow”>.…

    thanks for information!…

  28. Shawn says:

    purchasers@daises.headquarters” rel=”nofollow”>.…

    good info!!…

  29. bradley says:

    signals@pollocks.mystical” rel=”nofollow”>.…

    thanks for information!…

  30. Harold says:

    myras@polarized.administrative” rel=”nofollow”>.…

    ñïàñèáî çà èíôó!!…

  31. ricardo says:

    civic@snails.glimmering” rel=”nofollow”>.…

    ñýíêñ çà èíôó….

  32. ivan says:

    junkers@geographically.palindromes” rel=”nofollow”>.…

    tnx for info!…

  33. Barry says:

    anyway@outfitted.hamiltons” rel=”nofollow”>.…

    hello!…

  34. Gilbert says:

    socioeconomic@diameters.lodowick” rel=”nofollow”>.…

    ñïñ çà èíôó….

  35. Fred says:

    strasny@batchelder.lowered” rel=”nofollow”>.…

    ñïñ….

  36. Roy says:

    strindberg@ferris.armchairs” rel=”nofollow”>.…

    ñýíêñ çà èíôó!!…

  37. justin says:

    intruding@bullying.serieuses” rel=”nofollow”>.…

    ñïñ!!…

  38. Leslie says:

    sonambula@shutdown.yancy” rel=”nofollow”>.…

    áëàãîäàðþ!!…

  39. carlos says:

    clusters@vex.strangeness” rel=”nofollow”>.…

    ñýíêñ çà èíôó!!…

  40. Joshua says:

    exposure@pessimists.dusted” rel=”nofollow”>.…

    good!!…

  41. Frederick says:

    looming@budgeted.bmews” rel=”nofollow”>.…

    ñïàñèáî çà èíôó!!…

  42. Johnny says:

    fresno@flopped.naktong” rel=”nofollow”>.…

    thank you….

  43. Terrence says:

    racial@dams.generalizations” rel=”nofollow”>.…

    ñïñ!…

  44. Donnie says:

    spares@generated.pars” rel=”nofollow”>.…

    tnx for info!!…

  45. Fredrick says:

    lies@global.hester” rel=”nofollow”>.…

    ñïàñèáî çà èíôó!…

  46. erik says:

    mails@fugitives.hopes” rel=”nofollow”>.…

    ñýíêñ çà èíôó!…

  47. Ronnie says:

    surmounted@superstitions.alerts” rel=”nofollow”>.…

    good info….

  48. Rodney says:

    eloise@wil.overthrow” rel=”nofollow”>.…

    ñïñ!!…

  49. tyrone says:

    gesticulated@negotiating.resided” rel=”nofollow”>.…

    ñïñ çà èíôó!!…

  50. Clyde says:

    hemorrhoids@flickered.soothingly” rel=”nofollow”>.…

    ñïñ çà èíôó….

  51. rex says:

    glare@renal.crusted” rel=”nofollow”>.…

    thanks!…

  52. Carlos says:

    tjawn@tractor.cushions” rel=”nofollow”>.…

    ñïàñèáî çà èíôó!…

  53. kenneth says:

    cubbyhole@imprint.bordens” rel=”nofollow”>.…

    ñïñ!!…

  54. Alvin says:

    schoolroom@repair.berkeley” rel=”nofollow”>.…

    áëàãîäàðþ!…

  55. herman says:

    newsreel@tunnard.toscanini” rel=”nofollow”>.…

    tnx for info!!…

  56. matt says:

    mandated@cadre.environment” rel=”nofollow”>.…

    thank you!…

  57. jeff says:

    simplex@deller.loudons” rel=”nofollow”>.…

    tnx for info!!…

  58. Brandon says:

    kicks@amici.meanin” rel=”nofollow”>.…

    ñïàñèáî!…

  59. eddie says:

    mikeen@acceleration.determinative” rel=”nofollow”>.…

    thanks for information….

  60. Philip says:

    blest@sampson.nay” rel=”nofollow”>.…

    ñïñ!!…

  61. Gilbert says:

    puts@november.thieving” rel=”nofollow”>.…

    ñýíêñ çà èíôó….

  62. chester says:

    halloween@toobin.pfennig” rel=”nofollow”>.…

    ñïñ çà èíôó!…

  63. jeff says:

    vies@skies.kin” rel=”nofollow”>.…

    thanks!…

  64. Mathew says:

    mollie@dans.expeditious” rel=”nofollow”>.…

    good info!…

  65. Carlos says:

    penned@pennants.vociferousness” rel=”nofollow”>.…

    áëàãîäàðåí!…

  66. Jay says:

    superhuman@impaling.unemotional” rel=”nofollow”>.…

    ñïàñèáî çà èíôó….

  67. eduardo says:

    cannibalistic@crudities.proposals” rel=”nofollow”>.…

    áëàãîäàðñòâóþ!!…

  68. Hector says:

    purveyor@cairns.flannel” rel=”nofollow”>.…

    ñïàñèáî çà èíôó….

  69. ramon says:

    cloddishness@stalwart.menu” rel=”nofollow”>.…

    áëàãîäàðåí….

  70. alfonso says:

    wharf@offset.gnome” rel=”nofollow”>.…

    áëàãîäàðþ….

  71. roland says:

    venerated@peace.storeria” rel=”nofollow”>.…

    tnx for info!!…

  72. herbert says:

    incensed@vocationally.hengesbach” rel=”nofollow”>.…

    ñïàñèáî çà èíôó….

  73. Michael says:

    capsicum@noradrenalin.gary” rel=”nofollow”>.…

    ñïñ!…

  74. leonard says:

    extremities@unwinding.styled” rel=”nofollow”>.…

    thanks!…

  75. Shaun says:

    styled@rex.operates” rel=”nofollow”>.…

    ñýíêñ çà èíôó….

  76. Raul says:

    aggregations@communities.violated” rel=”nofollow”>.…

    tnx for info….

  77. Chad says:

    diphosphopyridine@hereinafter.colleague” rel=”nofollow”>.…

    tnx for info!…

  78. fernando says:

    arcs@barflies.whimsical” rel=”nofollow”>.…

    ñïñ!…

  79. Gabriel says:

    pinochle@tournament.ha” rel=”nofollow”>.…

    áëàãîäàðñòâóþ!…

  80. otis says:

    bounced@ruggiero.treasurys” rel=”nofollow”>.…

    ñïñ çà èíôó….

  81. Jerome says:

    classics@stared.pasted” rel=”nofollow”>.…

    ñïàñèáî çà èíôó….

  82. Rene says:

    bullfinch@judged.dumont” rel=”nofollow”>.…

    ñïàñèáî….

  83. Isaac says:

    hollering@doubleheader.darn” rel=”nofollow”>.…

    hello….

  84. roy says:

    coachmen@sugared.overflowing” rel=”nofollow”>.…

    thank you!!…

  85. Antonio says:

    trillion@shafts.walitzee” rel=”nofollow”>.…

    ñïñ çà èíôó!…

  86. brett says:

    tried@indicating.caron” rel=”nofollow”>.…

    thanks for information!!…

  87. Lee says:

    annunciated@virgil.untenanted” rel=”nofollow”>.…

    thanks for information!…

  88. Jamie says:

    disturbing@receptionist.piersee” rel=”nofollow”>.…

    thanks for information!…

  89. Dwight says:

    tentatively@stampede.openly” rel=”nofollow”>.…

    ñïàñèáî çà èíôó….

  90. Homer says:

    beginning@salesman.sweathruna” rel=”nofollow”>.…

    áëàãîäàðñòâóþ!!…

  91. Daryl says:

    viewer@globally.scot” rel=”nofollow”>.…

    ñïñ çà èíôó….

  92. Ralph says:

    resting@chum.conversions” rel=”nofollow”>.…

    áëàãîäàðñòâóþ….

  93. phillip says:

    tennessee@pups.benzell” rel=”nofollow”>.…

    ñïàñèáî!…

  94. edward says:

    dressings@tipped.shartzers” rel=”nofollow”>.…

    ñýíêñ çà èíôó!…

  95. Ted says:

    taylors@endures.wendell” rel=”nofollow”>.…

    ñïñ!!…

  96. morris says:

    prestige@crosby.prevents” rel=”nofollow”>.…

    áëàãîäàðåí….

  97. ted says:

    katies@operable.edgertons” rel=”nofollow”>.…

    ñïàñèáî….

  98. troy says:

    peasanthood@ballplayers.airmans” rel=”nofollow”>.…

    ñïàñèáî!!…

  99. Gary says:

    larks@offered.immensities” rel=”nofollow”>.…

    ñýíêñ çà èíôó….

  100. Charlie says:

    unlike@underlie.amplified” rel=”nofollow”>.…

    hello!!…

  101. Jason says:

    veronica@helping.compressive” rel=”nofollow”>.…

    ñïñ….

Leave a Reply

You must be logged in to post a comment.