Disappearing UILocation alerts in XCode 4.2 with ARC iPhone

后端 未结 1 1856
谎友^
谎友^ 2021-01-14 02:08

The alerts appear for a split-second or did not show when application launches in project with ARC (without using ARC all it\'s OK). (I add CoreLocation framework and I impo

相关标签:
1条回答
  • 2021-01-14 03:01

    You are storing the location manager pointer in a local variable. So ARC is free to release that location manager before returning from this method.

    If you wish to keep that location manager alive for longer you need to keep a longer term strong reference to it. Like an ivar or property.

    0 讨论(0)
提交回复
热议问题