Coredata and NSTableview - Delay on focus when open modal window after mac osx system update











up vote
0
down vote

favorite












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.










share|improve this question
























  • Does your app run without the changes? Did you use Instruments to profile your app? What's in the modal window, more table views and array controllers? Add the code to open, run and close the modal window to the question please.
    – Willeke
    Nov 9 at 0:14










  • Hi Willeke, I have update my question, thanks a lot
    – Max Colla
    Nov 9 at 10:46















up vote
0
down vote

favorite












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.










share|improve this question
























  • Does your app run without the changes? Did you use Instruments to profile your app? What's in the modal window, more table views and array controllers? Add the code to open, run and close the modal window to the question please.
    – Willeke
    Nov 9 at 0:14










  • Hi Willeke, I have update my question, thanks a lot
    – Max Colla
    Nov 9 at 10:46













up vote
0
down vote

favorite









up vote
0
down vote

favorite











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.










share|improve this question















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.







macos core-data nstableview lag






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 10:45

























asked Nov 8 at 19:31









Max Colla

134




134












  • Does your app run without the changes? Did you use Instruments to profile your app? What's in the modal window, more table views and array controllers? Add the code to open, run and close the modal window to the question please.
    – Willeke
    Nov 9 at 0:14










  • Hi Willeke, I have update my question, thanks a lot
    – Max Colla
    Nov 9 at 10:46


















  • Does your app run without the changes? Did you use Instruments to profile your app? What's in the modal window, more table views and array controllers? Add the code to open, run and close the modal window to the question please.
    – Willeke
    Nov 9 at 0:14










  • Hi Willeke, I have update my question, thanks a lot
    – Max Colla
    Nov 9 at 10:46
















Does your app run without the changes? Did you use Instruments to profile your app? What's in the modal window, more table views and array controllers? Add the code to open, run and close the modal window to the question please.
– Willeke
Nov 9 at 0:14




Does your app run without the changes? Did you use Instruments to profile your app? What's in the modal window, more table views and array controllers? Add the code to open, run and close the modal window to the question please.
– Willeke
Nov 9 at 0:14












Hi Willeke, I have update my question, thanks a lot
– Max Colla
Nov 9 at 10:46




Hi Willeke, I have update my question, thanks a lot
– Max Colla
Nov 9 at 10:46

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53214881%2fcoredata-and-nstableview-delay-on-focus-when-open-modal-window-after-mac-osx-s%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53214881%2fcoredata-and-nstableview-delay-on-focus-when-open-modal-window-after-mac-osx-s%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Schultheiß

Verwaltungsgliederung Dänemarks

Liste der Kulturdenkmale in Wilsdruff