gpt4 book ai didi

ios - 如何将整数发送到类型 id 的指针

转载 作者:行者123 更新时间:2023-11-29 13:47:12 25 4
gpt4 key购买 nike

对于某些人来说,这可能是一个简单的问题。对我来说很头疼。如何在此方法中将整数作为 id 对象发送:

    [self performSelectorOnMainThread:@selector(requestImageAtIndex:) withObject:index waitUntilDone:NO];

Index 是这里的整数。

提前谢谢大家。

附言“没有愚蠢的问题,只有愚蠢的答案。”编码(marshal)勒布

最佳答案

为什么不把它包装在 NSNumber 对象中呢?

[self performSelectorOnMainThread:@selector(requestImageAtIndex:)
withObject:[NSNumber numberWithInteger:index]
waitUntilDone:NO];

关于ios - 如何将整数发送到类型 id 的指针,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6855939/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com