I have a mac osx app built with xcode 5 which runs on mac osx 10.8. My app has a lot of windows with table view and all the data are managed by coredata frameworks via several NSArraycontrollers. The app runs properly. I have updated my system to mac osx 10.13 and xcode to version 9. When I opened my project in Xcode 9, the program gave me several suggested upgrades, and a lot of deprecated methods. I fixed all that stuff and the app now runs also on my new osx system although I have a little problem. In the main window there is a table view with about 1000 rows. Doubleclicking on a row, a new modal window opens with all the details of the selected item. The modal window appears immediately but it takes too much time to obtain focus. If I close this modal window, the main window also takes time to focus. This lag time varies according to the number of visible rows in the main table view.
With the old osx and xcode versions there was no lag time problem. Can anyone help me?
UPDATE: The app runs without the changes but with the same lag problem. In the modal window there are several NSTextfields bounded to another NSArraycontroller that fetches data from Coredata. This is the code to open and close modal window:
- (IBAction)openModalWindow:(id)sender {
NSArray *result=[arrayControllerSpeaker selectedObjects];
if ([result count]==1) {
[self disattivaMenu];
[scrollViewModalWindow setDocumentView:viewSpeaker];
[self scrollToTop:scrollViewModalWindow];
[undoManager removeAllActions];
[[self managedObjectContext]setUndoManager:undoManager];
[mainWindow beginSheet:modalWindow completionHandler:nil];
} }
- (IBAction)closeModalWindow:(id)sender {
[self saveAction:self];
NSArray *result=[arrayControllerSpeaker selectedObjects];
if ([result count]==1) {
Speaker *speakerSelezionato=[result objectAtIndex:0];
//I made a lot of stuff….
//…..
//…..
[tableViewGrigliaOspiti reloadData];
}
[[self managedObjectContext] processPendingChanges];
[undoManager removeAllActions];
[[self managedObjectContext]setUndoManager:nil];
[sheetInfoMail orderOut:self];
[NSApp endSheet:modalWindow];
[modalWindow orderOut:self];
[self attivaMenu];}
Are there any tricks in Instruments in order to identify the problem? I don't know how to use it.