gpt4 book ai didi

ios - 如何用键值替换 objectAtIndex?

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

我想使用 NSMutableArray 中的 ValueForKey 替换 objectAtIndex。我已经尝试了下面的代码,但是没有用,它崩溃了,

[[students valueForKey:@"time"]replaceObjectAtIndex:indexPath.row withObject:dateString];

学生数组将包含:

(
{
content = "\U0627\U064e\U0644\U0652\U062d\U064e\U0645\U0652\U062f\U064f \U0644\U0650\U0644\U0651\U0670\U0647\U0650 \U0627\U0644\U064e\U0651\U0630\U0650\U064a\U0652 \U0643\U064e\U0633\U064e\U0627\U0646\U0650\U064a\U0652 \U0647\U0670\U0630\U064e\U0627 (\U0627\U0644\U062b\U064e\U0651\U0648\U0652\U0628\U064e) \U0648\U064e\U0631\U064e\U0632\U064e\U0642\U064e\U0646\U0650\U064a\U0652\U0647\U0650 \U0645\U0650\U0646\U0652 \U063a\U064e\U064a\U0652\U0631\U0650 \U062d\U064e\U0648\U0652\U0644\U064d \U0645\U0650\U0651\U0646\U0650\U0651\U064a\U0652 \U0648\U064e\U0644\U0627\U064e \U0642\U064f\U0648\U064e\U0651\U0629\U064d.";
heading = "GETTING DRESSED";
id = 1;
mp3 = 101;
time = "11:14 AM";
translation = "Praise be to Allah who has clothed me with this (garment) and provided it for me though I was powerless myself and incapable.";
transliteration = "cvcvccvc.";
},
{
content = "(\U0628\U0650\U0633\U0652\U0645\U0650 \U0627\U0644\U0644\U0651\U0670\U0647\U0650) \U0627\U064e\U0644\U0644\U0651\U0670\U0647\U064f\U0645\U064e\U0651 \U0625\U0650\U0646\U0650\U0651\U064a\U0652 \U0623\U064e\U0639\U064f\U0648\U0652\U0630\U064f \U0628\U0650\U0643\U064e \U0645\U0650\U0646\U064e \U0627\U0644\U0652\U062e\U064f\U0628\U0652\U062b\U0650 \U0648\U064e\U0627\U0644\U0652\U062e\U064e\U0628\U064e\U0627\U0626\U0650\U062b\U0650.";
heading = "ENTERIGN THE RESTROOM";
id = 3;
mp3 = 103;
time = "11:20 AM";
translation = "(Before entering) [In the name of Allah]. (Then) Oh Allah, I seek protection in You from the male and female unclean spirits.";
transliteration = "cvcvc";
},
{
content = "\U0627\U064e\U0644\U0644\U0651\U0670\U0647\U064f\U0640\U0645\U064e\U0651 \U0623\U063a\U0650\U062b\U0652\U0646\U064e\U0627\U060c \U0627\U064e\U0644\U0644\U0651\U0670\U0647\U064f\U0645\U064e\U0651 \U0623\U063a\U0650\U062b\U0652\U0646\U064e\U0627\U060c \U0627\U064e\U0644\U0644\U0651\U0670\U0647\U064f\U0645\U064e\U0651 \U0623\U064e\U063a\U0650\U062b\U0652\U0646\U064e\U0627.";
heading = "INVOCATIONS FOR RAIN";
id = 6;
mp3 = 106;
time = "11:29 AM";
translation = "O Allah, send us rain. O Allah, send us rain. O Allah, send us rain.O Allah, send us rain. O Allah, send us rain. O Allah, send us rain.";
transliteration = "cvcvc";
}
)

请帮助某人,我是新手。谢谢。

最佳答案

NSMutableDictionary *dict = [students ObjectAtIndex:indexPath.row];
[dict setValue:dateString forKey:@"time"];
[students replaceObjectAtIndex:indexPath.row withObject:dict];

希望对你有帮助

关于ios - 如何用键值替换 objectAtIndex?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31086927/

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