adding arc to a fundamentally non-arc project
Trying to move from QTKit to AVKit. Compiling on El Capitan (at the moment). So I have a handler that is arc and handles all the AVKit stuff and compiled with the -fobjc-arc flag in the build phases... I create and assign the handler to a document object using the myhandler = [[MWArcHandler alloc] init]; but the linker constantly complains that it can't find MWArcHandler: it's there in the build phases; and it is in the target, but I can't convince the linker that it is there. Any suggestions? PS very new to ARC programming. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Cocoa-dev Digest, Vol 11, Issue 139
Doesn't seem to work; Using the following code, I really get wildly differing results. (cleaned up a lot) selArray = [mySelection selectionsByLine]; if(selArray != nil) saCnt = [selArray count]; // get the start of the range ps1 = [selArray objectAtIndex: 0]; page1 = [[ps1 pages] objectAtIndex: 0]; p1 = (int) [[myView document] indexForPage: page1]; //get the bounds for the start of the range r1 = [ps1 boundsForPage: cpage]; pnt1 = r1.origin; //convert point to character index dx1 = [cpage characterIndexAtPoint: pnt1]; //ps cocoa-dev: this seems to work //do the last point ps1 = [selArray lastObject]; page2 = [[ps1 pages] objectAtIndex: 0]; p2 = [[myView document] indexForPage: cpage]; r2 = [ps1 boundsForPage: page2]; //this seems to give the wrong bounds pnt1 = NSMakePoint((float) NSMaxX(r2), (float) NSMinY(r2)); //or maybe this is the wrong point to use? dx2 = [cpage characterIndexAtPoint: pnt1]; selRange = NSMakeRange(dx1, dx2-dx1); //I know this is too simple; but for now only dealing with selections on a single page. On Mar 13, 2014, at 12:00 PM, cocoa-dev-requ...@lists.apple.com cocoa-dev-requ...@lists.apple.com wrote: On 11 Mar 2014, at 17:37, Matthew Weinstein mwein...@kent.edu wrote: Trying to figure out how to get a pages selection range (offset and length) for a pdfselection. I've been using the bounding rect, but if I have a selection that is a sentence that crosses lines and terminates half way in the last line, the rect includes everything to the edge (of course). But if I just want the offset and length, how do I extract that? Matthew, ask the PDFSelection for its “selectionsByLine”. You should get two selections. One for the first line, one for the second. Examine both to exact the data you need. - António ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Getting a selection range from a pdfselection...
Dear cocoa-devs, Trying to figure out how to get a pages selection range (offset and length) for a pdfselection. I've been using the bounding rect, but if I have a selection that is a sentence that crosses lines and terminates half way in the last line, the rect includes everything to the edge (of course). But if I just want the offset and length, how do I extract that? Frustrated Matthew Weinstein ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Finding column of just edited nstableview cell
Dear devs, I must be missing something obvious. Trying to find out the column (and row) of the table cell that a user has just edited. I'm an observer of NSControlTextDidEndEditingNotification, but selectedColumn seems not to work at that point. --MW ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Finding column of just edited nstableview cell
thank you that's it! On Aug 30, 2013, at 10:44 AM, Kyle Sluder wrote: On Fri, Aug 30, 2013, at 10:15 AM, Matthew Weinstein wrote: Dear devs, I must be missing something obvious. Trying to find out the column (and row) of the table cell that a user has just edited. I'm an observer of NSControlTextDidEndEditingNotification, but selectedColumn seems not to work at that point. What about -editedRow and -editedColumn? Those sound more appropriate to your task. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: lion/mt. lion: preventing qtmovieview from taking key strokes
So problem solved by having a subclass of QTMovieView check in overridden performKeyEquivalent: whether it's firstResponder and returning NO if it isn't and passing to super if it is. On Sep 15, 2012, at 4:28 PM, Eric Wing wrote: On 9/15/12, Matthew Weinstein mwein...@kent.edu wrote: Dear programmers, I have a window with a nstextview and a qtmovieview.. The problem is that the movieview steals all of the keystrokes so the left and right arrow keys never make it to the nstextview. I have tried subclassing qtmovieview and capturing keydown and keyup, but that didn't work... Has any one found a way to prevent keystrokes from going to the movieview or how do I redirect them? I don't know about this one, but QTMovieView has given me many problems over the years. And in my opinion, the writing is on the wall that QTKit's days are over. I think you may be better off moving to AVFoundation and put an AVPlayerLayer in a host NSView. Then you should be able to make the host NSView do anything you want. (Presumably, you could also do the same with a QTMovieLayer, but I reiterate, I think QTKit isn't a good thing for new code moving forward.) -Eric -- Beginning iPhone Games Development http://playcontrol.net/iphonegamebook/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
lion/mt. lion: preventing qtmovieview from taking key strokes
Dear programmers, I have a window with a nstextview and a qtmovieview.. The problem is that the movieview steals all of the keystrokes so the left and right arrow keys never make it to the nstextview. I have tried subclassing qtmovieview and capturing keydown and keyup, but that didn't work... Has any one found a way to prevent keystrokes from going to the movieview or how do I redirect them? --Matthew ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Document-scoped security conundrum (and bug)...
Dear cocoa-devs, I'm trying to adapt my app to app and document scoped security bookmarks. I think I'm running into a catch 22. since my documents reference pdfs dropped on my window, it makes sense to use document scoped bookmarks, but since the user may not have saved the document, I can't make the bookmark since i need an absolute path (actually the documentation is wrong, it's absouteURl) to seal the deal. Am I missing something? Must I force the user to save before continuing. In the end, it just seems that all this security is getting in the way of useability. --Matthew Weinstein ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Lion permission problems
Dear cocoa-dev, So I'm wondering how in the maze of sandboxed apps how to get my app to work properly. What it does is wrap around pdf files so that they can be combined, separated; etc. It doesn't actually change the original pdfs, just remembers their locations, reads them in and then writes to a different pdf (as the user requests). In addition it opens a specific wrapper on launch which contains standard elements that a user might want to add to their pdf (blank pages, etc.). The file is just a typical file that the program creates, stored at a location provided by the user, so that they can add their own elements to this wrapper. The first time the program is run, it doesn't find this special wrapper, asks the user where they want it it, they pick a spot (home or documents), the program creates a directory, copies the needed files out of its bundle, it opens the file, and all is well, the elements from the fixings wrapper appear in a menu on the menu bar. However, the second time the program is run, i.e., once the files have been put in place and I try to access them, I get a 257 error on [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL: myurl display: YES error: err]; Which seems to mean I don't have permission... It doesn't matter where the user saves the file; I get the 257 error. I did all of this because when I created the directory using the NSHomeDirectoryForUser(NSUserName()) and submitted the application, Apple complained and said I needed to ask the user where to put it; but if I do I get a 257 subsequent times the program is run. Any ideas on how to do this or get beyond the error code? --Matthew ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Lion permission problems
I think the temp.security thing will work, but I'm wondering what happens if a user replaces a file in the directory by one with the same name; does the os know it's not the original file? On Jun 23, 2012, at 9:53 AM, Alex Zavatone wrote: From what I have read in the docs, accessing files outside of the approved areas/domains (music, photos, documents(?) ) will ALWAYS require user interaction. Apple is really screwing us in this one. I hope that Conrad is right with his suggestion. On Jun 23, 2012, at 12:17 PM, Matthew Weinstein wrote: Dear cocoa-dev, So I'm wondering how in the maze of sandboxed apps how to get my app to work properly. What it does is wrap around pdf files so that they can be combined, separated; etc. It doesn't actually change the original pdfs, just remembers their locations, reads them in and then writes to a different pdf (as the user requests). In addition it opens a specific wrapper on launch which contains standard elements that a user might want to add to their pdf (blank pages, etc.). The file is just a typical file that the program creates, stored at a location provided by the user, so that they can add their own elements to this wrapper. The first time the program is run, it doesn't find this special wrapper, asks the user where they want it it, they pick a spot (home or documents), the program creates a directory, copies the needed files out of its bundle, it opens the file, and all is well, the elements from the fixings wrapper appear in a menu on the menu bar. However, the second time the program is run, i.e., once the files have been put in place and I try to access them, I get a 257 error on [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL: myurl display: YES error: err]; Which seems to mean I don't have permission... It doesn't matter where the user saves the file; I get the 257 error. I did all of this because when I created the directory using the NSHomeDirectoryForUser(NSUserName()) and submitted the application, Apple complained and said I needed to ask the user where to put it; but if I do I get a 257 subsequent times the program is run. Any ideas on how to do this or get beyond the error code? --Matthew ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com This email sent to z...@mac.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Lion permission problems
The whole idea of the app is so that users can automate the combining of different PDFs; users should be able to swap out different pdfs and then the program will recombine them. The program remembers (saves in a wrapper) the pdfs that have been combined. Sort of defeats the purpose if the users can't substitute say this year's calendar for last year's. On Jun 23, 2012, at 1:12 PM, Kyle Sluder wrote: On Jun 23, 2012, at 12:09 PM, Matthew Weinstein mwein...@kent.edu wrote: I think the temp.security thing will work, but I'm wondering what happens if a user replaces a file in the directory by one with the same name; does the os know it's not the original file? Security scoped bookmarks are attached to the file itself, so if the file is replaced you will not be able to access the new file that exists at that path. May I ask what motivated you to choose a project-oriented document structure (components located outside the document itself) rather than a compound document structure (PDFs copied or moved into your doc bundle)? --Kyle Sluder On Jun 23, 2012, at 9:53 AM, Alex Zavatone wrote: From what I have read in the docs, accessing files outside of the approved areas/domains (music, photos, documents(?) ) will ALWAYS require user interaction. Apple is really screwing us in this one. I hope that Conrad is right with his suggestion. On Jun 23, 2012, at 12:17 PM, Matthew Weinstein wrote: Dear cocoa-dev, So I'm wondering how in the maze of sandboxed apps how to get my app to work properly. What it does is wrap around pdf files so that they can be combined, separated; etc. It doesn't actually change the original pdfs, just remembers their locations, reads them in and then writes to a different pdf (as the user requests). In addition it opens a specific wrapper on launch which contains standard elements that a user might want to add to their pdf (blank pages, etc.). The file is just a typical file that the program creates, stored at a location provided by the user, so that they can add their own elements to this wrapper. The first time the program is run, it doesn't find this special wrapper, asks the user where they want it it, they pick a spot (home or documents), the program creates a directory, copies the needed files out of its bundle, it opens the file, and all is well, the elements from the fixings wrapper appear in a menu on the menu bar. However, the second time the program is run, i.e., once the files have been put in place and I try to access them, I get a 257 error on [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL: myurl display: YES error: err]; Which seems to mean I don't have permission... It doesn't matter where the user saves the file; I get the 257 error. I did all of this because when I created the directory using the NSHomeDirectoryForUser(NSUserName()) and submitted the application, Apple complained and said I needed to ask the user where to put it; but if I do I get a 257 subsequent times the program is run. Any ideas on how to do this or get beyond the error code? --Matthew ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Lion permission problems
Unfortunately that undoes the automation idea. The time saving here is that by just re-saving the pdf, the app when the document is opened recombines it based upon the rules that the user set up. Basically you're forcing the user to recreate the sequence of files each time anew. On Jun 23, 2012, at 1:22 PM, Kyle Sluder wrote: On Jun 23, 2012, at 1:16 PM, Matthew Weinstein mwein...@kent.edu wrote: The whole idea of the app is so that users can automate the combining of different PDFs; users should be able to swap out different pdfs and then the program will recombine them. The program remembers (saves in a wrapper) the pdfs that have been combined. Sort of defeats the purpose if the users can't substitute say this year's calendar for last year's. So your app's workflow relies on the user understanding and manipulating the filesystem? Apple seem to be encouraging developers to provide interfaces that don't require specific filesystem layouts. In other words, you control the filesystem under your container (which the user should never see) and the user controls the filesystem everywhere else (the layout of which your program should not rely on). Instead of requiring the user to replace the files using Finder, can they just replace the files using your app? You would keep the source PDFs and all the combined results inside your document wrapper. --Kyle Sluder On Jun 23, 2012, at 1:12 PM, Kyle Sluder wrote: On Jun 23, 2012, at 12:09 PM, Matthew Weinstein mwein...@kent.edu wrote: I think the temp.security thing will work, but I'm wondering what happens if a user replaces a file in the directory by one with the same name; does the os know it's not the original file? Security scoped bookmarks are attached to the file itself, so if the file is replaced you will not be able to access the new file that exists at that path. May I ask what motivated you to choose a project-oriented document structure (components located outside the document itself) rather than a compound document structure (PDFs copied or moved into your doc bundle)? --Kyle Sluder On Jun 23, 2012, at 9:53 AM, Alex Zavatone wrote: From what I have read in the docs, accessing files outside of the approved areas/domains (music, photos, documents(?) ) will ALWAYS require user interaction. Apple is really screwing us in this one. I hope that Conrad is right with his suggestion. On Jun 23, 2012, at 12:17 PM, Matthew Weinstein wrote: Dear cocoa-dev, So I'm wondering how in the maze of sandboxed apps how to get my app to work properly. What it does is wrap around pdf files so that they can be combined, separated; etc. It doesn't actually change the original pdfs, just remembers their locations, reads them in and then writes to a different pdf (as the user requests). In addition it opens a specific wrapper on launch which contains standard elements that a user might want to add to their pdf (blank pages, etc.). The file is just a typical file that the program creates, stored at a location provided by the user, so that they can add their own elements to this wrapper. The first time the program is run, it doesn't find this special wrapper, asks the user where they want it it, they pick a spot (home or documents), the program creates a directory, copies the needed files out of its bundle, it opens the file, and all is well, the elements from the fixings wrapper appear in a menu on the menu bar. However, the second time the program is run, i.e., once the files have been put in place and I try to access them, I get a 257 error on [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL: myurl display: YES error: err]; Which seems to mean I don't have permission... It doesn't matter where the user saves the file; I get the 257 error. I did all of this because when I created the directory using the NSHomeDirectoryForUser(NSUserName()) and submitted the application, Apple complained and said I needed to ask the user where to put it; but if I do I get a 257 subsequent times the program is run. Any ideas on how to do this or get beyond the error code? --Matthew ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Lion permission problems
Yup! They are contributed by the user, but they stay in the user space; they are read-only. I create a pdfdocument with them and then borrow pages to resequence them (based on a table the user keeps) and spit out a new pdf. The automatic part is that the user can tell the program what to do with extra pages the program finds when they change pdf documents that the program is monitoring (actually each document monitors the pdfs added to it, just pointers to the docs, actually). On Jun 23, 2012, at 1:41 PM, Erik Stainsby wrote: So if I understand your pattern, you are managing a single product PDF which is constructed by your app based upon metadata which describes the specific component PDFs etc that the user has chosen. Those component PDFs reside elsewhere than within your app space, correct? On 2012-06-23, at 1:26 PM, Matthew Weinstein mwein...@kent.edu wrote: Unfortunately that undoes the automation idea. The time saving here is that by just re-saving the pdf, the app when the document is opened recombines it based upon the rules that the user set up. Basically you're forcing the user to recreate the sequence of files each time anew. On Jun 23, 2012, at 1:22 PM, Kyle Sluder wrote: On Jun 23, 2012, at 1:16 PM, Matthew Weinstein mwein...@kent.edu wrote: The whole idea of the app is so that users can automate the combining of different PDFs; users should be able to swap out different pdfs and then the program will recombine them. The program remembers (saves in a wrapper) the pdfs that have been combined. Sort of defeats the purpose if the users can't substitute say this year's calendar for last year's. So your app's workflow relies on the user understanding and manipulating the filesystem? Apple seem to be encouraging developers to provide interfaces that don't require specific filesystem layouts. In other words, you control the filesystem under your container (which the user should never see) and the user controls the filesystem everywhere else (the layout of which your program should not rely on). Instead of requiring the user to replace the files using Finder, can they just replace the files using your app? You would keep the source PDFs and all the combined results inside your document wrapper. --Kyle Sluder On Jun 23, 2012, at 1:12 PM, Kyle Sluder wrote: On Jun 23, 2012, at 12:09 PM, Matthew Weinstein mwein...@kent.edu wrote: I think the temp.security thing will work, but I'm wondering what happens if a user replaces a file in the directory by one with the same name; does the os know it's not the original file? Security scoped bookmarks are attached to the file itself, so if the file is replaced you will not be able to access the new file that exists at that path. May I ask what motivated you to choose a project-oriented document structure (components located outside the document itself) rather than a compound document structure (PDFs copied or moved into your doc bundle)? --Kyle Sluder On Jun 23, 2012, at 9:53 AM, Alex Zavatone wrote: From what I have read in the docs, accessing files outside of the approved areas/domains (music, photos, documents(?) ) will ALWAYS require user interaction. Apple is really screwing us in this one. I hope that Conrad is right with his suggestion. On Jun 23, 2012, at 12:17 PM, Matthew Weinstein wrote: Dear cocoa-dev, So I'm wondering how in the maze of sandboxed apps how to get my app to work properly. What it does is wrap around pdf files so that they can be combined, separated; etc. It doesn't actually change the original pdfs, just remembers their locations, reads them in and then writes to a different pdf (as the user requests). In addition it opens a specific wrapper on launch which contains standard elements that a user might want to add to their pdf (blank pages, etc.). The file is just a typical file that the program creates, stored at a location provided by the user, so that they can add their own elements to this wrapper. The first time the program is run, it doesn't find this special wrapper, asks the user where they want it it, they pick a spot (home or documents), the program creates a directory, copies the needed files out of its bundle, it opens the file, and all is well, the elements from the fixings wrapper appear in a menu on the menu bar. However, the second time the program is run, i.e., once the files have been put in place and I try to access them, I get a 257 error on [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL: myurl display: YES error: err]; Which seems to mean I don't have permission... It doesn't matter where the user saves the file; I get the 257 error. I did all of this because when I created the directory using the NSHomeDirectoryForUser(NSUserName()) and submitted the application, Apple complained and said I needed
Re: Lion permission problems
I think I see a second problem coming down the pike. the users can add pdfs to the wrapper file through a typical open file or through drag and drop. I get that the NSOpen... allows me to expand entitlements. But does drag and drop? Is there a way to get a bookmark and ask for ongoing privileges for a path I get through drag and drop? --Matthew On Jun 23, 2012, at 1:41 PM, Erik Stainsby wrote: So if I understand your pattern, you are managing a single product PDF which is constructed by your app based upon metadata which describes the specific component PDFs etc that the user has chosen. Those component PDFs reside elsewhere than within your app space, correct? On 2012-06-23, at 1:26 PM, Matthew Weinstein mwein...@kent.edu wrote: Unfortunately that undoes the automation idea. The time saving here is that by just re-saving the pdf, the app when the document is opened recombines it based upon the rules that the user set up. Basically you're forcing the user to recreate the sequence of files each time anew. On Jun 23, 2012, at 1:22 PM, Kyle Sluder wrote: On Jun 23, 2012, at 1:16 PM, Matthew Weinstein mwein...@kent.edu wrote: The whole idea of the app is so that users can automate the combining of different PDFs; users should be able to swap out different pdfs and then the program will recombine them. The program remembers (saves in a wrapper) the pdfs that have been combined. Sort of defeats the purpose if the users can't substitute say this year's calendar for last year's. So your app's workflow relies on the user understanding and manipulating the filesystem? Apple seem to be encouraging developers to provide interfaces that don't require specific filesystem layouts. In other words, you control the filesystem under your container (which the user should never see) and the user controls the filesystem everywhere else (the layout of which your program should not rely on). Instead of requiring the user to replace the files using Finder, can they just replace the files using your app? You would keep the source PDFs and all the combined results inside your document wrapper. --Kyle Sluder On Jun 23, 2012, at 1:12 PM, Kyle Sluder wrote: On Jun 23, 2012, at 12:09 PM, Matthew Weinstein mwein...@kent.edu wrote: I think the temp.security thing will work, but I'm wondering what happens if a user replaces a file in the directory by one with the same name; does the os know it's not the original file? Security scoped bookmarks are attached to the file itself, so if the file is replaced you will not be able to access the new file that exists at that path. May I ask what motivated you to choose a project-oriented document structure (components located outside the document itself) rather than a compound document structure (PDFs copied or moved into your doc bundle)? --Kyle Sluder On Jun 23, 2012, at 9:53 AM, Alex Zavatone wrote: From what I have read in the docs, accessing files outside of the approved areas/domains (music, photos, documents(?) ) will ALWAYS require user interaction. Apple is really screwing us in this one. I hope that Conrad is right with his suggestion. On Jun 23, 2012, at 12:17 PM, Matthew Weinstein wrote: Dear cocoa-dev, So I'm wondering how in the maze of sandboxed apps how to get my app to work properly. What it does is wrap around pdf files so that they can be combined, separated; etc. It doesn't actually change the original pdfs, just remembers their locations, reads them in and then writes to a different pdf (as the user requests). In addition it opens a specific wrapper on launch which contains standard elements that a user might want to add to their pdf (blank pages, etc.). The file is just a typical file that the program creates, stored at a location provided by the user, so that they can add their own elements to this wrapper. The first time the program is run, it doesn't find this special wrapper, asks the user where they want it it, they pick a spot (home or documents), the program creates a directory, copies the needed files out of its bundle, it opens the file, and all is well, the elements from the fixings wrapper appear in a menu on the menu bar. However, the second time the program is run, i.e., once the files have been put in place and I try to access them, I get a 257 error on [[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL: myurl display: YES error: err]; Which seems to mean I don't have permission... It doesn't matter where the user saves the file; I get the 257 error. I did all of this because when I created the directory using the NSHomeDirectoryForUser(NSUserName()) and submitted the application, Apple complained and said I needed to ask the user where to put it; but if I do I get a 257 subsequent times the program is run. Any ideas on how to do this or get beyond
More PDFView mysteries...
Dear Cocoa-Devs, I have an app that works perfectly on snow leopard, it consists of a split view with a pdfview on top, and another view on the bottom. On lion however the pdfview is blank until I resize the window or splitview. I've tried throwing various things at the window in the windowControllerDidLoadNib: section [myPDFView display]... [myWindow setNeedsDisplay: YES]... It almost feels like the windowControllerDidLoadNib is happening too quickly (or something). BTW this splitview is in a tabview... If I manually tab to something else and back, it refreshes, if I do it programattically at the end of the ...didLoadNib: method, nothing, doesn't work. Ideas? Anyone else having pdfview lion problems. Matthew Weinstein Professor of Science Education Education Program U.W. - Tacoma 253 692-4787 matth...@u.washington.edu Campus Box: 358435 1900 Commerce Street Tacoma, WA 98402-3100 Office: (253) 692-4787 FAX: (253) 692-5612 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: More PDFView mysteries...
That is a problem; I think this is a pdfkit bug, and I need to register it (slowly figuring these things out). What I did to isolate the problem was create a project with a window in which I just dropped a pdfview and pdfthumbview on (didn't even bother to change the sizing. Hardcoded an URL to a pdf; created a PDFDocument init'd with the url and then did [mypdfview setDocument: myURL]. All of that in the windowcontrollerDidLoadNib method. same problem. pdfviews can't be set in the init'd in the windowControllerDidLoadNib; but I think the problem is bigger. I relocated the load code so it was activated by a button rather than the windowController: same problem. There's a definite pdfview problem... Solutions? On Jun 14, 2012, at 5:08 PM, Graham Cox wrote: On 15/06/2012, at 8:15 AM, Matthew Weinstein wrote: It almost feels like the windowControllerDidLoadNib is happening too quickly (or something). Note what that method literally tells you - the window controller loaded the nib. That doesn't mean that the actual window was instantiated yet (with all its views). A window controller lazily loads the window when it is actually required, which is a bit later. You can use the controller's windowDidLoad method to find out when that has happened. The probable reason this is different on Lion is because NSDocument is a very different beast on Lion. It is often invoked on a background thread and various interface-less document objects are made to support Versions and Autosaving. It's a rather complex situation on Lion which *appears* to assume a very great deal about how your app has subclassed NSDocument. For example, when browsing Versions, each version you see is an actual instance of your NSDocument subclass complete with its window - it's not just the snapshot image you might have thought. Scary stuff. --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: PDFThumbnailView Problem (kind of)
You can't believe how easy that was to implement in cocoa: [myThumbnailView setThumbnailSize: [myThumbnailView thumbnailSize]]; That's it; works like a charm. On May 22, 2012, at 11:37 PM, Antonio Nunes wrote: On 23 May 2012, at 03:53, Matthew Weinstein wrote: I have a typical thumbnailview on a drawer and a pdfview in main window. I have a category that lets me drag and drop a pdf onto the pdfview; it then gets the url and sets a pdfdocument to that url; sets the pdfview and sets the thumbnailview to the pdfview. It seems to work; but I can't click on the thumbnails; they're there, but not clickable, until I resize the window, then all is well. Any idea of what's going on and what I need to do to liberate my thumbnailview (I've tried sending a setNeedsDisplay:-- Nada). I've had a similar issue (and there are other issues with PDFThumbnailView that you may or may not run into). This is how I worked around it: self.thumbnailView.PDFView = self.previewCanvas; dispatch_async(dispatch_get_main_queue(), ^{ self.thumbnailView.thumbnailSize = self.thumbnailView.thumbnailSize; }); Simply setting the thumbnail size causes the thumbnail view to straighten itself out. -António There is a world of difference between searching for happiness and choosing to be happy. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
PDFThumbnailView Problem (kind of)
Dear Cocoa-gurus, I have a typical thumbnailview on a drawer and a pdfview in main window. I have a category that lets me drag and drop a pdf onto the pdfview; it then gets the url and sets a pdfdocument to that url; sets the pdfview and sets the thumbnailview to the pdfview. It seems to work; but I can't click on the thumbnails; they're there, but not clickable, until I resize the window, then all is well. Any idea of what's going on and what I need to do to liberate my thumbnailview (I've tried sending a setNeedsDisplay:-- Nada). Matthew Weinstein ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Losing attachments when saving rtfd
Dear programmers, Trying to save an RTFD from an NSAttributedString with attachements. The text saves; the images don't... I've been scouring the web but can't seem to figure out what's wrong. I have a NSAttributedString with attachments. I check that the string really has the attachments by using setAttributedString to the textstorage of a NSTextView, and voila, there it is. But I can't seem to save the attachment. This is what I'm trying: //this is a category I found on the interwebs myimagets = [[NSTextAttachment alloc] initWithAnImage: myimage]; //get doc string //replace with the attributed string myattstr = [NSMutableAttributedString attributedStringWithAttachment: myimagets]; //stick on a little text at the end to see how it handles both... addon = [[NSMutableAttributedString alloc] initWithString: @and here's the extra bit]; [myattstr appendAttributedString: addon]; //this is my test to see if the attachment is really there: it works! [[myTextView textStorage] setAttributedString: myattstr]; //here's what fails: myfw = [myattstr RTFDFileWrapperFromRange: NSMakeRange(0, [myattstr length]) documentAttributes:nil]; [myfw writeToFile: [@~/Desktop/outfile.rtfd stringByExpandingTildeInPath] atomically:YES updateFilenames:YES]; What's created is an rtfd with only the rtf file in it and no images Thoughts? Help? --Matthew Weinstein ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Question about hebrew in textfields and textviews
Dear Cocoa-devs, Working with a person using hebrew input method. Text appears right-to-left as desired, but all of the textfields and textviews are still left justfiied, so it looks a little weird. Is there something I need to do so that when users are using Arabic or Hebrew everything justifies the other way? --Matthew Weinstein ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Question about hebrew in textfields and textviews
Thanks for all the replies. Unfortunately NSNaturalTextAlignment doesn't seem to affect the justification of the textfields. Try creating a simple project and simply put a textfield and textview in the window in MainMenu.xib. Changing the input to hebrew, running the program does change the text to LTR but it's still justfied on the wrong side. --Matthew ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Preventing lion from saving state...
My approach has landed up being just as kludgy, and I'm really annoyed that apple has made no way to opt out of this feature. I have basically gone in (in the applicationWillFinishLaunching app delegate notification) and emptied and locked the saveState folder for just my application in the ~/Library folder of the user to prevent this nonsense. Once locked the program behaves normally. NSApp delegate needs to simply have a -(BOOL) saveProgramState option (Apple, are you out there?) It seems to have taken care of the issue. On Aug 23, 2011, at 11:03 AM, Sean McBride wrote: On Mon, 22 Aug 2011 12:39:01 -0700, Matthew Weinstein said: I'm working on updating my app for lion. For the time being, just to get users able to proceed I need to disable Lion's restore savedstate default. I don't want Lion opening any windows (other than the ones I open programmatically) when a user starts the program. I can't find how to do that in the api for NSApp, am I missing something? I need the program to force this condition, rather than leave it to users (I did find a way users can turn off this feature). Apple has not made this easy, despite the fact that this new Resume feature causes binary incompatibility with several applications. In my case, I made a wrapper around NSDocument's addWindowController: that adds this: NSWindow* window = [inControllerToAdd window]; if ([window respondsToSelector:@selector(setRestorationClass:)] [window respondsToSelector:@selector(setRestorable:)] [window respondsToSelector:@selector(invalidateRestorableState)]) { [window setRestorationClass:Nil]; [window setRestorable:NO]; [window invalidateRestorableState]; } ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: [SOLVED]Preventing lion from saving state...
Graham, that works like a charm. I just put this in my delegate applicationwillfinishlaunching method: #define NSDEF [NSUserDefaults standardUserDefaults] if([NSDEF objectForKey: @ApplePersistenceIgnoreState] == nil) [NSDEF setBool: YES forKey:@ApplePersistenceIgnoreState]; On Aug 23, 2011, at 3:56 PM, Graham Cox wrote: On 24/08/2011, at 4:25 AM, Matthew Weinstein wrote: My approach has landed up being just as kludgy, and I'm really annoyed that apple has made no way to opt out of this feature. In Xcode 4, you can configure your scheme to have disable state restoration checked. This suggests that there is a switch that can be set that turns this off for an app, either as a defaults setting or maybe as a command-line argument. Unfortunately I can't see exactly how that works, but when the app launches, the log shows: 23/08/11 1:12:19.951 PM Artboard: ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/_d/fcb3h3892y339vh632v_hz28gn/T/com.mapdiva.as.Artboard.savedState So perhaps 'ApplePersistenceIgnoreState' is a simple boolean in your defaults that can be set? Worth a try… --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Overriding Lion's SaveState
Dear CocoaDevs, I'm working on updating my app for lion. For the time being, just to get users able to proceed I need to disable Lion's restore savedstate default. I don't want Lion opening any windows (other than the ones I open programmatically) when a user starts the program. I can't find how to do that in the api for NSApp, am I missing something? I need the program to force this condition, rather than leave it to users (I did find a way users can turn off this feature). Thanks in advance, Matthew Weinstein Creator of TAMS Analyzer___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
QTKit Question
I'm using a QTMovieView in my project and a user would like be able to zoom in. Looking at the API there seems to be a setZoomButtonsVisible: selector, but it doesn't seem to work on my set up. Does this only work if they have bought QT Pro? I'm on the latest snow leopard, and I notice it says only available with 7.2.1 and later; I think I'm running 7.6.6... Am I missing something? --1000 thanks, Matthew Weinstein___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Help system question...
Dear programmers, There's some sort of bug in my help system, wondering if anyone can help. I have a set of nested folders in the help system: one for tutorial, one for user manual, but one link doesn't work in the help system, but works fine if I click it directly (even if I go into the application's content folder and use a browser in the help system it works just fine.) Console reveals nothing And, while we're on the topic, someone on-line a year ago or so sent me a hint on rebuilding the help system for an application. Could someone refresh my memory on that, i.e., once I change or edit the helps system how do I get it to use the new version. Thanks, Matthew Weinstein ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSTextField sending action unbidden...
Dear programmers, I have a textfield which is spontaneously sending out an action. I have it set to send on end editing but when the nib loads and I click on any part of the window it sends an action which then messes up other stuff... Is there some value I can set so that it sends on hitting return only? Matthew Weinstein Associate Professor of Science Education Education Program U.W. - Tacoma 253 692-4787 matth...@u.washington.edu Campus Box: 358435 1900 Commerce Street Tacoma, WA 98402-3100 Office: (253) 692-4787 FAX: (253) 692-5612 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Ignore last problem...
Sometimes wording confuses: I read send on enter as meaning send on beginning rather than as the enter key. Mathew ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSTableView action doubleAction...
Dear Programmers, I set both my tableView's actions and doubleActions programmatically in my document's windowdidloadnib... I find that if I double click It calls both! Is this expected behavior? Is there a method to this madness? Matthew Weinstein Associate Professor of Science Education Education Program U.W. - Tacoma 253 692-4787 matth...@u.washington.edu Campus Box: 358435 1900 Commerce Street Tacoma, WA 98402-3100 Office: (253) 692-4787 FAX: (253) 692-5612 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTableView action doubleAction...
Actually I'm really happy it does both; I just want to count on it doing both. In my case it is really important that the single click do something before the 2nd click. I want users to be able to single click without triggering the subsequent action, the double click takes the single click and applies that action to a selection in a textview. So it works fine. I just want to make sure that I'm not counting on a bug or some other defect (in my very meager programming skills or apple's api). On Jun 6, 2010, at 6:44 PM, Matt Neuburg wrote: On Sun, 6 Jun 2010 18:12:07 -0700, Matthew Weinstein mwein...@kent.edu said: I set both my tableView's actions and doubleActions programmatically in my document's windowdidloadnib... I find that if I double click It calls both! You're doing both. :) The only way to tell the difference is to delay after the first click to see whether there's a second (just like the way you tell the difference between single and double-tap on iPhone). I guess the question is why you want to do this in the first place. I've written lots of applications where double-clicking in a table did something, and in *none* of them did I also need to implement something for single-clicking. I get an event (thru the delegate) when the selection changes and *that* is usually what I'm interested in. (Actually, in this modern age, it's usually enough to let bindings handle the selection change.) Do you really want something utterly special and unique to happen when the user single-clicks on a row that is already selected? That would be a very strange interface; the user is likely to be very surprised. If you want to make that sort of thing clear, I'd suggest you put a button in the row and catch the click from *that*. m. -- matt neuburg, phd = m...@tidbits.com, http://www.tidbits.com/matt/ A fool + a tool + an autorelease pool = cool! AppleScript: the Definitive Guide - Second Edition! http://www.tidbits.com/matt/default.html#applescriptthings ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
PDFSelection question
Dear programmers, I think I must be missing some simple method in the api to do this, but, given a range of a PDFDocument string, how do I convert that to a selection? I found the PDFPage selection from range, but how do I find what pages a selection for the document string covers? Thanks for any assistance. Matthew Weinstein Associate Professor of Science Education Education Program U.W. - Tacoma 253 692-4787 matth...@u.washington.edu Campus Box: 358435 1900 Commerce Street Tacoma, WA 98402-3100 Office: (253) 692-4787 FAX: (253) 692-5612 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: PDFSelection from a range
A solution to my own problem. This is from a category I created for PDFDocument. Seems to work. The + and - 1's are strictly trial and error. Seems to work, even with some pretty complex PDFS (created by comicLife, for instance). Probably not the pithiest way to do this (ans is completely superfluous) but for the record: -(PDFSelection *) selectFrom: (int) b to: (int) e { int bspot, espot; int i, n; int flag, totlen, plen; PDFPage *bpage, *epage, *tpage; PDFSelection *ans; totlen=flag = 0; if(!(b e)) return nil; n = [self pageCount]; for(i = 0; i n; i++) { tpage = [self pageAtIndex: i]; plen = [[tpage string] length]; if(b totlen + plen) { flag++; bpage = tpage; bspot = b - totlen; } if(b totlen + plen) { flag++; bpage = tpage; bspot = b - totlen; } if(e = totlen + plen) { flag++; epage = tpage; espot = e - totlen - 1; } if(flag = 2) break; totlen += (plen + 1); } if(flag 2) return nil; ans = [self selectionFromPage: bpage atCharacterIndex: bspot toPage: epage atCharacterIndex: espot]; return ans; } On Jun 5, 2010, at 7:16 PM, cocoa-dev-requ...@lists.apple.com wrote: Dear programmers, I think I must be missing some simple method in the api to do this, but, given a range of a PDFDocument string, how do I convert that to a selection? I found the PDFPage selection from range, but how do I find what pages a selection for the document string covers? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
initializing a pdfview
I think I'm on the verge of success with my attempt to create a selection rectangle (that doesn't select text) for pdfview, but I'm unclear what init routines I should use in my pdfview subclass. - (id)initWithFrame:(NSRect)frameRect doesn't seem to get called--as it does in nsview. Matthew Weinstein... ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Cocoa-dev Digest, Vol 7, Issue 585
Aparently not. I did implement initWithCoder; it doesn't get called. Other suggestions? PS. I am using a nib. On May 26, 2010, at 12:02 PM, cocoa-dev-requ...@lists.apple.com wrote: ay 26, 2010, at 11:38 AM, Matthew Weinstein wrote: I think I'm on the verge of success with my attempt to create a selection rectangle (that doesn't select text) for pdfview, but I'm unclear what init routines I should use in my pdfview subclass. - (id)initWithFrame:(NSRect)frameRect doesn't seem to get called--as it does in nsview. Are you loading the PDFView subclass from a NIB or creating it programmatically? From the NIB I believe -(id) initWithCoder: (NSCoder *) coder is called. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
PDFKit cpSelections?
Dear programmers, So, I used the crop marker code that apple provides to experiment in creating a selecting rectangle. I first subclassed NsView as MWSelectingView, and everything worked like clock work. I was even able to modify the CropMarker object (MWViewSelectionMarker) so that when the window resizes it resizes as well. I then just changed my MWSelectingView so it is a subclass of PDFView instead. No go. Now even before I can click on it, while it is loading from nib it bombs with the following pearls of wisdom. I can't find a discussion of cpSelections anywhere. I also don't get how come it even comes to call MWViewSelectionMarker. Only my subclass knows about it. Yes it calls it in drawRect, but really nowhere else. Thoughts? Any experience in subclassing PDFVIew to capture mouse downs? 2010-05-26 13:01:19.903 SelectedImage[1487:a0f] -[MWViewSelectionMarker cpSelections]: unrecognized selector sent to instance 0x102030480 2010-05-26 13:01:19.906 SelectedImage[1487:a0f] An uncaught exception was raised 2010-05-26 13:01:19.906 SelectedImage[1487:a0f] -[MWViewSelectionMarker cpSelections]: unrecognized selector sent to instance 0x102030480 2010-05-26 13:01:20.017 SelectedImage[1487:a0f] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MWViewSelectionMarker cpSelections]: unrecognized selector sent to instance 0x102030480' *** Call stack at first throw: ( 0 CoreFoundation 0x7fff88964d24 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x7fff8472e0f3 objc_exception_throw + 45 2 CoreFoundation 0x7fff889be160 +[NSObject(NSObject) doesNotRecognizeSelector:] + 0 3 CoreFoundation 0x7fff88936d3f ___forwarding___ + 751 4 CoreFoundation 0x7fff88932e88 _CF_forwarding_prep_0 + 232 5 PDFKit 0x7fff846576ee -[PDFView(PDFViewInternal) invalidateSelectionBounds:] + 54 6 PDFKit 0x7fff8464c71a -[PDFView becomeFirstResponder] + 42 7 AppKit 0x7fff856849b6 -[NSWindow makeFirstResponder:] + 643 8 AppKit 0x7fff85684696 -[NSWindow _selectFirstKeyView] + 679 9 AppKit 0x7fff856843cf -[NSWindow _setUpFirstResponderBeforeBecomingVisible] + 190 10 AppKit 0x7fff85683773 -[NSWindow _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:] + 986 11 AppKit 0x7fff8568334a -[NSWindow orderWindow:relativeTo:] + 94 12 AppKit 0x7fff8564f340 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1726 13 AppKit 0x7fff8564d45d loadNib + 226 14 AppKit 0x7fff8564c96d +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 248 15 AppKit 0x7fff8564c7a5 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 326 16 AppKit 0x7fff85649d27 NSApplicationMain + 279 17 SelectedImage 0x00010e5d main + 33 18 SelectedImage 0x00010e34 start + 52 ) terminate called after throwing an instance of 'NSException' Program received signal: “SIGABRT”. Matthew Weinstein Associate Professor of Science Education Education Program U.W. - Tacoma 253 692-4787 matth...@u.washington.edu Campus Box: 358435 1900 Commerce Street Tacoma, WA 98402-3100 Office: (253) 692-4787 FAX: (253) 692-5612 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Creating a PDFSelection...
Dear progammers, Thanks for all the help! Onto the next problem... Users need to be able to select sections of a pdfView, and I need to be able to save and analyze the selections (e.g., do they overlap). I also need to be able to restore the selections later. So the question is, can I use PDFSelection to do this. I can't seem to find a way to say create a selection with this NSRect (or part of the string). Is there a way to do this? Is there an alternative? --Matthew ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Creating a PDFSelection...
António, that's exactly what I needed. But it leads to my next question. The PDFSelection class as far as I can tell basically supports what in Preview.app is the text tool on the toolbar. The selection tool in Preview.app selects an arbitrary rectangle, even if there's no text behind the image. So, is there some way of changing the behavior of the given PDFSelection, or do I have to hand code this (using the Cropped image example code, for instance)? On May 25, 2010, at 11:05 AM, Antonio Nunes wrote: On 25 May 2010, at 18:32, Matthew Weinstein wrote: Thanks for all the help! Onto the next problem... Users need to be able to select sections of a pdfView, and I need to be able to save and analyze the selections (e.g., do they overlap). I also need to be able to restore the selections later. So the question is, can I use PDFSelection to do this. I can't seem to find a way to say create a selection with this NSRect (or part of the string). Is there a way to do this? Is there an alternative? From the PDFPage class reference: - (PDFSelection *)selectionForRect:(NSRect)rect - (PDFSelection *)selectionForRange:(NSRange)range etc. António There is nothing as strong as real gentleness, and there is nothing as gentle as real strength. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Creating a PDFSelection...
Actually, I don't need the tiff; I just need the rectangle! People have to be able to sketch the rectangle over the pdf, and then my program stores and restores those rectangles (with some additional information). On May 25, 2010, at 9:15 PM, Antonio Nunes wrote: On 26 May 2010, at 03:01, Matthew Weinstein wrote: The PDFSelection class as far as I can tell basically supports what in Preview.app is the text tool on the toolbar. The selection tool in Preview.app selects an arbitrary rectangle, even if there's no text behind the image. So, is there some way of changing the behavior of the given PDFSelection, or do I have to hand code this (using the Cropped image example code, for instance)? The selection tool in Preview just creates a snapshot of the selection. A TIFF image. This has nothing to do with PDFSelection. PDFSelections deal only with text, so I think they are not rich enough for your purposes. I guess you may have to delve deeper; parsing the page streams (you can use Quartz for that), and rolling your own selections. Not a quick and easy task. António --- And you would accept the seasons of your heart, even as you have always accepted the seasons that pass over your field. --Kahlil Gibran --- ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSMovieView - QTMovieView; rate problems...
Okay I'm confused. How do I set the attributes when I init and initWithURL at the same time. I can't seem to find a method to do both. The problem is that when I first init withURL and then use setAttribute, it doesn't take. I check right away and the value is set YES rather than NO. On May 22, 2010, at 3:42 PM, James W. Walker wrote: On May 22, 2010, at 1:26 PM, Matthew Weinstein wrote: One important aspect of my app is teh ability to speed and slow audio (and video playback). On the old NSMovieview this worked like an analog tape machine: if you used NSMovieview setRate: it would slow the sound down smoothly but make it lower; which is fine. Under the new regime, the audio playback using [[QTMovieview movie] setRate: (float)] you get VERY choppy sound and no variation in tone. I don't actually care about the variation in tone, I care a lot about the smoothness of the sound. Is there any way to get smooth audio while changing the rate to r != 1? Maybe you could try setting QTMovieRateChangesPreservePitchAttribute to NO when you initialize the QTMovie. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSMovieView - QTMovieView; rate problems...
Dear developers, One important aspect of my app is teh ability to speed and slow audio (and video playback). On the old NSMovieview this worked like an analog tape machine: if you used NSMovieview setRate: it would slow the sound down smoothly but make it lower; which is fine. Under the new regime, the audio playback using [[QTMovieview movie] setRate: (float)] you get VERY choppy sound and no variation in tone. I don't actually care about the variation in tone, I care a lot about the smoothness of the sound. Is there any way to get smooth audio while changing the rate to r != 1? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSKeyedArchiver: confusion
Dear Cocoa-dev, I'm trying to use a keyed archiver to manipulate a file without actually opening it. Everything seems fine at first: I get the data, I copy it into a NSMutableData object, I init a NSKeyedUnarchiver and get the data I need; I create a new object with the old data (an array of dictionaries) with just a couple of the keys changed. I dump the new array of modified dictionaries and everything looks great. I then try to archive it using the following (where theData is my NSMutableData inited with data in a file). masterOutArray = [[NSKeyedArchiver alloc] initForWritingWithMutableData: theData]; [masterOutArray setOutputFormat: NSPropertyListXMLFormat_v1_0]; [masterOutArray encodeObject: myRecs forKey: @codedDataArray]; [masterOutArray finishEncoding]; [masterOutArray release]; The problem: The old @codedDataArray is not replaced! When I open the file the old junk is all there. The old array is not discarded and replaced with the new (myRecs) array. So I cannot use NSKeyedArchiver like an NSMutableDictionary? Hoping for clarity and possible approaches Thanks, Matthew Weinstein Matthew Weinstein Associate Professor of Science Education Education Program U.W. - Tacoma 253 692-4787 matth...@u.washington.edu Campus Box: 358435 1900 Commerce Street Tacoma, WA 98402-3100 Office: (253) 692-4787 FAX: (253) 692-5612 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSKeyedArchiver: confusion
My mistake for not being clear: I have an NSData in an object; I read that data using a keyedArchiver to get to the chunk I want. I want to replace a chunk of that data with another using the same key. (the file part is immaterial). On May 18, 2010, at 2:10 PM, Jens Alfke wrote: On May 18, 2010, at 1:40 PM, Matthew Weinstein wrote: The problem: The old @codedDataArray is not replaced! When I open the file the old junk is all there. The old array is not discarded and replaced with the new (myRecs) array. So I cannot use NSKeyedArchiver like an NSMutableDictionary? I’m not sure I understand. Were you expecting the code you posted to write to the file? But nowhere in that code did you specify what file to write to. Archivers don’t directly know about files; they work on in-memory data. (Yes, there are convenience class methods for reading and writing a file, but they just call NSData methods to transfer the data to/from a file.) It sounds like what you want to do is call [NSKeyedArchiver archiveRootObject: obj toFile: file]. —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Debugger issue
Dear XCode folk, I'm sure this is obvious but it's got me stumped and googling has produced no solutions. The program always runs with the debugger when I launch with xcode (3.1.4). It doesn't matter if I pick build and go or go; the debugger always launches. In previous versions (2.5) I was able to run w/o the debugger. In general, It's too slow with the debugger up and going for a lot of my debugging work. Is there a way to run this w/o putting it through the debugger? --Matthew ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Ignore last message...
The XCode problem was solved. Guard Molloch [sic] was the culprit. --Matthew ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Dealing with rotten nibs
I have a very large nib file that lately has refused to make any connections. I can cntrl-click and get the wire but the other end is refused by all objects. Nothing seems to allow connections either interface elements or objects; outlets or actions... Has anyone run into this, and any fixes? --Matthew Weinstein ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Dealing with rotten nibs
It's associated with an NSDocument... On Feb 6, 2010, at 9:41 AM, edole...@gmail.com wrote: is it assoc with a view controller class? -- Sent from the Verizon network using Mobile Email --Original Message-- From: Matthew Weinstein mwein...@kent.edu To: cocoa-dev@lists.apple.com Date: Sat, Feb 6, 8:55 AM -0800 Subject: Dealing with rotten nibs I have a very large nib file that lately has refused to make any connections. I can cntrl-click and get the wire but the other end is refused by all objects. Nothing seems to allow connections either interface elements or objects; outlets or actions... Has anyone run into this, and any fixes? --Matthew Weinstein ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/edolecki%40gmail.com This email sent to edole...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSTableView questions (take 2)
Still trying to find a way to turn off setAllowsMultipleSelection just as the table becomes the responder. Is there some way of anticipating this, a willbecomefirstresponder kind of a notification? Thanks in advance, Matthew Weinstein ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTableView questions (take 2)
Thanks Corbin, So this is the rub: If I just set allowsMultipleSelection: NO in interface builder and don't set allowsMultipleSelection:YES [programmatically right before doing the setSelected... (though I have to support 10.2-?? so I am still using setSelectedRow...)] I get the following error: 2010-02-02 09:02:06.039 TAMSAnalyzer[30180:10b] *** Assertion failure in -[NSTableView selectRow:byExtendingSelection:], /SourceCache/AppKit/ AppKit-949.54/TableView.subproj/NSTableView.m:9223 2010-02-02 09:02:06.040 TAMSAnalyzer[30180:10b] Invalid parameter not satisfying: !extend || _tvFlags.allowsMultipleSelection 2010-02-02 09:02:24.675 TAMSAnalyzer[30180:10b] *** Assertion failure in -[NSTableView selectRow:byExtendingSelection:], /SourceCache/AppKit/ AppKit-949.54/TableView.subproj/NSTableView.m:9223 2010-02-02 09:02:24.675 TAMSAnalyzer[30180:10b] Invalid parameter not satisfying: !extend || _tvFlags.allowsMultipleSelection If I do programatically allow multiple selection in table B right before I do the setSelectedRow: byExtending...:YES; it seems to work fine. That is, until I click in Table B, there it's allowing multiple selections and I don't want it to. THE PROBLEM is when to turn off the allowMultipleSelection. I need to capture the mouse down when the user clicks in table B to forbid multiple selections (back to its default state). On Feb 2, 2010, at 9:08 AM, Corbin Dunn wrote: Table b should be set to setAllowsMultipleSelection:NO. However, despite that, you can programmatically change the selection yourself with -setSelectedRowIndexes:byExtendingSelection: when the selection in Table A changes. --corbin I have 2 tables that basically have a many to many relationship. If I click on table A I want multiple values of table B to be selected; but I click on table B I want to make sure I can't select multiple values On Feb 2, 2010, at 8:53 AM, Corbin Dunn wrote: On Feb 2, 2010, at 8:32 AM, Matthew Weinstein wrote: Still trying to find a way to turn off setAllowsMultipleSelection just as the table becomes the responder. Is there some way of anticipating this, a willbecomefirstresponder kind of a notification? What are you really trying to do? Or, in other words, what is the goal with doing this? --corbin ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTableView questions (take 2)
Problem somewhat solved. Landed up subclassing nstableview and overriding mouseDown: Works well (at least on my machine). On Feb 2, 2010, at 9:08 AM, Corbin Dunn wrote: Table b should be set to setAllowsMultipleSelection:NO. However, despite that, you can programmatically change the selection yourself with -setSelectedRowIndexes:byExtendingSelection: when the selection in Table A changes. --corbin I have 2 tables that basically have a many to many relationship. If I click on table A I want multiple values of table B to be selected; but I click on table B I want to make sure I can't select multiple values On Feb 2, 2010, at 8:53 AM, Corbin Dunn wrote: On Feb 2, 2010, at 8:32 AM, Matthew Weinstein wrote: Still trying to find a way to turn off setAllowsMultipleSelection just as the table becomes the responder. Is there some way of anticipating this, a willbecomefirstresponder kind of a notification? What are you really trying to do? Or, in other words, what is the goal with doing this? --corbin ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
dynamic changing of ability to set multiple selections...
Dear cocoa-ites, I have multiple linked NSTableViews in an app. Depending on which one is clicked in the others change their contents. Now normally if someone clicks on table 1 they should not be allowed to have multiple selections; but if they click in table 2, the application needs to be able to select multiple items from table one. At present the way I handle this is that if they click (actually double click) in table 2. [table1 setAllowMultipleSelection: YES ] is called, and then if I receive a selectiondidchange notification I check to see if it's table 1 and change it back to NO (a little more tricky than this, since messing in table 2 will send that notification so I have an object wide flag that I set to prevent this). But this looks sloppy. The user actally can select multiple cells in table 1 but suddenly they are reduced to a single cell (versus not being able to select multiple cells). Is there a better way to turn off and turn on this behavior? Thanks in advance! Matthew ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Mail type in-line objects
Hoping that there is somewhere a class or a demo of how to code for nstextview and the like little objects like the mail addresses in the to: line of apple mail. Hope someone can help; it would help bring my app to a new level. Matthew Weinstein [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
nstoken for nstextview...
Okay, but I'm looking for something related to nstextview rather than nstextfield. Anything that anyone knows out there like that. It's perfect except I need something more wordprocessorish. --Matthew Have a look at the documentation for NSTokenField, it does what you are looking for. http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSTokenField_Class/Reference/Reference.html -Mike On May 2, 2008, at 10:27 PM, Matthew Weinstein wrote: Hoping that there is somewhere a class or a demo of how to code for nstextview and the like little objects like the mail addresses in the to: line of apple mail. Hope someone can help; it would help bring my app to a new level. Matthew Weinstein [EMAIL PROTECTED] Matthew Weinstein [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]