【发布时间】:2012-07-20 15:14:35
【问题描述】:
这是我的第一个问题。
我正在尝试以编程方式更改UIButton 的背景图像,但有一个问题,我找不到背景图像的键。
为了理解,这是我的代码:
[[self.view viewWithTag:69000+i] setValue:[UIImage imageNamed:[NSString stringWithFormat:@"%d-options.png", i+1]] forKey:@"backgroundImage"];
执行此操作时,应用程序崩溃。给出这个错误:
线程 1:信号 SIGTRAP 在 main.m
并在调试器中:(lldb)
那么,如果我是对的并且崩溃是由不正确的键(backgroundImage)引起的,那么引用背景图像的键是什么?
非常感谢!!
PD:我需要 self.view viewWithTag 来完成......
【问题讨论】:
标签: ios xcode image uibutton setvalue