exc-bad-access

UIImagePickerController EXC_BAD_ACCESS Error

烂漫一生 提交于 2019-12-12 00:28:38
问题 I set up my app to run like this: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]]; UIImagePickerController* picker = [[UIImagePickerController alloc] init]; self.viewController = picker; self.window.rootViewController = self.viewController; [self.window makeKeyAndVisible]; return YES; } After Image picker appears, I choose, for example, "Camera Roll".

c++/error :: exc_bad_access error code=1

落爺英雄遲暮 提交于 2019-12-11 22:50:12
问题 Im getting a runtime error of exc_bad_access ( code = 1, address=0x0) on line asize = **y[0] + **y[1]; in the summation function. I know the problem is not a memory leak, so i don't quite know how to go about solving this problem. void allocArr (int **&x, int ***&y, int **&q, int ****&z) { x = new int *[2]; y = new int **(&*x); q = &*x; z = new int ***(&q); } void summation(int ***&y, int arr[]) { int asize = 0; asize = **y[0] + **y[1]; **y[2] = *new int [asize]; *(arr + 2) = asize; } void

componentsJoinedByString gives me EXC_BAD_ACCESS

≯℡__Kan透↙ 提交于 2019-12-11 20:38:57
问题 I have an NSMutableArray i am trying to convert into a string. Declaring my NSMutableArray... NSMutableArray *listData; And later inside a method... NSString *foo = [listData componentsJoinedByString:@"|"]; NSLog(@"%@",foo); It seems no matter what i try i keep getting EXC_BAD_ACCESS. To make sure each element in my array was an NSString i also tried this... NSMutableArray *mArray = [[NSMutableArray alloc] init]; for (id ln in listData) { NSString *boo = [NSString stringWithFormat: @"%@",ln];

Ios error: Thread 1 under @auto release pool "EXC_BAD_ACCESS

我怕爱的太早我们不能终老 提交于 2019-12-11 19:22:16
问题 The app crashes and shows this error when I hit the Back button. I have 2 view controllers. On the first vc the Start button works fine to switch to second view, but when I hit the Back button the app crashes and I get the error above on the line below @autorelease pool. I will also post the code for my start & back buttons. thx :) #import #import "AppDelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate

Try get NSDate through forwardInvocation

南楼画角 提交于 2019-12-11 18:50:18
问题 I have a problem. I have method - (void)forwardInvocation:(NSInvocation *)anInvocation { SEL sel = anInvocation.selector; NSString *prop = [self.class fieldNameForSelector:sel]; if (prop) { BOOL setter = [self isSetter:sel]; __unsafe_unretained id obj; if (setter) { [anInvocation getArgument:&obj atIndex:2]; [self setValue:obj forKey:prop]; } else { obj = [self valueForKey:prop]; [anInvocation setReturnValue:&obj]; } } else { [super forwardInvocation:anInvocation]; } } But if I try to get

c++ vector bad access

那年仲夏 提交于 2019-12-11 18:25:22
问题 Hi I have the following c++ program: #include <iostream> #include <fstream> #include <vector> #include <sstream> #include <boost/foreach.hpp> #include <stdexcept> #include <boost/flyweight.hpp> #include <boost/lexical_cast.hpp> #include <boost/filesystem.hpp> namespace fs = boost::filesystem; struct entry { int file; std::vector<double> a; }; void my_file(const std::string&file, std::vector<entry> &data, int i){ try{ std::ifstream in(file.c_str()); entry e; std::string line; e.file = i; while

IBAction UIButton and EXC_BAD_ACCESS

↘锁芯ラ 提交于 2019-12-11 17:44:40
问题 in .h file I write -(IBAction)openShuffleForm; and .m -(IBAction)openShuffleForm{ NSLog(@"XXXXXXX"); } and connect with even touch up inside but when I run my program it error show this message -[UITouchData openShuffleForm]: unrecognized selector sent to instance 0x391cc20 ** What happen I don't know why? 回答1: Did you create the link between the button and the implementation? The implementing class should have an IBOutlet of type UIButton. Bind the IBOutlet to the button in Interface builder

iOS UITableView crashes when scrolling

耗尽温柔 提交于 2019-12-11 17:16:52
问题 I ran into a bizarre issue here. I'm developping an iOS app (for iPad, specifically), and I'm using an UITableView at some point to display a list of things. Now, when I scroll inside the bounds of the view (not above first element, and not below the last), it works okay. However, it just crashes violently when I scroll further than that, with no other messages than : EXC_BAD_ACCESS when I scroll down to the last element SIGABRT with a backtrace when I scroll upper than the first I looked on

UIAlertView exits EXC_BAD_ACCESS error

限于喜欢 提交于 2019-12-11 17:14:20
问题 I have such error: when I click navigationbar.backItemButton I'm showing UIAlertView with two buttons. When I press on any of them application terminates just with EXC_BAD_ACCESS. Method - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex don't called. How can I solve it? Thanx! //h - file @interface DetailsTableViewController : UITableViewController <UITextFieldDelegate, UIAlertViewDelegate> //m - file - (void)viewWillDisappear:(BOOL)animated { //if changes

EXC_BAD_ACCESS crash when switching back and forth between views

蓝咒 提交于 2019-12-11 15:28:07
问题 I'm getting a EXC_BAD_ACCESS crash when switching back and forth between views. I'm having a problem finding the cause of this crash. In the simulator it always goes back to the main.m file and reports the crash in it. But on my device the EXC_BAD_ACCESS show up on my custom UITableViewCell when I release it in the dealloc method. If I enable NSZombieEnabled my app doesn't crash at all. Here is the .h file #import <UIKit/UIKit.h> #define kWinsAmountTagValue 2 // how many wins you have #define