Re: Mod (%) function in C/Objective-C?
On 12 Aug 2014, at 00:41, Keary Suska cocoa-...@esoteritech.com wrote: On Aug 11, 2014, at 2:52 PM, Dave d...@looktowindward.com wrote: On 10 Aug 2014, at 16:16, Keary Suska cocoa-...@esoteritech.com wrote: I don't think so, although I would expect a C lib somewhere to address it. Anyway, isn't easier to just always abs(x)%y? abs(x)%y Doesn’t give the same result, it’s one off: myIndex: -5 myMod: 1 abs(x)%y: 2 myIndex: -4 myMod: 2 abs(x)%y: 1 myIndex: -3 myMod: 0 abs(x)%y: 0 myIndex: -2 myMod: 1 abs(x)%y: 2 myIndex: -1 myMod: 2 abs(x)%y: 1 myIndex: 0 myMod: 0 abs(x)%y: 0 myIndex: 1 myMod: 1 abs(x)%y: 1 myIndex: 2 myMod: 2 abs(x)%y: 2 myIndex: 3 myMod: 0 abs(x)%y: 0 myIndex: 4 myMod: 1 abs(x)%y: 1 Where: myIndex = input value. myMod = result of calling the mod function I added. abs(x)%y = abs(x)%y. Maybe my brain isn't working correctly but that doesn't make sense to me. Could you show the output with both x and y shown? Now, you aren't dividing by a negative integer, are you? I believe that is undefined… I’m not doing any division, the function for “myMod” is as I posted: Try it yourself: NSInteger myIndex; NSInteger myNewIndex; NSInteger myNewNewIndex; for (myIndex = -5;myIndex 5;myIndex++) { myNewIndex = [self modulusWithDividend:myIndex andDivisor:3]; myNewNewIndex = abs(myIndex) % 3; NSLog(@myIndex: %i myNewIndex: %i myNewNewIndex: %i,myIndex,myNewIndex,myNewNewIndex); } — If you think of the number as being used as an Index into an NSArray, you can see why a true mod function is better, e.g. -1 gets you the last element, -2 the second from last and so on. Cheers Dave ___ 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
How to get SDK at compile time?
At runtime I do: // 10.8.x or earlier needsSpecialTreatment BOOLneedsSpecialTreatment = floor(NSFoundationVersionNumber) = NSFoundationVersionNumber10_8; But how to do it at compile time? Like: #if BEFORE_10_10 -- what to write here? NSString *infoPlistKey = kSMInfoKeyPrivilegedExecutables; #else NSString *infoPlistKey = @SMPrivilegedExecutables; #endif Gerriet. ___ 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: How to get SDK at compile time?
On Aug 12, 2014, at 02:44:000, Gerriet M. Denkmann wrote: At runtime I do: // 10.8.x or earlier needsSpecialTreatment BOOL needsSpecialTreatment = floor(NSFoundationVersionNumber) = NSFoundationVersionNumber10_8; But how to do it at compile time? Like: #if BEFORE_10_10 -- what to write here? NSString *infoPlistKey = kSMInfoKeyPrivilegedExecutables; #else NSString *infoPlistKey = @SMPrivilegedExecutables; #endif Gerriet. Hi ! AvailabilityMacros.h has lots of useful macros for such situations, and is well self-documented, so check it out (for me its at /usr/local/AvailabilityMacros.h). For my similar situations, I use the form. #if MAC_OS_X_VERSION_MIN_REQUIRED = MAC_OS_X_VERSION_10_5 // newer stuff #else // older stuff #endif Manoah F. Adams federaladamsfamily.com/developer === ___ 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: How to get SDK at compile time?
On 12 Aug 2014, at 17:20, Manoah F. Adams mhfad...@federaladamsfamily.com wrote: On Aug 12, 2014, at 02:44:000, Gerriet M. Denkmann wrote: At runtime I do: // 10.8.x or earlier needsSpecialTreatment BOOL needsSpecialTreatment = floor(NSFoundationVersionNumber) = NSFoundationVersionNumber10_8; But how to do it at compile time? Like: #if BEFORE_10_10 -- what to write here? NSString *infoPlistKey = kSMInfoKeyPrivilegedExecutables; #else NSString *infoPlistKey = @SMPrivilegedExecutables; #endif Gerriet. Hi ! AvailabilityMacros.h has lots of useful macros for such situations, and is well self-documented, so check it out (for me its at /usr/local/AvailabilityMacros.h). For my similar situations, I use the form. #if MAC_OS_X_VERSION_MIN_REQUIRED = MAC_OS_X_VERSION_10_5 // newer stuff #else // older stuff #endif Excellent. Just what I needed. Thanks a lot! Kind regards, Gerriet. ___ 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
NSMenu in NSTableView column
Hi all, I am trying to implement a popup menu in an NSTableView column. I seem to have the bindings all set up so that the values in my NSArray are updated according to the options the user selects in the table. However, I would like to have some way of accessing the tag on the menu item that was selected for each row. I thought I could wire up an outlet to the NSMenu object attached to the table column, but when I later attempt to access the relevant menu item in the menu (in order to look up its tag), I get the following runtime error: -[NSMenu itemAtIndex:]: message sent to deallocated instance I do not encounter this error if I bind to a standalone popup menu, so I don't think I'm doing anything wildly stupid here. I can imagine that within the table the popup menu objects are being dynamically allocated, so the outlet plan isn't working out. My question then is how should I access the tags in the popup menu in order to work out which tag corresponds to the selected item in each row? Thanks for any suggestions Jonny ___ 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
When to call super
Is there a sure-fire way to know when it is necessary to call super in an override? Sample code shows that calling super is necessary for methods such as -(id)init - (void)windowControllerDidLoadNib but not for (NSData *)dataOfType (BOOL)readFromData How can you know for sure? This question occurred to me recently when I realized that my implementation of (NSApplicationTerminateReply)applicationShouldTerminate did not call super and I was wondering whether I should. Currently, I just clean up and return NSTerminateNow. Thanks for any reply. — Michael P. McLaughlin ___ 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: When to call super
Is there a sure-fire way, no. It’s usually fairly clear however. Normally you call super if you override a method unless it tells you not to in the documentation or you are clearly trying to make something NOT do what the superclass did. I suppose my handwaving rule is if a method ‘does’ something and you override it to do more stuff as well, you probably still want the old stuff one, so call super (viewDidAppear: .. etc). If you are overriding a method which calculates and returns something, then unless you want the result super gives you as a starting point, since you are returning a calculation, you don’t want to call super (eg hitTest:withEvent:) The docs for UIView’s drawRect: for instance tell you when to and when not to so some are documented to help you For those cases you list below, two of them are documented to throw exceptions, so you wouldn’t call them and the last one is a delegate method, so it doesn’t have a super. I know they were just examples you picked at random, but you can often come up with the right answer just by asking, what does the superclass method do, and do I still want it to do that. On 12 Aug 2014, at 9:02 pm, McLaughlin, Michael P. mp...@mitre.org wrote: Is there a sure-fire way to know when it is necessary to call super in an override? Sample code shows that calling super is necessary for methods such as -(id)init - (void)windowControllerDidLoadNib but not for (NSData *)dataOfType (BOOL)readFromData How can you know for sure? This question occurred to me recently when I realized that my implementation of (NSApplicationTerminateReply)applicationShouldTerminate did not call super and I was wondering whether I should. Currently, I just clean up and return NSTerminateNow. Thanks for any reply. — Michael P. McLaughlin ___ ___ 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: Mod (%) function in C/Objective-C?
On Aug 12, 2014, at 1:42 AM, Dave d...@looktowindward.com wrote: Maybe my brain isn't working correctly but that doesn't make sense to me. Could you show the output with both x and y shown? Now, you aren't dividing by a negative integer, are you? I believe that is undefined… Yes, it's my brain. I just needed to see it to make sense of it. I’m not doing any division, the function for “myMod” is as I posted: Well, it is the divisor I was asking about and although you aren't interested in the quotient, you are asking for division to occur. If you think of the number as being used as an Index into an NSArray, you can see why a true mod function is better, e.g. -1 gets you the last element, -2 the second from last and so on. I see that you are interested in a circular index. Most of the time I find myself needing a remainder result more than a true modulo, so I use abs(). That definitely won't work when you need the true series. Keary Suska Esoteritech, Inc. Demystifying technology for your home or business ___ 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: NSMenu in NSTableView column
On Aug 12, 2014, at 6:14 AM, Jonathan Taylor jonathan.tay...@glasgow.ac.uk wrote: I am trying to implement a popup menu in an NSTableView column. I seem to have the bindings all set up so that the values in my NSArray are updated according to the options the user selects in the table. However, I would like to have some way of accessing the tag on the menu item that was selected for each row. I thought I could wire up an outlet to the NSMenu object attached to the table column, but when I later attempt to access the relevant menu item in the menu (in order to look up its tag), I get the following runtime error: -[NSMenu itemAtIndex:]: message sent to deallocated instance I do not encounter this error if I bind to a standalone popup menu, so I don't think I'm doing anything wildly stupid here. I can imagine that within the table the popup menu objects are being dynamically allocated, so the outlet plan isn't working out. It's an intuitive mistake to made--I have made it a few times myself. It is not the case that there is a single menu for the column. In fact, there is a different NSPopupButtonCell for every row with (hopefully) a different NSMenu for each cell. If you construct it all in IB, this is what you get at run-time. My question then is how should I access the tags in the popup menu in order to work out which tag corresponds to the selected item in each row? If I understand your setup correctly, the most direct route is to set an action on each menu item. HTH, Keary Suska Esoteritech, Inc. Demystifying technology for your home or business ___ 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: NSMenu in NSTableView column
My question then is how should I access the tags in the popup menu in order to work out which tag corresponds to the selected item in each row? If I understand your setup correctly, the most direct route is to set an action on each menu item. Ah ok, I've revisited that and got it to work. I'd tried it before and it had had no effect; I'd assumed that was something else that just didn't work with tables. However I've now spotted the compile-time warning about only sending actions to the table view delegate, and after fixing that it works nicely. Thanks very much. Jonny ___ 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: Does NSPointerArray support zeroing weak references under ARC
On Sat, 9 Aug 2014 07:53:57 +0100, Jonathan Mitchell said: Does NSPointerArray support zeroing weak references under ARC? Yes as of 10.8, see the Foundation Release notes: https://developer.apple.com/library/mac/releasenotes/Foundation/RN-FoundationOlderNotes/ Cheers, -- Sean McBride, B. Eng s...@rogue-research.com Rogue Researchwww.rogue-research.com Mac Software Developer Montréal, Québec, Canada ___ 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: Mod (%) function in C/Objective-C?
On 12 Aug 2014, at 15:01, Keary Suska cocoa-...@esoteritech.com wrote: On Aug 12, 2014, at 1:42 AM, Dave d...@looktowindward.com wrote: Maybe my brain isn't working correctly but that doesn't make sense to me. Could you show the output with both x and y shown? Now, you aren't dividing by a negative integer, are you? I believe that is undefined… Yes, it's my brain. I just needed to see it to make sense of it. I’m not doing any division, the function for “myMod” is as I posted: Well, it is the divisor I was asking about and although you aren't interested in the quotient, you are asking for division to occur. If you think of the number as being used as an Index into an NSArray, you can see why a true mod function is better, e.g. -1 gets you the last element, -2 the second from last and so on. I see that you are interested in a circular index. Most of the time I find myself needing a remainder result more than a true modulo, so I use abs(). That definitely won't work when you need the true series. Yes, this is what this thread is about. % was wrongly given the description of the modulus function in the 1960s/1970s and as a result of that one mis-naming “%” in C has been thought as a Modulus operation by a lot of people ever since (and it continues to be mis-described to this very day). The “%” character means a “remainder” not a “Modulus”, but are useful, but in this case I really wanted modulus. Most of the time remainder and modulus are the same thing, but when you introduce negative numbers remainder becomes a mirror image of the positive domain, where as modulus stays the same. I’m not sure what you mean by dividing by a negative number is undefined? It seems to work ok for what I’m doing in another place: NSInteger myIndex; CGPoint myStartPoint; CGSize mySize; myStartPoint = -640; mySize.width = 320; myIndex = myStartPoint.x / mySize.width; myIndex = -2 as expected. Is that what you meant? Dave ___ 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: Mod (%) function in C/Objective-C?
On Aug 12, 2014, at 10:01 AM, Dave d...@looktowindward.com wrote: I’m not sure what you mean by dividing by a negative number is undefined? It sure as hell better be defined, hadn't it? We wouldn't want a language where the basic math ops were that foobar'd! Now in KR C, the direction of truncation was undefined for division with negative integers, but C99 fixed that. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ 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: Mod (%) function in C/Objective-C?
On 12 Aug 2014, at 17:11, Scott Ribe scott_r...@elevated-dev.com wrote: On Aug 12, 2014, at 10:01 AM, Dave d...@looktowindward.com wrote: I’m not sure what you mean by dividing by a negative number is undefined? It sure as hell better be defined, hadn't it? We wouldn't want a language where the basic math ops were that foobar'd! Now in KR C, the direction of truncation was undefined for division with negative integers, but C99 fixed that. Yes, I saw that from the digging I did, I think that’s what he meant. Cheers Dave ___ 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: How to make a LaunchAgent
On Tue, 12 Aug 2014 07:15:16 +0800, Roland King said: In order to be sandboxed at all an app must be signed. An unsigned sandboxed app just isn’t sandboxed. A Mac App or Developer ID cert is good for that. (used to be you could self-sign them but I think that must have gone away long since). You can still use a self-signed certificate, and App Sandbox works in that case too. Cheers, -- Sean McBride, B. Eng s...@rogue-research.com Rogue Researchwww.rogue-research.com Mac Software Developer Montréal, Québec, Canada ___ 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
Common Date between Swift and ObjC
In ObjC I used to do: CommonDefines.h #define PARAMETER_A 17 and then import CommonDefines.h into all files which have to know this parameter. But how do I make a Swift file and an ObjC file both aware of the value of PARAMETER_A? Keeping both in sync is rather error prone; I much rather have the value in only one place (like my CommonDefines.h). Gerriet. ___ 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: Common Date between Swift and ObjC
Gerriet, You should be able to make a constant variable, not a preprocessor definition, and import the file that declares it in your project’s bridging header. Something like this: in Constants.h: extern const NSInteger kParameterA; in Constants.m: const NSInteger kParameterA = 17; Then, in your bridging header, you’d import Constants.h. Jeff Kelley slauncha...@gmail.com | @SlaunchaMan https://twitter.com/SlaunchaMan | jeffkelley.org On Tue, Aug 12, 2014 at 1:47 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: In ObjC I used to do: CommonDefines.h #define PARAMETER_A 17 and then import CommonDefines.h into all files which have to know this parameter. But how do I make a Swift file and an ObjC file both aware of the value of PARAMETER_A? Keeping both in sync is rather error prone; I much rather have the value in only one place (like my CommonDefines.h). Gerriet. ___ 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
iOS deferred purchases
Hi all - Does anyone know if there's yet a way to make test accounts that can generate the new deferred purchase state in iOS 8? Thanks!! . ___ 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: Common Date between Swift and ObjC
On 13 Aug 2014, at 00:52, Jeff Kelley slauncha...@gmail.com wrote: Gerriet, You should be able to make a constant variable, not a preprocessor definition, and import the file that declares it in your project’s bridging header. Something like this: in Constants.h: extern const NSInteger kParameterA; in Constants.m: const NSInteger kParameterA = 17; Then, in your bridging header, you’d import Constants.h. Sounds like a good idea. I will try it tomorrow. Thanks a lot! Kind regards, Gerriet. ___ 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: Common Date between Swift and ObjC
Except the compiler cannot treat them as constants for optimization. Paul On Aug 12, 2014, at 10:57 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: On 13 Aug 2014, at 00:52, Jeff Kelley slauncha...@gmail.com wrote: Gerriet, You should be able to make a constant variable, not a preprocessor definition, and import the file that declares it in your project’s bridging header. Something like this: in Constants.h: extern const NSInteger kParameterA; in Constants.m: const NSInteger kParameterA = 17; Then, in your bridging header, you’d import Constants.h. Sounds like a good idea. I will try it tomorrow. Thanks a lot! Kind regards, Gerriet. smime.p7s Description: S/MIME cryptographic signature ___ 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: Mod (%) function in C/Objective-C?
At 3:24 PM -0600 8/11/14, Scott Ribe wrote: On Aug 11, 2014, at 3:03 PM, Dave d...@looktowindward.com wrote: The first edition of KR mistakenly referred to it as modulus (apparently based on the PDP-11 instruction which was similarly misnamed). When in doubt, remember what C was designed to be: Machine independent PDP-11 assembly language. ;-) ___ 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: NSMenu in NSTableView column
My question then is how should I access the tags in the popup menu in order to work out which tag corresponds to the selected item in each row? If I understand your setup correctly, the most direct route is to set an action on each menu item. Ah ok, I've revisited that and got it to work. I'd tried it before and it had had no effect; I'd assumed that was something else that just didn't work with tables. However I've now spotted the compile-time warning about only sending actions to the table view delegate, and after fixing that it works nicely. Thanks very much. Jonny Actually, I'm not sure that solves my problem as easily as I thought. I'll just restate what I'm trying to achieve to make sure I'm being clear, and then explain the difficulty I'm having in making it work. Each menu item string is a user-readable description of a signal channel, each is associated with a numerical channel ID. However there isn't a natural and obvious relationship between the index of the menu item and the channel ID. It seems sensible to me to have the menu item strings defined in the same place as the numerical IDs. I can imagine two ways of doing this: 1. Define the menu item strings in InterfaceBuilder as menu items, and give each one a tag representing the channel ID. This is what I have been trying to do, but I can't work out how my code should identify the tag associated with the menu item index (which is what I get in my NSArray representing the current state of the table). I can put an action on the menu item, but at the time that is called I don't know which row's menu has just been selected. Also (rather unexpectedly), putting an action on the menu item seems to prevent the selected index binding of the popup cell from being updated. 2. Define the menu item strings and associated channel IDs in my code, and use bindings to populate the menu items. I did try that, but haven't managed to get my strings showing up in the menu. Can anyone recommend clear instructions for making that work? I think I maybe don't properly understand the difference between content values and content, and what exactly they need to be bound to... Any thoughts about how to make either of these work? Cheers Jonny ___ 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: How to get SDK at compile time?
On Tue, 12 Aug 2014 16:44:50 +0700, Gerriet M. Denkmann said: At runtime I do: // 10.8.x or earlier needsSpecialTreatment BOOL needsSpecialTreatment = floor(NSFoundationVersionNumber) = NSFoundationVersionNumber10_8; But how to do it at compile time? Like: #if BEFORE_10_10 -- what to write here? NSString *infoPlistKey = kSMInfoKeyPrivilegedExecutables; #else NSString *infoPlistKey = @SMPrivilegedExecutables; #endif The SDK is MAC_OS_X_VERSION_MAX_ALLOWED. The deployment target is MAC_OS_X_VERSION_MIN_REQUIRED. Cheers, -- Sean McBride, B. Eng s...@rogue-research.com Rogue Researchwww.rogue-research.com Mac Software Developer Montréal, Québec, Canada ___ 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: When to call super
On Tue, 12 Aug 2014 13:02:54 +, McLaughlin, Michael P. said: Is there a sure-fire way to know when it is necessary to call super in an override? Checking the docs is best, but sometimes the compiler will warn you if you fail to call super, if the method was tagged with NS_REQUIRES_SUPER. Cheers, -- Sean McBride, B. Eng s...@rogue-research.com Rogue Researchwww.rogue-research.com Mac Software Developer Montréal, Québec, Canada ___ 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: Common Date between Swift and ObjC
You can use an enum. The compiler treats them as constant and they are available both in Obj-C and Swift. Le 12 août 2014 à 20:04, Paul Scott psc...@skycoast.us a écrit : Except the compiler cannot treat them as constants for optimization. Paul On Aug 12, 2014, at 10:57 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: On 13 Aug 2014, at 00:52, Jeff Kelley slauncha...@gmail.com wrote: Gerriet, You should be able to make a constant variable, not a preprocessor definition, and import the file that declares it in your project’s bridging header. Something like this: in Constants.h: extern const NSInteger kParameterA; in Constants.m: const NSInteger kParameterA = 17; Then, in your bridging header, you’d import Constants.h. Sounds like a good idea. I will try it tomorrow. Thanks a lot! Kind regards, Gerriet. ___ 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/mailing%40xenonium.com This email sent to mail...@xenonium.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
iOS watchdog timeout at startup vs later?
Hi. Is the timeout (the one that kills your app if the main run loop blocks for too long) longer during app startup than after it's running? I'm concerned about the Core Data migration my app does at startup. I will eventually move it to work on a background thread, but I'd like to punt that to the next release in the interests of time. Testing shows very large data sets migrate in less than 10 seconds, and that seems to be acceptable to iOS, but I'd like to know how much wiggle room I have (it's hard for us to make large data sets for this kind of testing, so I can't really just make larger ones to test with). Thanks, -- Rick Mann rm...@latencyzero.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: iOS watchdog timeout at startup vs later?
On Tue, Aug 12, 2014, at 04:00 PM, Rick Mann wrote: Hi. Is the timeout (the one that kills your app if the main run loop blocks for too long) longer during app startup than after it's running? I'm concerned about the Core Data migration my app does at startup. I will eventually move it to work on a background thread, but I'd like to punt that to the next release in the interests of time. Don't punt it. Do it now. Paul Goracke gave a very nice description of the death spiral that ensues if you try to perform a main-thread migration, especially at app launch: http://vimeo.com/89370886 --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
How do I get a black status bar?
I'd like to get a black-background, white-text status bar across my app. But I can't seem to figure out how. I set the Info.plist property for it, and set it to not be controlled by view controllers, but it's always a completely transparent background. What am I missing? Thanks! -- Rick Mann rm...@latencyzero.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: iOS watchdog timeout at startup vs later?
On Aug 12, 2014, at 15:12 , Kyle Sluder k...@ksluder.com wrote: On Tue, Aug 12, 2014, at 04:00 PM, Rick Mann wrote: Hi. Is the timeout (the one that kills your app if the main run loop blocks for too long) longer during app startup than after it's running? I'm concerned about the Core Data migration my app does at startup. I will eventually move it to work on a background thread, but I'd like to punt that to the next release in the interests of time. Don't punt it. Do it now. Paul Goracke gave a very nice description of the death spiral that ensues if you try to perform a main-thread migration, especially at app launch: http://vimeo.com/89370886 Unless we can show that it Just Doesn't Work (which it does), I seriously can't spend the time to do that right now. -- Rick Mann rm...@latencyzero.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: How do I get a black status bar?
On Tue, Aug 12, 2014, at 06:19 PM, Rick Mann wrote: I'd like to get a black-background, white-text status bar across my app. There is no such thing in iOS 7. https://developer.apple.com/Library/ios/documentation/UserExperience/Conceptual/TransitionGuide/Bars.html --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: iOS watchdog timeout at startup vs later?
On Tue, Aug 12, 2014, at 06:24 PM, Rick Mann wrote: On Aug 12, 2014, at 15:12 , Kyle Sluder k...@ksluder.com wrote: On Tue, Aug 12, 2014, at 04:00 PM, Rick Mann wrote: Hi. Is the timeout (the one that kills your app if the main run loop blocks for too long) longer during app startup than after it's running? I'm concerned about the Core Data migration my app does at startup. I will eventually move it to work on a background thread, but I'd like to punt that to the next release in the interests of time. Don't punt it. Do it now. Paul Goracke gave a very nice description of the death spiral that ensues if you try to perform a main-thread migration, especially at app launch: http://vimeo.com/89370886 Unless we can show that it Just Doesn't Work (which it does), I seriously can't spend the time to do that right now. Well in that case, be prepared for rejection from the App Store, or one-star reviews from your customers, when the watchdog repeatedly kills your app during launch. Obviously I don't know your app's architecture, but conceptually, even if you're using the thread-confinement model, you just need to throw up some form of modal UI while you perform the migration on a background thread. --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: iOS watchdog timeout at startup vs later?
In most cases, migration is very fast, and therefore not a problem. I'm trying to gauge how big a data set I can migrate before it becomes a problem. So, an answer to my actual question would be helpful. I don't care that it may change in the future, I'd like to know what it is now. On Aug 12, 2014, at 16:27 , Kyle Sluder k...@ksluder.com wrote: On Tue, Aug 12, 2014, at 06:24 PM, Rick Mann wrote: On Aug 12, 2014, at 15:12 , Kyle Sluder k...@ksluder.com wrote: On Tue, Aug 12, 2014, at 04:00 PM, Rick Mann wrote: Hi. Is the timeout (the one that kills your app if the main run loop blocks for too long) longer during app startup than after it's running? I'm concerned about the Core Data migration my app does at startup. I will eventually move it to work on a background thread, but I'd like to punt that to the next release in the interests of time. Don't punt it. Do it now. Paul Goracke gave a very nice description of the death spiral that ensues if you try to perform a main-thread migration, especially at app launch: http://vimeo.com/89370886 Unless we can show that it Just Doesn't Work (which it does), I seriously can't spend the time to do that right now. Well in that case, be prepared for rejection from the App Store, or one-star reviews from your customers, when the watchdog repeatedly kills your app during launch. Obviously I don't know your app's architecture, but conceptually, even if you're using the thread-confinement model, you just need to throw up some form of modal UI while you perform the migration on a background thread. --Kyle Sluder -- Rick Mann rm...@latencyzero.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: How do I get a black status bar?
Thanks for reminding me of that. I knew this was the case, but I'm fighting a designer who wants the black background. He threw the Facebook iPad app at me, showing that it puts up a black status bar when the side drawer is opened. I'll just point him at this link. The app looks pretty good as-is, so I don't think that's necessary. On Aug 12, 2014, at 16:24 , Kyle Sluder k...@ksluder.com wrote: On Tue, Aug 12, 2014, at 06:19 PM, Rick Mann wrote: I'd like to get a black-background, white-text status bar across my app. There is no such thing in iOS 7. https://developer.apple.com/Library/ios/documentation/UserExperience/Conceptual/TransitionGuide/Bars.html --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/rmann%40latencyzero.com This email sent to rm...@latencyzero.com -- Rick Mann rm...@latencyzero.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: How do I get a black status bar?
You could always throw an opaque UIView behind it. I did that same effect with a UIToolbar in iOS 7 for a blurred effect. hacky - Cody On Aug 12, 2014, at 4:34 PM, Rick Mann rm...@latencyzero.com wrote: Thanks for reminding me of that. I knew this was the case, but I'm fighting a designer who wants the black background. He threw the Facebook iPad app at me, showing that it puts up a black status bar when the side drawer is opened. I'll just point him at this link. The app looks pretty good as-is, so I don't think that's necessary. On Aug 12, 2014, at 16:24 , Kyle Sluder k...@ksluder.com mailto:k...@ksluder.com wrote: On Tue, Aug 12, 2014, at 06:19 PM, Rick Mann wrote: I'd like to get a black-background, white-text status bar across my app. There is no such thing in iOS 7. https://developer.apple.com/Library/ios/documentation/UserExperience/Conceptual/TransitionGuide/Bars.html --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/rmann%40latencyzero.com https://lists.apple.com/mailman/options/cocoa-dev/rmann%40latencyzero.com This email sent to rm...@latencyzero.com mailto:rm...@latencyzero.com -- Rick Mann rm...@latencyzero.com mailto:rm...@latencyzero.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com mailto: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 http://lists.apple.com/ Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/cody%40servalsoft.com https://lists.apple.com/mailman/options/cocoa-dev/cody%40servalsoft.com This email sent to c...@servalsoft.com mailto:c...@servalsoft.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: How do I get a black status bar?
Yeah, that's what I wanted to make sure I had to do. I agree it's hacky, and I think this app can survive without it. Thanks, Rick On Aug 12, 2014, at 16:41 , Cody Garvin c...@servalsoft.com wrote: You could always throw an opaque UIView behind it. I did that same effect with a UIToolbar in iOS 7 for a blurred effect. hacky - Cody On Aug 12, 2014, at 4:34 PM, Rick Mann rm...@latencyzero.com wrote: Thanks for reminding me of that. I knew this was the case, but I'm fighting a designer who wants the black background. He threw the Facebook iPad app at me, showing that it puts up a black status bar when the side drawer is opened. I'll just point him at this link. The app looks pretty good as-is, so I don't think that's necessary. On Aug 12, 2014, at 16:24 , Kyle Sluder k...@ksluder.com wrote: On Tue, Aug 12, 2014, at 06:19 PM, Rick Mann wrote: I'd like to get a black-background, white-text status bar across my app. There is no such thing in iOS 7. https://developer.apple.com/Library/ios/documentation/UserExperience/Conceptual/TransitionGuide/Bars.html --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/rmann%40latencyzero.com This email sent to rm...@latencyzero.com -- Rick Mann rm...@latencyzero.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/cody%40servalsoft.com This email sent to c...@servalsoft.com -- Rick Mann rm...@latencyzero.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: iOS watchdog timeout at startup vs later?
On 13 Aug 2014, at 00:31, Rick Mann rm...@latencyzero.com wrote: In most cases, migration is very fast, and therefore not a problem. I'm trying to gauge how big a data set I can migrate before it becomes a problem. So, an answer to my actual question would be helpful. I don't care that it may change in the future, I'd like to know what it is now. This is folly because it will depend on how fast the device is, and what else the device is doing also, as that will affect the speed of your migration. The gulf in performance between an iPhone 4/iPad Mini (1st gen) and an iPad Air / iPhone 5S is huge. Like Kyle said, it really has to be done the right way. Painful though it may be. Cheers Marc Palmer Montana Floss Co. Ltd. iOS App Development http://montanafloss.co ___ 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: iOS watchdog timeout at startup vs later?
Sigh. It really doesn't. It's NOT folly. All the devices we support are very similar to each other. On Aug 12, 2014, at 16:49 , Marc Palmer m...@anyware.co.uk wrote: On 13 Aug 2014, at 00:31, Rick Mann rm...@latencyzero.com wrote: In most cases, migration is very fast, and therefore not a problem. I'm trying to gauge how big a data set I can migrate before it becomes a problem. So, an answer to my actual question would be helpful. I don't care that it may change in the future, I'd like to know what it is now. This is folly because it will depend on how fast the device is, and what else the device is doing also, as that will affect the speed of your migration. The gulf in performance between an iPhone 4/iPad Mini (1st gen) and an iPad Air / iPhone 5S is huge. Like Kyle said, it really has to be done the right way. Painful though it may be. Cheers Marc Palmer Montana Floss Co. Ltd. iOS App Development http://montanafloss.co -- Rick Mann rm...@latencyzero.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: iOS watchdog timeout at startup vs later?
On Tue, Aug 12, 2014, at 06:52 PM, Rick Mann wrote: Sigh. It really doesn't. It's NOT folly. All the devices we support are very similar to each other. Folly or not (and I think that it is), your question is unanswerable. It's not documented. You can't rely on it being any particular value. It's not even guaranteed to be constant. You also don't get to choose which devices you support; Apple does. There's no field for supported device speed in iTunes Connect. If your reviewer happens to test on a configuration you consider unsupported, and your app times out during launch, you are looking at a rejection. And since there's no such thing as a partial migration, if it crashes once, it's likely to do it reliably. I'm sorry to keep pounding on this but my conscience will only allow me to advise you to adopt the correct solution. --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
NSSpellChecker exception
I'm getting exception reports from users of an application I'm working on that I cannot reproduce. The exception comes from the NSSpellChecker instance, and the trace looks something like this: NSObjectInaccessibleException NSDistantObject (0x62279bc0) is invalid (no connection) 0x7fff91c61aee 0x7fff8a9fde75 0x7fff916dd10c 0x7fff92f6d6f9 0x7fff9163b0f4 0x7fff9163aea8 0x7fff89151a0c 0x7fff88cda673 0x7fff88cd8664 0x7fff92ef38a1 0x7fff92ef354b 0x7fff9030c28d 0x7fff9030e673 0x7fff9030f9c1 0x7fff9030df87 0x7fff9030f177 0x7fff8d984ef8 0x7fff8d987fb9 NSExceptionHandlerExceptionRaiser (in ExceptionHandling) + 172 objc_exception_throw (in libobjc.A.dylib) + 43 +[NSException raise:format:] (in CoreFoundation) + 204 -[NSDistantObject forwardInvocation:] (in Foundation) + 291 ___forwarding___ (in CoreFoundation) + 452 _CF_forwarding_prep_0 (in CoreFoundation) + 120 -[NSSpellChecker _checkSpellingAndGrammarInString:range:enclosingRange:offset:types:options:orthography:inSpellDocumentWithTag:mutableResults:wordCount:] (in AppKit) + 2071 NSSpellCheckerCheckString (in AppKit) + 8096 -[NSTextCheckingOperation main] (in AppKit) + 152 -[__NSOperationInternal _start:] (in Foundation) + 631 __NSOQSchedule_f (in Foundation) + 64 _dispatch_client_callout (in libdispatch.dylib) + 8 _dispatch_queue_drain (in libdispatch.dylib) + 451 _dispatch_queue_invoke (in libdispatch.dylib) + 110 _dispatch_root_queue_drain (in libdispatch.dylib) + 75 _dispatch_worker_thread2 (in libdispatch.dylib) + 40 _pthread_wqthread (in libsystem_pthread.dylib) + 314 start_wqthread (in libsystem_pthread.dylib) + 13 Most of the time it comes from the -[NSSpellChecker _checkSpellingAndGrammarInString:range:enclosingRange:offset:types:options:orthography:inSpellDocumentWithTag:mutableResults:wordCount:] method, but sometimes from -[NSSpellChecker setIgnoredWords:inSpellDocumentWithTag:]. Also, sometimes the exception is NSPortTimeoutException (connection timeout: did not receive reply), but still related to DOs. The thing is I don't use NSSpellChecker in the application at all. As expected, there are a lot of NSTextField and a few NSTextView instances, but NSSpellChecker is not used directly. Users say exceptions happen in different situations, but mostly when doing something that requires typing into a text field. I do use distributed objects though, to communicate with external helper tools which execute some certain tasks. Connection objects for that communication are created and destroyed as needed. I have created a startup item which runs a DTrace script and prints names and PIDs of processes making any kind of mach_port call, but that didn't give me any clue of why this is happening. I've also list's archive and I couldn't find anything related to this, but I hope someone might have a clue of what's really happening here. -- Dragan -- Dragan ___ 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: NSSpellChecker exception
NSSpellChecker uses DO to connect with the spellchecker process. It properly handles any exceptions that may result, so these exceptions would be caught and handled and you do not need to be reporting them. Douglas Davidson On Aug 12, 2014, at 5:22 PM, Dragan Milić mi...@mac.com wrote: I'm getting exception reports from users of an application I'm working on that I cannot reproduce. The exception comes from the NSSpellChecker instance, and the trace looks something like this: NSObjectInaccessibleException NSDistantObject (0x62279bc0) is invalid (no connection) 0x7fff91c61aee 0x7fff8a9fde75 0x7fff916dd10c 0x7fff92f6d6f9 0x7fff9163b0f4 0x7fff9163aea8 0x7fff89151a0c 0x7fff88cda673 0x7fff88cd8664 0x7fff92ef38a1 0x7fff92ef354b 0x7fff9030c28d 0x7fff9030e673 0x7fff9030f9c1 0x7fff9030df87 0x7fff9030f177 0x7fff8d984ef8 0x7fff8d987fb9 NSExceptionHandlerExceptionRaiser (in ExceptionHandling) + 172 objc_exception_throw (in libobjc.A.dylib) + 43 +[NSException raise:format:] (in CoreFoundation) + 204 -[NSDistantObject forwardInvocation:] (in Foundation) + 291 ___forwarding___ (in CoreFoundation) + 452 _CF_forwarding_prep_0 (in CoreFoundation) + 120 -[NSSpellChecker _checkSpellingAndGrammarInString:range:enclosingRange:offset:types:options:orthography:inSpellDocumentWithTag:mutableResults:wordCount:] (in AppKit) + 2071 NSSpellCheckerCheckString (in AppKit) + 8096 -[NSTextCheckingOperation main] (in AppKit) + 152 -[__NSOperationInternal _start:] (in Foundation) + 631 __NSOQSchedule_f (in Foundation) + 64 _dispatch_client_callout (in libdispatch.dylib) + 8 _dispatch_queue_drain (in libdispatch.dylib) + 451 _dispatch_queue_invoke (in libdispatch.dylib) + 110 _dispatch_root_queue_drain (in libdispatch.dylib) + 75 _dispatch_worker_thread2 (in libdispatch.dylib) + 40 _pthread_wqthread (in libsystem_pthread.dylib) + 314 start_wqthread (in libsystem_pthread.dylib) + 13 Most of the time it comes from the -[NSSpellChecker _checkSpellingAndGrammarInString:range:enclosingRange:offset:types:options:orthography:inSpellDocumentWithTag:mutableResults:wordCount:] method, but sometimes from -[NSSpellChecker setIgnoredWords:inSpellDocumentWithTag:]. Also, sometimes the exception is NSPortTimeoutException (connection timeout: did not receive reply), but still related to DOs. The thing is I don't use NSSpellChecker in the application at all. As expected, there are a lot of NSTextField and a few NSTextView instances, but NSSpellChecker is not used directly. Users say exceptions happen in different situations, but mostly when doing something that requires typing into a text field. I do use distributed objects though, to communicate with external helper tools which execute some certain tasks. Connection objects for that communication are created and destroyed as needed. I have created a startup item which runs a DTrace script and prints names and PIDs of processes making any kind of mach_port call, but that didn't give me any clue of why this is happening. I've also list's archive and I couldn't find anything related to this, but I hope someone might have a clue of what's really happening here. -- Dragan -- Dragan ___ 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/ddavidso%40apple.com This email sent to ddavi...@apple.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: NSMenu in NSTableView column
On Aug 12, 2014, at 12:14 PM, Jonathan Taylor jonathan.tay...@glasgow.ac.uk wrote: My question then is how should I access the tags in the popup menu in order to work out which tag corresponds to the selected item in each row? If I understand your setup correctly, the most direct route is to set an action on each menu item. Ah ok, I've revisited that and got it to work. I'd tried it before and it had had no effect; I'd assumed that was something else that just didn't work with tables. However I've now spotted the compile-time warning about only sending actions to the table view delegate, and after fixing that it works nicely. Thanks very much. Jonny Actually, I'm not sure that solves my problem as easily as I thought. I'll just restate what I'm trying to achieve to make sure I'm being clear, and then explain the difficulty I'm having in making it work. Each menu item string is a user-readable description of a signal channel, each is associated with a numerical channel ID. However there isn't a natural and obvious relationship between the index of the menu item and the channel ID. It seems sensible to me to have the menu item strings defined in the same place as the numerical IDs. I can imagine two ways of doing this: 1. Define the menu item strings in InterfaceBuilder as menu items, and give each one a tag representing the channel ID. This is what I have been trying to do, but I can't work out how my code should identify the tag associated with the menu item index (which is what I get in my NSArray representing the current state of the table). I can put an action on the menu item, but at the time that is called I don't know which row's menu has just been selected. Also (rather unexpectedly), putting an action on the menu item seems to prevent the selected index binding of the popup cell from being updated. 2. Define the menu item strings and associated channel IDs in my code, and use bindings to populate the menu items. I did try that, but haven't managed to get my strings showing up in the menu. Can anyone recommend clear instructions for making that work? I think I maybe don't properly understand the difference between content values and content, and what exactly they need to be bound to... Any thoughts about how to make either of these work? I would create a class, say, SignalChannel, with name (for description, but we may not ant to use description for obvious reasons...) and channelID properties. I would then populate the NSPopupButtonCell with SignalChannel objects. This will abstract the model from the view, which is better form anyway. HTH, Keary Suska Esoteritech, Inc. Demystifying technology for your home or business ___ 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: Mod (%) function in C/Objective-C?
On Aug 12, 2014, at 10:17 AM, Dave d...@looktowindward.com wrote: On 12 Aug 2014, at 17:11, Scott Ribe scott_r...@elevated-dev.com wrote: On Aug 12, 2014, at 10:01 AM, Dave d...@looktowindward.com wrote: I’m not sure what you mean by dividing by a negative number is undefined? It sure as hell better be defined, hadn't it? We wouldn't want a language where the basic math ops were that foobar'd! Now in KR C, the direction of truncation was undefined for division with negative integers, but C99 fixed that. Yes, I saw that from the digging I did, I think that’s what he meant. Yes, that--I didn't realize that C99 fixed that as well. I just figured reasonable compilers handled it reasonably ;-) Although I thought there was still some issue with modulus implementations, but I don't recall exactly. Probably also old information. Keary Suska Esoteritech, Inc. Demystifying technology for your home or business ___ 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: NSSpellChecker exception
On sre 13.08.2014., at 02.30, Douglas Davidson wrote: NSSpellChecker uses DO to connect with the spellchecker process. It properly handles any exceptions that may result, so these exceptions would be caught and handled and you do not need to be reporting them. Thanks, so they can be safely ignored. Does that also apply to similar exceptions (much rarely reported) related to DO and coming from: -[IMKInputSession activate] (in HIToolbox) resulting in NSPortTimeoutException: connection timeout: did not receive reply and -[IMKInputSession deactivate] (in HIToolbox)resulting in NSInvalidSendPortException: [NSMachPort sendBeforeDate:] destination port invalid ??? -- Dragan ___ 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