V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
Livid
266.39D
578.54D
V2EX  ›  iDev

通过 NSNotificationCenter 接收到的对象是否应该 retain 呢?

  •  
  •   Livid ·
    PRO
    · Feb 23, 2011 · 5893 views
    This topic created in 5543 days ago, the information mentioned may be changed or developed.
    SomeObject * foo = [[notification object] retain];
    // Do something with foo
    // ...
    [foo release];


    -OR-

    SomeObject * foo = [notification object];
    // Just do something with foo
    // ...
    2 replies    1970-01-01 08:00:00 +08:00
    jjgod
        1
    jjgod  
       Feb 23, 2011
    不用。
    Livid
        2
    Livid  
    MOD
    OP
    PRO
       Feb 23, 2011
    @jjgod Thank you :)
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5827 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 144ms · UTC 01:51 · PVG 09:51 · LAX 18:51 · JFK 21:51
    ♥ Do have faith in what you're doing.