के माध्यम से डेटा पास करना मैं एक एनएसटीमर कॉल के लिए userInfo के माध्यम से डेटा पास करने का प्रयास कर रहा हूं। इसे करने का बेहतरीन तरीका क्या है? मैं एक NSDictionary का उपयोग करने की कोशिश कर रहा हूं, जब मेरे पास उद्देश्य-सी ऑब्जेक्ट्स है, तो यह इतना आसान है, लेकिन अन्य डेटा के बारे में क्या है? मैं कुछ इस तरह है, जो उसी रूप में काम नहीं करता है क्या करना चाहते हैं:NSTimer UserInfo
- (void)play:(SystemSoundID)sound target:(id)target callbackSelector:(SEL)selector
{
NSLog(@"pause ipod");
[iPodController pause];
theSound = sound;
NSMutableDictionary *cb = [[NSMutableDictionary alloc] init];
[cb setObject:(id)&sound forKey:@"sound"];
[cb setObject:target forKey:@"target"];
[cb setObject:(id)&selector forKey:@"selector"];
[NSTimer scheduledTimerWithTimeInterval:0
target:self
selector:@selector(notifyPause1:)
userInfo:(id)cb
repeats:NO];
}
'cn' शून्य है जब आप '-notifyPause1:' प्राप्त करते हैं? –