开发者

how to set delegate to nil?

开发者 https://www.devze.com 2023-02-28 14:36 出处:网络
my table view controller calls below in viewDidLoad myFBRequest= [facebook requestWithGraphPath:[NSString stringWithFormat:@\"%@/feed\", myId] andDelegate:self];

my table view controller calls below in viewDidLoad

myFBRequest= [facebook requestWithGraphPath:[NSString stringWithFormat:@"%@/feed", myId] andDelegate:self];

and in dealloc,

if (myFBRequest) myFBRequest=nil;

I do that because if user clicks on back button, I wanna ignore the response that came or coming back.

however, I get the below error

* -[FB开发者_JS百科Request setDelegate:]: message sent to deallocated instance 0x823e190

Why is that? I thought I have to set delegate to nil if I dont' want the response anymore?

I'm so confused.

Any help would be appreciated

Thanks, Bec


yes you can pass in andDelegate:nil if you don't want to response delegates.

0

精彩评论

暂无评论...
验证码 换一张
取 消