Re: Problem with distributed objects in GUI cocoa apps
Thank you very much. I had already solved the problem before yor response. It had to do with disabling sandboxing at all. However i will follow your advice and start reading about NSXPCConnection. One quick question: DO API is not available on iOS. Do you know if NSXPCConnection is? 2014-04-24 8:32 GMT+03:00 Charles Srstka : > On Mar 30, 2014, at 3:28 AM, Costas Chatzinikolas < > costas.chatziniko...@gmail.com> wrote: > > > Hi everyone, > > > > i recently made a set of 2 command lines apps in Cocoa, that use > > Distributed objects to communicate. In fact, the first app is the client > > that sends a message, the second app is the server the vends the object. > > Everything works ok!!! > > > > Then i tried to make these 2 apps GUI based. I used the same code. The > > server vends the object, but the client is unable to get the connection. > It > > always gets a nil connection. In fact when i check the number of > available > > connections from the client using: > > > > [NSConnection allConnections] > > > > it always return zero connections. The only difference in my code is that > > in the GUI server app, i don't use: > > > > [[NSRunLoop currentRunLoop] run] > > > > since the GUI app has its own runLoop. > > > > I also have enabled the sandbox networking capabilities for both GUI > apps. > > > > Has anyone experience this behavior before me? > > > > Thanks in advance... > > Distributed Objects is pretty old and crusty at this point. You might want > to look into NSXPCConnection instead, which fixes a lot of problems that DO > had, and is likely to be better supported. > > Charles > > ___ 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 on NSScrollView
On 30 Apr 2014, at 12:20 pm, Varun Chandramohan wrote: > Can someone tell me if NSScrollView can be extended to work like that? Any > suggestions? You don't want to extend or subclass NSScrollView. Instead just put a custom view inside it. You can set up drag and drop in any view - check out the NSDraggingDestination protocol. --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: Question on NSScrollView
On 2014 Apr 29, at 19:20, Varun Chandramohan wrote: > In my app I have a scrollview that displays a list of file paths which is > populated by NSArrayController. Understand that what you actually have there is, I presume, a ** NSTableView ** inside of an NSScrollView. Researching how to implement drag and drop with ** NSTableView ** should bring up plenty of results :) ___ 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: Creating selector for nonexistent method
On Apr 29, 2014, at 3:30 PM, Greg Parker wrote: > On Apr 29, 2014, at 11:38 AM, Charles Srstka wrote: >> So it seems that even if the method is defined in a header, you need it to >> be in the @implementation block of a class for which you have the code in >> order to use @selector without setting off -Wselector. This means that >> @selector cannot be used for methods in framework classes. > > Which compiler version is that? I think the compiler's diagnostics have been > improved here. It's the compiler that ships with Xcode 5.1.1 (5B1008). >> You will need to either use NSSelectorFromString, find a way to use a >> blocks-based approach (if it's possible), or just turn off -Wselector. > > One of the selector warnings (-Wundeclared-selector, in my compiler) is not > part of -Wall precisely because it can be prone to false positives. If you > don't like it, turn it off. It's not -Wundeclared-selector that causes it, it's -Wselector: #import // the warning doesn't occur unless there's an @implementation in the current source file @interface Foo : NSObject @end @implementation Foo @end int main (__unused int argc, __unused const char **argv) { @autoreleasepool { NSArray *array = [NSArray new]; [array sortedArrayUsingSelector:@selector(compare:)]; } return 0; } $ clang -Wselector -framework Foundation test.m test.m:13:41: warning: creating selector for nonexistent method 'compare:' [-Wselector] [array sortedArrayUsingSelector:@selector(compare:)]; ^ 1 warning generated. $ However, with -Wundeclared-selector instead: $ clang -Wundeclared-selector -framework Foundation test.m $ Charles ___ 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 on NSScrollView
Hi Guys, In my app I have a scrollview that displays a list of file paths which is populated by NSArrayController. This work well, except that I wanted to add some fancy functionality to it. I have seen some apps allow dragging a file from Finder into scroll view to add it. This is a neat functionality without the need to have buttons to manipulate the list. Can someone tell me if NSScrollView can be extended to work like that? Any suggestions? Regards, Varun ___ 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: NSHelpManager
On 2014 Apr 29, at 16:44, Tom Doan wrote: > The only problem now is that the [keyboard shortcut] command-? still goes to > the help search box. First of all, understand that the search field, the first menu item under “Help”, gives two groups of results, “Menu Items” and “Help Topics”. To see this in action, right now, in Mail.app, enter the word “Mailbox” in there. Both groups should work normally, as your Mac users will expect. > I don't see how to cut the stop at the search box out of the process. I don’t think you want to do that. Maybe you’re thinking the the second group should be a “context-sensitive” search, filtering results for relevance to the current window, but that’s going to make very little difference in practice. Furthermore, users who are poking around in Help might be in the wrong window for what they want to do anyhow. Unless I’m misunderstanding, you should just ship it :) ___ 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: NSHelpManager
Thanks for the tips. That *almost* works the way I want. I mapped the Help menu item to a doHelp sent to the (custom) application class rather than showHelp. The only problem now is that the command-? still goes to the help search box. If I then choose the "WinTD Help" item under the search box, it goes through my custom help handling and pops up the correct window. I don't see how to cut the stop at the search box out of the process---it doesn't *look* like the Help is a custom NSMenuItem, but it sure acts like one. Best regards, Tom Doan Estima > On 2014 Apr 25, at 10:38, Tom Doan wrote: > > > 1. NSHelpManager does not seem to have a way to open up a page based > > upon the file name (just "anchors" and search strings), while the > > older Apple Help did. Am I missing something there? > > I don´t think so. All my pages begin with, an or etc., > which have "id" attributes, which are good for anchors. > > > user hits the help keys on a dialog ... opens up the help with the > > specific page for that dialog > > > 2. Under Windows, if you hit the F1 key, WM_HELP messages are > > sent up the chain, so I just have to process that at the desired > > level. I was hoping that there would similarly be a showHelp in > > NSResponder, but it appears that showHelp always goes straight to > > the NSApplication. Is there any way to work get the type of behavior > > I need? > > Don´t use -[NSApplication showHelp:]. Define your own action method > that you implement in various classes ("levels"). Then wire your > button´s target to this method in First Responder. > > By the way, although NSHelpManager is Cocoa, > apple-help-author...@lists.apple.com is also a resource for this > stuff. > > > ___ > > 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/tomd%40estima.com > > This email sent to t...@estima.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: Creating selector for nonexistent method
On 30 Apr 2014, at 4:38, Charles Srstka wrote: > So it seems that even if the method is defined in a header, you need it to be > in the @implementation block of a class for which you have the code in order > to use @selector without setting off -Wselector. This means that @selector > cannot be used for methods in framework classes. You will need to either use > NSSelectorFromString, find a way to use a blocks-based approach (if it's > possible), or just turn off -Wselector. Yep, this seems to be it. Implementing a second clear: in the same class as the warning, does make the warning go away (even though that method would never be called). Thank you. Now I’m turning off that warning satisfied. ___ 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: Creating selector for nonexistent method
On Apr 29, 2014, at 11:38 AM, Charles Srstka wrote: > So it seems that even if the method is defined in a header, you need it to be > in the @implementation block of a class for which you have the code in order > to use @selector without setting off -Wselector. This means that @selector > cannot be used for methods in framework classes. Which compiler version is that? I think the compiler's diagnostics have been improved here. > You will need to either use NSSelectorFromString, find a way to use a > blocks-based approach (if it's possible), or just turn off -Wselector. One of the selector warnings (-Wundeclared-selector, in my compiler) is not part of -Wall precisely because it can be prone to false positives. If you don't like it, turn it off. -- Greg Parker gpar...@apple.com Runtime Wrangler ___ 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: Help with Help
It's best to use Apple's help. However, you may want to consider the case where your app supports a localization that Apple's Help app doesn't and give the user the option of opening your help pages in the user's web browser. In one app some time back, the help would show English while the user was running Turkish. That particular case may be workable now, but a similar one may occur. See how Apple does this in Xcode for their documentation viewer. -- Gary L. Wade (Sent from my iPhone) http://www.garywade.com/ > On Apr 29, 2014, at 10:52 AM, Gordon Apple wrote: > > We would like to get a recommendation on the best way to generate a help > system for a fairly complex application. We started by using a simple web > view and created about 120 screens in BBEdit, mostly drill-down outlines. > Unfortunately, this has been proven to be difficult to maintain. We¹ve > looked into web generators like RapidWeaver, Freeway, and even Dreamweaver, > but all of these have been described as ³roach motels² where you enter but > can never leave. > > We would like to have both local and web-based or web-updated content and > have contextual help. This all brings us to Apple¹s ³Help Book², which seems > to have been around forever and presents its own learning curve. So the > question is: Is this the way to go? It it still current? What are the > experiences in using it? ___ 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: Creating selector for nonexistent method
On Apr 29, 2014, at 8:18 AM, Arved von Brasch wrote: > Hi List, > > I have a warning that I’m trying to understand. Hopefully someone here can > shed some light on it. > > I have two relevant classes. My window controller: > > @interface ISWindowController : NSWindowController > … > - (IBAction)clear: (id)sender; > ... > @end > > This method is implemented and works as expected if called directly. (It > clears the search field in the toolbar.) > > In the second class, an NSArrayController subclass, I have the following > method override: > > - (id)newObject { > NSManagedObject *newObject = [super newObject]; > ... > // Clear the Search Field via the Window Controller (Responder Chain) > [NSApp sendAction: @selector(clear:) to: nil from: table]; > … > } > > sendAction:to:from: seems to be the preferred way to invoke the responder > chain to implement the clear: method in the Window controller. However, it > generates the following warning: > > “Creating selector for nonexistent method ‘clear:’ > > I can’t figure out how to get rid of this warning. The window controller’s > header file is imported into the second class. Removing the import causes a > second warning to be generated on the same line, which is what I expected > (Undeclared selector). I’ve also tried using other ways of invoking the > responder chain, like tryToPerform:with: on the table the Array Controller is > managing. It seems to be any attempt to use @selector() that is causing the > warning. > > I know how to turn off this warning, what I’d like to understand is why it’s > coming out at all. I thought I was doing everything right here. I've been having the same issue, so I filed a Radar report on it a while back (rdar://16600230). The first case that was causing it was: NSArray *array = ...; NSArray *sortedArray = [array sortedArrayUsingSelector:@selector(compare:)]; // warns about nonexistent selector "compare:" This one can be worked around by using -sortedArrayUsingComparator: instead. What can't be as easily worked around are things like this: - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { // or -respondsToSelector:, +resolveInstanceMethod:, etc. SEL action = menuItem.action; // insert any framework-defined method here; we'll use -performTextFinderAction: as an example if (sel_isEqual(action, @selector(performTextFinderAction:))) { // warns about nonexistent selector "performTextFinderAction:" // do something } return [super validateMenuItem:menuItem]; } As far as I can tell, the only way to make that work without warning is to use NSSelectorFromString, which of course undermines the purpose of having -Wselector turned on in the first place, since any typo in the selector string will remain unnoticed until it causes things to fail at runtime. Unfortunately, my Radar report was closed with the status "Behaves Correctly." This was the rationale: "Engineering has determined that this issue behaves as intended based on the following: This warning is as expected. Intention of this warning is to warn about unimplemented methods in current TU when method is used in a @selector expression. Note that in user test case " -compare:" has been declared but not implemented. But, why do we get this warning only if a random @implementation is added to the TU (as user discovered)? This warning is issued only when the selector meta-data table is generated which requires at least one implementation. This warning comes from gcc's legacy and seems to enforce coding style that the @implementation in the TU must implement the method used in the @selector expression. We are now closing this bug report. If you have questions regarding the resolution of this issue, please update your bug report with that information. Please be sure to regularly check new Apple releases for any updates that might affect this issue." So it seems that even if the method is defined in a header, you need it to be in the @implementation block of a class for which you have the code in order to use @selector without setting off -Wselector. This means that @selector cannot be used for methods in framework classes. You will need to either use NSSelectorFromString, find a way to use a blocks-based approach (if it's possible), or just turn off -Wselector. Charles ___ 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: Creating selector for nonexistent method
On Apr 29, 2014, at 9:56 AM, Kyle Sluder wrote: >>> “Creating selector for nonexistent method ‘clear:’ >>> >>> what I’d like to understand is why it’s coming out at all. >> >> Because when compiling that array controller's file, it has no idea that >> -clear: exists anywhere in any header it's importing. > > Arved said: “The window controller’s header file is imported into the second > class.” > > I presume by “second class”, Arved means “the implementation file for the > array controller subclass.” Oops. Apparently I skipped an important sentence. ;-) I'm stumped then. Maybe it's bad live-issues data? It's been known to happen… often. -- Seth Willits ___ 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: Creating selector for nonexistent method
On Apr 29, 2014, at 06:18 , Arved von Brasch wrote: > sendAction:to:from: seems to be the preferred way to invoke the responder > chain to implement the clear: method in the Window controller. This puzzles me. What are you actually trying to do? If you’re trying to invoke *the* clear: method in the window controller, then ‘sendAction:to:from:’ seems like a bad choice. You don’t know if the window controller is even in the responder chain leading upwards from the current first responder, and you don’t know if other responders in the chain also implement ‘clear:’. In other words, you’re essentially sending ‘clear:’ to a random receiver. To send a message to the window controller specifically, you’d do better to get a reference to it, and send the message normally. If the window isn’t related to a NSDocument, it’s reasonable to let your app delegate have a reference to the window controller publicly available. If it’s a document window, you can look in the document’s ‘windowControllers’ array. Even something like ‘[[NSApplication main/keyWindow] windowController]’ (with a check on the window controller class) would be preferable. If you’re trying to invoke *a* clear: method in any of several places in the responder chain, then ignore everything I just said. ___ 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
Help with Help
We would like to get a recommendation on the best way to generate a help system for a fairly complex application. We started by using a simple web view and created about 120 screens in BBEdit, mostly drill-down outlines. Unfortunately, this has been proven to be difficult to maintain. We¹ve looked into web generators like RapidWeaver, Freeway, and even Dreamweaver, but all of these have been described as ³roach motels² where you enter but can never leave. We would like to have both local and web-based or web-updated content and have contextual help. This all brings us to Apple¹s ³Help Book², which seems to have been around forever and presents its own learning curve. So the question is: Is this the way to go? It it still current? What are the experiences in using it? ___ 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: Creating selector for nonexistent method
> On Apr 29, 2014, at 9:29 AM, Seth Willits wrote: > >> On Apr 29, 2014, at 6:18 AM, Arved von Brasch wrote: >> >> “Creating selector for nonexistent method ‘clear:’ >> >> what I’d like to understand is why it’s coming out at all. > > Because when compiling that array controller's file, it has no idea that > -clear: exists anywhere in any header it's importing. Arved said: “The window controller’s header file is imported into the second class.” I presume by “second class”, Arved means “the implementation file for the array controller subclass.” --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: Creating selector for nonexistent method
On Apr 29, 2014, at 6:18 AM, Arved von Brasch wrote: > “Creating selector for nonexistent method ‘clear:’ > > what I’d like to understand is why it’s coming out at all. Because when compiling that array controller's file, it has no idea that -clear: exists anywhere in any header it's importing. If you import the ISWindowController header, it'd go away. Your other option is to make a protocol (say, if this array controller is legitimately not supposed to know that ISWindowController exists) or just declare a category on NSObject or something that has -clear: in it if you really want to just shut it up ASAP. -- Seth Willits ___ 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
Creating selector for nonexistent method
Hi List, I have a warning that I’m trying to understand. Hopefully someone here can shed some light on it. I have two relevant classes. My window controller: @interface ISWindowController : NSWindowController … - (IBAction)clear: (id)sender; ... @end This method is implemented and works as expected if called directly. (It clears the search field in the toolbar.) In the second class, an NSArrayController subclass, I have the following method override: - (id)newObject { NSManagedObject *newObject = [super newObject]; ... // Clear the Search Field via the Window Controller (Responder Chain) [NSApp sendAction: @selector(clear:) to: nil from: table]; … } sendAction:to:from: seems to be the preferred way to invoke the responder chain to implement the clear: method in the Window controller. However, it generates the following warning: “Creating selector for nonexistent method ‘clear:’ I can’t figure out how to get rid of this warning. The window controller’s header file is imported into the second class. Removing the import causes a second warning to be generated on the same line, which is what I expected (Undeclared selector). I’ve also tried using other ways of invoking the responder chain, like tryToPerform:with: on the table the Array Controller is managing. It seems to be any attempt to use @selector() that is causing the warning. I know how to turn off this warning, what I’d like to understand is why it’s coming out at all. I thought I was doing everything right here. Thanks for any insights, Arved ___ 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: copy and mutableCopy
Op 27 apr 2014, om 11:00 heeft Dave het volgende geschreven: > Hi All, > > A long time back, I remember reading something about the way in which copy > and mutableCopy are implemented. I think basically it said that: > > someObject = [someOtherObject copy]; > > or > > someObject = [someOtherObject mutableCopy]; > > Wouldn’t necessarily allocate any extra data storage. I’ve been searching for > it to refresh my memory, but I can’t see to find it anywhere. Does anyone > know if this document or something like it exists somewhere? > > Thanks a lot > Dave Maybe this is what you are looking for? http://disanji.net/iOS_Doc/#documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmImplementCopy.html Willeke ___ 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