我有一個按鈕,在.h文件中IBAction爲,按鈕,相機
@interface UserProfileVC : UIViewController <UIImagePickerControllerDelegate>{
IBOutlet UIButton *camera;
}
@property (nonatomic,retain) IBOutlet UIButton *camera;
-(IBAction)cameraPress:(id)sender;
而且在我的.m文件中聲明我的界面我有:
-(IBAction)cameraPress:(id)sender{
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
// [picker setDelegate:self];
[picker setAllowsEditing:YES];
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:picker animated:YES];
[picker release];
}
但我有此錯誤:
*** -[UserProfileVC performSelector:withObject:withObject:]: message sent to deallocated instance 0x7bc2a40
有人可以幫我嗎?我不明白什麼是錯誤。 感謝
有看看這個[鏈接](http://stackoverflow.com/questions/601074/objective-c-message-sent-to-deallocated-instance-0x5633b0)。 –
好吧,我插入..我見過的方法viewDidLoad運行2次...爲什麼? – PsyKoWebMari
現在我有: '2012-06-09 14:41:08.556 SQL [612:11603] INIT 0x7dac3f0 2012-06-09 14:41:08.557 SQL [612:11603] INIT 0x7da87c0 2012-06-09 14:41:10.475 SQL [612:11603] *** - [UserProfileVC performSelector:withObject:withObject:]:發送到釋放實例的消息0x7dac3f0' – PsyKoWebMari