This is an update of my problem. I get this warning now when the program is interrupted. warning: attempt to create a variable USE_BLOCK_IN_FRAME with a block that is not in the frame.
I can not find much information about what this means.
It puzzled me. I get an EXC_BAD_ACCESS error. I have NSZombieEneabled (which helped with an earlier issue), but there is no call stack to track.
I have an almost identical code that works with another result controller I get.
This seems to be related to the relationship between the job object and the client object associated with it. This relationship is [object-object] <β [client object].
At first, I see that the code works without errors when the job object corresponding to the selected line does not have a client object linked through relations. Thus, in the event of a failure, this points to the client object, but when it does not fail, the pointer is zero.
When I encounter this problem, I launch the application and go directly to the task selection view and select the cell. At this point, a problem arises.
I did an experiment by running the application and first going into the client selection view, knowing that a selection of all client objects would be obtained. Then I went to view assignments and selected a cell. There was no problem.
Since I'm just trying to pass a pointer to a job object that has already been loaded, I donβt understand what is happening.
By the way, the code worked fine before switching to using NSFetchedResultsControllers. I like what they can do for me, but there is some kind of dynamics that I did not understand.
Logging does not show me anything that I understand to solve the problem.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { userState.selectedJob = [self.fetchedResultsController objectAtIndexPath:indexPath]; NSLog(@"\n\n(1 Pick) indexPath: %@\n",indexPath); NSLog(@"\n\n(1 Pick) userState: %@\n",userState); NSLog(@"\n\nnumber of Objects in job fetchresultscontroller = %d", [[fetchedResultsController fetchedObjects] count] ); NSLog(@"\n\n(1 Pick) selected job: %@\n",[self.fetchedResultsController objectAtIndexPath:indexPath]);
Debug output
2011-05-07 09:27:04.142 job1[6069:207] (1 Pick) indexPath: <NSIndexPath 0x5952590> 2 indexes [0, 3] 2011-05-07 09:27:04.142 job1[6069:207] (1 Pick) userState: <UserStateObject: 0x5919970> 2011-05-07 09:27:04.143 job1[6069:207] number of Objects in job fetchresultscontroller = 4 (gdb)
The final code should be so simple that it leads me to the whole journal:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { userState.selectedJob = [self.fetchedResultsController objectAtIndexPath:indexPath];
I use singleton userState to track what the user has done. This way I save the last selected pointers to Job and selectedClient objects. This is normal until I switched to NSFetchedResultsController.