如果我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. IOS內存和內存管理
- 3. removeFromSuperview和內存管理
- 4. UIView和內存管理
- 5. NSString和NSData內存管理
- 6. UIPopoverController和內存管理
- 7. popToViewController和內存管理
- 8. HoughLinesP和opencv內存管理
- 9. 內存和範圍管理
- 10. 內存管理和Tkinter
- 11. iOS和內存管理
- 12. memcpy和內存管理pcap
- 13. iPhone:CoreGraphics和內存管理
- 14. 內存管理
- 15. 內存管理
- 16. 內存管理
- 17. 內存管理
- 18. 內存管理
- 19. 內存管理
- 20. 內存管理
- 21. 內存管理
- 22. 內存管理
- 23. 託管位圖和內存管理
- 24. 內存管理和異常處理
- 25. CoreData內存管理
- 26. NSMutableArray - 內存管理
- 27. mips內存管理
- 28. iPhone內存管理
- 29. iPhone內存管理
- 30. HttpClient內存管理
只有[alert show]是顯示警報的常用方式,其餘與此無關。 – JustSid 2010-12-06 10:14:11