exc-bad-access

How to understand EXC_BAC_ACCESS (SIGSEGV) KERN_INVALID_ADDRESS log?

家住魔仙堡 提交于 2019-12-12 14:27:13
问题 I'm doing an app in Titanium for Android and IOS. When I navigate a lot in the application I have a random exception and the app crashes. How can I know where is the problem? The app is a little complex to explain: It has two windows, first window is for "home" view that is only in portrait mode, and when I click to go to another view, I close the first window, I open another window and I add a view with the content to this window. The content view load the same web view with different url.

UIButton touches up IBAction causing EXC_BAD_ACCESS with ARC

时光毁灭记忆、已成空白 提交于 2019-12-12 09:45:20
问题 There have been a few questions on StackOverflow where users have experienced the same problem as I am having. However, none of their solutions fit my case. (See here, here, here and here for some of the SO questions I've read but have not found helpful.) In my case, I have a NIB that has a couple UIButton s, with an associated Controller View. The view is relatively old to my project and I've been able to use these buttons without any trouble until today. After making a few code changes that

Program received signal: “EXC_BAD_ACCESS”

无人久伴 提交于 2019-12-12 09:43:55
问题 I have a string variable which stores date from date picker but when I use its value in other function I am getting error like Program received signal: “EXC_BAD_ACCESS”. Note: variable is globally defined. code : - (void) changedDate: (UIDatePicker *) picker { if (appDelegate.dateint == 8) { NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; [dateFormatter setDateFormat:@"dd MMM, yyyy"]; datestr=[dateFormatter stringFromDate:[dptpicker date]]; NSLog(@"date:%@"

Bad Access on [UICollectionView setCollectionViewLayout:animated:]

不羁的心 提交于 2019-12-12 08:17:28
问题 I'm getting a strange crash in my UICollectionView. The crashing UICollectionView is embedded in an UICollectionView cell of another UICollectionView. I can't reproduce the issue, it seems to happen sometimes if the inner UICollectionView get's newly initialized because the outer CollectionView is reloading it's cells. com.apple.main-thread Crashed 0 libobjc.A.dylib objc_msgSend + 9 1 UIKit -[UICollectionViewData _setLayoutAttributes:atGlobalItemIndex:] + 60 2 UIKit __45-[UICollectionViewData

iOS: lldb EXC_BAD_ACCESS Custom Cell

戏子无情 提交于 2019-12-12 06:31:14
问题 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"LibraryListingCell"; InSeasonCell *cell = (InSeasonCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { [[NSBundle mainBundle] loadNibNamed:@"InSeasonCellView" owner:self options:nil]; cell = [_cell autorelease]; _cell = nil; } if(_dataController!=NULL){ Product *productAtIndex = [_dataController objectInListAtIndex

NSTimer crashes with bad access

早过忘川 提交于 2019-12-12 03:45:26
问题 I have the following method to update a label which show a simple time up -(void)updateTimeLabel:(NSTimer *)timer{ NSInteger secondsSinceStart = (NSInteger)[[NSDate date] timeIntervalSinceDate:_startTime]; NSInteger seconds = secondsSinceStart % 60; NSInteger minutes = (secondsSinceStart / 60) % 60; NSInteger hours = secondsSinceStart / (60 * 60); NSString *result = nil; if (hours > 0) { result = [NSString stringWithFormat:@"%02d:%02d:%02d", hours, minutes, seconds]; } else { result =

Swift Gives error Thread 1: EXC_BAD_ACCESS(code=1, address=0x0) when accessing NSManagedObject's property

耗尽温柔 提交于 2019-12-12 03:17:04
问题 My function to create NSManagedObject's subclass object is; func loginMoldelWithName(name: NSString, atIndexPath indexPath: NSIndexPath) -> LoginModel { let entity = NSEntityDescription.entityForName("LoginModel", inManagedObjectContext: managedObjectContext!) var login = LoginModel(entity: entity!, insertIntoManagedObjectContext: managedObjectContext) login.name = name login.date = NSDate() login.rowIndex = indexPath.row as NSNumber var error: NSError? if !managedObjectContext!.save(&error)

UIAlertview exc_bad_access [duplicate]

和自甴很熟 提交于 2019-12-12 02:49:12
问题 This question already has answers here : UIAlertView fails to show and results in “EXC_BAD_ACCESS” error (6 answers) Closed 5 years ago . I add a function to dismiss the UIAlertView after several seconds.The whole code is like: - (void)netWorkAlert { UIAlertView *netWork = [[UIAlertView alloc] initWithTitle:@"error" message:@"network has problems" delegate:self cancelButtonTitle:nil otherButtonTitles: nil]; [netWork show]; [self performSelector:@selector(dismissAlert:) withObject:netWork

kABPersonFirstNameProperty… trowing EXC_BAD_ACCESS

末鹿安然 提交于 2019-12-12 02:25:23
问题 Im reading the address book contacts... everything goes well until I test a contact with no First Name ( Since I can create a contact with just an email or a phone or wathever....). The code (reduced) is this: - (NSMutableArray *) getContactsInfo { NSMutableArray *contactsList = [[NSMutableArray alloc] init]; localAddressBook = ABAddressBookCreate(); int contactsLength = (int)ABAddressBookGetPersonCount(localAddressBook); if (contactsLength < 1) return nil; for(int currentContact=1;

How to get photos from camera roll?

落花浮王杯 提交于 2019-12-12 02:21:53
问题 I tried to use ALAssetLibrary to get albums and photos. This is my code: void (^assetEnumerator)(struct ALAsset *, NSUInteger, BOOL *) = ^(ALAsset *result, NSUInteger index, BOOL *stop) { if(result != NULL) { NSLog(@"See Asset: %@", result); } }; void (^assetGroupEnumerator)(struct ALAssetsGroup *, BOOL *) = ^(ALAssetsGroup *group, BOOL *stop) { if(group != nil) { [group enumerateAssetsUsingBlock:assetEnumerator]; } }; ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; [library