0

I am getting this error "EXC_BAD_ACCESS (code=EXC_ARM_DA_ALIGN" when Xcode reaches the last "nil" statement to identify the end of the NSArray* objs.

I have seen other comments similar errors here and here but those do not seem related to what I am encountering. Is it something obvious that I am missing? Has anyone else encountered this?

Thanks

                                NSArray *keys = [NSArray arrayWithObjects:ATHLETEID, CURRENTGRADE, EVENTNAME,
                                                 PERSONALREC, SEASONSBEST, EVENTMARK, MEETDATE, MEETID, MEETNAME,
                                                 EVENTPLACE, SEASON_NAME,
                                                 SORTMARK,TYPE, RESULTID, nil];

                                NSArray *objs = [NSArray arrayWithObjects:
                                                 athleteID,
                                                 t_currentGrade,
                                                 t_eventName,
                                                 t_eventPR,
                                                 t_eventSB,
                                                 t_markInEvent,
                                                 t_meetDate,
                                                 t_meetID,
                                                 t_meetName,
                                                 t_placeInEvent,
                                                 t_currentSeason,
                                                 t_sortMark,
                                                 t_typeOfEvent,
                                                 t_uniqueResultID,nil];

                                NSMutableDictionary *resultsFromSingleMeet [[NSMutableDictionary alloc]
                                                                              initWithObjects:objs
                                                                                      forKeys:keys];

Here is the dump from my Debug Navigator:

Thread 1, Queue : com.apple.main-thread
Thread 2, Queue : com.apple.libdispatch-manager
Thread 4, Queue : Athlete fetcher
#0  0x2e1bc79c in CFRetain ()
#1  0x2e1ca760 in +[__NSArrayI __new:::] ()
#2  0x2e1c7f04 in -[__NSPlaceholderArray initWithObjects:count:] ()
#3  0x2e1fdbdc in +[NSArray arrayWithObjects:] ()
#4  0x00034290 in __84+[MarksFromMeets(FromAthleticNet) fetchAthleteMarksIntoDatabase:whereIDofAthleteIs:]_block_invoke at /Users/Phlipo/Documents/iOS_Programming/ITrackPerformance/ITrackPerformance/MarksFromMeets+FromAthleticNet.m:293
#5  0x38ad00c2 in _dispatch_call_block_and_release ()
#6  0x38ad4e7a in _dispatch_queue_drain ()
#7  0x38ad1f92 in _dispatch_queue_invoke ()
#8  0x38ad5744 in _dispatch_root_queue_drain ()
#9  0x38ad59c4 in _dispatch_worker_thread2 ()
#10 0x38bffdfe in _pthread_wqthread ()
Community
  • 1
  • 1
PhillipOReilly
  • 609
  • 12
  • 28
  • What are the types of the object you are adding to the arrays? I am guessing you are adding primitive types (e.g NSUInteger or int) instead of objects. Make sure to wrap all numbers in NSNumber object. – Joel Feb 08 '14 at 06:58
  • Thanks Joel and @Kumar for your help. I would have been spinning my wheels in the wrong direction otherwise! Joel if you put your comment in form of an answer, I'll accept it. – PhillipOReilly Feb 08 '14 at 15:40

2 Answers2

1

The error shows that, You are about to adding the incompatible value type to the objects.

Check(Ensure) the values of Objects & Keys has a value of Object(Null Value) before its get added.

Kumar KL
  • 15,315
  • 9
  • 38
  • 60
1

I am guessing you are adding primitive types (e.g NSUInteger or int) to your array, instead of objects. Make sure to wrap all numbers in NSNumber object.

Joel
  • 15,654
  • 5
  • 37
  • 60