如果我alloc unit
UIAlertview然後show
它。我應該release
嗎show
還是應該我autorelease
呢?Uialertview和內存管理
1
A
回答
2
這是顯示警告的常見方式:演出結束後
UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"Title:"
message: @"The Message"
delegate: self
cancelButtonTitle: @"OK"
otherButtonTitles: nil];
[alert show];
[alert release];
2
釋放。它將保留自己直到不再需要。
0
這是一種很好的編程風格來手動發佈它。 Autorelease也會在同一時間做同樣的事情。所以它可能也會釋放後者。
相關問題
- 1. UIAlertView和cocos2d內存管理
- 2. UIAlertView中和內存泄漏
- 3. IOS內存和內存管理
- 4. NSString和NSData內存管理
- 5. UIPopoverController和內存管理
- 6. HoughLinesP和opencv內存管理
- 7. 內存管理和Tkinter
- 8. popToViewController和內存管理
- 9. 內存管理和進程
- 10. 會話管理和內存
- 11. UIView和內存管理
- 12. iPhone:CoreGraphics和內存管理
- 13. iOS和內存管理
- 14. memcpy和內存管理pcap
- 15. 塊和內存管理
- 16. Xamarin UIPageViewController和內存管理
- 17. 內存和範圍管理
- 18. removeFromSuperview和內存管理
- 19. 內存管理
- 20. 內存管理
- 21. 內存管理
- 22. 內存管理
- 23. 內存管理
- 24. 內存管理
- 25. 內存管理
- 26. 內存管理
- 27. 內存管理
- 28. 內存管理
- 29. 內存管理
- 30. 內存管理
只有[alert show]是顯示警報的常用方式,其餘與此無關。 – JustSid 2010-12-06 10:14:11