Re: NSWindow - how to resize it keeping aspect ratio?
Hi, there is of the matter is that -setAspectRatio: sets the window`s aspect ratio, but when window has been loaded from nib and not resized yet, its size is taken from content size that was written in IB with it own aspect. Then when window has been resized it instantly get size to conform aspect. Can you suggest something? 2010/2/18 Eric Gorr mail...@ericgorr.net On Feb 18, 2010, at 1:55 PM, Alexander Bokovikov wrote: Hi, All, I'm sorry if this is a stupid question, but I don't see an evident answer... I need the subj, but don't see appropriate NSWindow method... Am I missing something? You could check out NSWindow's setAspectRatio or setContentAspectRatio. These are discussed in NSWindow's programming guide. ___ 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/arielfapple%40gmail.com This email sent to arielfap...@gmail.com -- best regards Ariel ___ 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
Invitation to connect on LinkedIn
LinkedIn Ariel Feinerman requested to add you as a connection on LinkedIn: -- Cameron, I'd like to add you to my professional network on LinkedIn. - Ariel Accept invitation from Ariel Feinerman http://www.linkedin.com/e/AdB-vBGUaPDD8CAZeSRcxp2nG5JDH2anAKj_Cxr/blk/I563932539_3/pmpxnSRJrSdvj4R5fnhv9ClRsDgZp6lQs6lzoQ5AomZIpn8_cRYVcPkOcPAPdzl9bQJqekEToP8TbP8OdjkNcP8Mcj4LrCBxbOYWrSlI/EML_comm_afe/ View invitation from Ariel Feinerman http://www.linkedin.com/e/AdB-vBGUaPDD8CAZeSRcxp2nG5JDH2anAKj_Cxr/blk/I563932539_3/0PnPAPdj8PejcSdkALqnpPbOYWrSlI/svi/ -- DID YOU KNOW you can showcase your professional knowledge on LinkedIn to receive job/consulting offers and enhance your professional reputation? Posting replies to questions on LinkedIn Answers puts you in front of the world's professional community. http://www.linkedin.com/e/abq/inv-24/ -- (c) 2010, LinkedIn Corporation ___ 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: NSWindow - how to resize it keeping aspect ratio?
On 25.02.2010, at 15:17, Ariel Feinerman wrote: there is of the matter is that -setAspectRatio: sets the window`s aspect ratio, but when window has been loaded from nib and not resized yet, its size is taken from content size that was written in IB with it own aspect. Then when window has been resized it instantly get size to conform aspect. Can you suggest something? In general I don't care about IB settings overriding, as my window initially has correct aspect ratio. The only my care was about its manual resizing at runtime. Don't know if this a correct solution or not, but I've written this code: - (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)frameSize { NSRect r; r = NSMakeRect([sender frame].origin.x, [sender frame].origin.y, frameSize.width, frameSize.height); r = [sender contentRectForFrameRect:r]; r.size.height = r.size.width * 422 / 674; r = [sender frameRectForContentRect:r]; return r.size; } And it works perfectly for me. 674 x 422 - is my original content view size, defined in IB. Unfortunately IB operates by window's content view size, whereas the message above operates by window's frame size, which is not the same. Therefore it's required to recalculate the size between window frame and content view sizes, if we have a care about content view aspect ratio keeping. 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSWindow - how to resize it keeping aspect ratio?
Alexander, And it works perfectly for me. 674 x 422 - is my original content view size, defined in IB. You calculate view`s aspect from it size, but I mean content frame (not window frame) from constant aspect, for example 4/3, then set size. Unfortunately IB operates by window's content view size, whereas the message above operates by window's frame size, which is not the same. Therefore it's required to recalculate the size between window frame and content view sizes, if we have a care about content view aspect ratio keeping. There is neither techinque for setting window`s frame itself, nor message for setting content view aspect. Thank you for your code, maybe it will be helpful ___ 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: NSWindow - how to resize it keeping aspect ratio?
--- On Thu, 2/25/10, Ariel Feinerman arielfap...@gmail.com wrote: ... There is neither techinque for setting window`s frame itself, nor message for setting content view aspect. Ariel, Does the method setContentAspectRatio for NSWindow not do what you need ? cheers vinai ___ 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: NSWindow - how to resize it keeping aspect ratio?
Vinai, maybe, I thought they are equivalent, thank you. 2010/2/25 vinai for_use...@yahoo.com --- On Thu, 2/25/10, Ariel Feinerman arielfap...@gmail.com wrote: ... There is neither techinque for setting window`s frame itself, nor message for setting content view aspect. Ariel, Does the method setContentAspectRatio for NSWindow not do what you need ? cheers vinai ___ 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: NSWindow - how to resize it keeping aspect ratio?
On Thursday, February 25, 2010 at 5:57 PM Ariel Feinerman wrote: You calculate view`s aspect from it size, but I mean content frame (not window frame) from constant aspect, for example 4/3, then set size. I don't understand what is the problem. Isn't my 422/674 ratio not a constant? What is a principal difference between it and yours 4/3? Just substitute my digits to whatever you need. You'll get just the same result. This constant, used in the message, will keep the aspect ratio. Now you can (if you wish to) set an initial width of the window (e.g. in the awakeFromNib), and window height will be adjusted respectively. You don't need to store both width and height in the preferences. Just save width. Height will be adjusted automatically. At least it works for me. 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSWindow - how to resize it keeping aspect ratio?
On Thu, February 25, 2010 7:37:17 AM Alexander Bokovikov openwo...@uralweb.ru wrote: I don't understand what is the problem. Isn't my 422/674 ratio not a constant? What is a principal difference between it and yours 4/3? Just substitute my digits to whatever you need. You'll get just the same result. Just use the defaults system to keep this value. In the preferences pane for your app you can create a place for Advanced settings where someone could go in and change the aspect ratio if they were so inclined. Soong ___ 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: NSColorPanel changeColor not called
Yes, I had done that before also to no avail. But thinking I might have been tired and erred I have done it again. Still does not work. I am including the code and a link to a debug picture that shows all is set correctly (as far as I can tell). Would someone be willing to run this code and post results? Might Apple comment or weigh in on this? - db The code: (in this example I moved cp to be an ivar thinking there was some scope issue) NSColorPanel* cp; - (IBAction)color:(id)sender { cp = [NSColorPanel sharedColorPanel]; [cp setDelegate:self]; [cp setTarget:self]; [cp setAction:@selector(changeColor:)]; [cp setContinuous:YES]; [NSApp runModalForWindow:cp]; [cp orderOut:cp]; } - (void)changeColor:(id)sender { NSLog(@changeColor); } - (void)windowWillClose:(NSNotification *)notification { [NSApp stopModalWithCode:0]; } A link to an annotated picture of the variables http://crusaderrabbit.net/NSColorPanel.jpg On Feb 25, 2010, at 12:30 AM, Graham Cox wrote: Ah, your reply prompted me to review the documentation, which I believe is in error. It's not the delegate that gets sent this message, it's the panel's target. use -setTarget: instead. -changeColor: is also sent to the responder chain regardless. The documentation lists -changeColor: under delegate methods but the panel only inherits the delegate methods of NSWindow, etc. --Graham On 25/02/2010, at 6:21 PM, David Blanton wrote: Well, no. I have run it modal from a modal panel non-modal from a modal panel non-modal from a non-modal panel changeColor is never called. I am stumped and going to pour a glass of wine and play a game of chess ! - db On Feb 24, 2010, at 11:53 PM, Graham Cox wrote: On 25/02/2010, at 5:44 PM, David Blanton wrote: Am I missing something obvious? Generally apps don't run the color panel modally. I believe there is a way to do it, I've seen it in some apps with an added OK/ Cancel button, though it seems rare and weird. It may be that running it this way works differently, or maybe what you're doing is just unsupported. ___ 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
IKImageBrowserView - Rename item?
Hello! How can I make a IKImageBrowserView to allow the user to rename an item, by clicking in the name section of the item, just like the Finder does it? Or maybe even through some context menu, but how do I open an Edit Session for the name of an item of the IKImageBrowserView? Thank you very much! -- Norbert M. Doerner ___ 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: setAction:@selector is not working ?
On Sun, Feb 21, 2010 at 4:14 PM, Graham Cox graham@bigpond.com wrote: Just a tip: look up NSStringFromSelector(); Right, thanks. I couldn't remember it off the top of my head. ___ 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: Looking for info on anti-piracy and trial-mode techniques for my app . . .
On Feb 25, 2010, at 7:14 AM, Brian Postow wrote: As a theorist I agree. You can't win that game. The hacker, if they re-write the OS can always get around whatever you put there, and usually there are easier ways than that. OTOH, it depends a lot on your customers (or your customer's customers). If they are programmers, then you either want to make it really really strong, or just give up and rely on good will to not cheat. If they are normal people then just making it difficult may be enough. Absolutely. In security parlance, you need to consider your threat model. The threat model includes the characterization of attackers' capabilities, from which you decide which attackers you will work to defend against and which attackers you will ignore. Toy example: the lock on your little sister's diary. The threat model includes you (at an appropriate big brother or sister age), your parents, and the local police. The lock is secure against you: you do not have the capability to pick the lock, and you are unwilling to damage it and face the wrath of your parents. The lock is an obstacle to your parents: they can't pick it either, but will not damage it without sufficient motivation. The lock is no obstacle to the police: they can simply pick it undetected. Bigger example: your SSH client. It's secure against casual eavesdroppers. It is less secure against a man-in-the-middle attack, but the attacker would need more power and more money to gain sufficient control over your network. It is likely insecure against a well-funded government motivated enough to spend money searching for bugs in the code. The question is not is the diary lock secure or is the SSH client secure. Instead you need to know is it secure enough compared to your needs and the costs of making it more secure. The diary lock is secure enough for your kid sister, but not secure enough for a bank's records. The SSH client is secure enough for you, but possibly not secure enough for the NSA. Back to DRM: the risk in the DRM threat model is not that you have lots of well-funded or well-motivated attackers, but rather that if a single well-funded or well-motivated attacker succeeds then the results will likely be distributed to the other poorly-funded and poorly-motivated attackers. By comparison, if the NSA breaks your SSH client they're unlikely disclose any details to the local eavesdropper who's scanning for credit card numbers. -- 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Looking for info on anti-piracy and trial-mode techniques for my app . . .
No, I didn't really mean that, but obviously the less they have to go on the harder it is for them to hack your code. Stripping the symbols out of your binaries is a good start (but then you get lousy stack traces...) I also use another, slightly more devious scheme alongside all the technical stuff. I let them (the hackers) think they've won. Then, a month later, the app stops working. But the hackers never see that because they don't wait that long before they move on. This means that the hacked copies of my app for sale at bargain prices on so-called 'oem' software sites (which are actually run, according to whois, by small-time russian criminals) don't actually work for long on the purchaser's machine. Which serves them right, it's obvious that these sites are just selling ripped-off copies. Is any of this worth doing? Well in my case (shareware) it makes me feel a lot more comfortable because otherwise you leave yourself wide open. My webserver logs show a number of pirate keys in use (but only for a month!), although whether any of those naughty people have a genuine interest in buying the software I don't know. The thing to consider is how much work do the hackers have to put in to break the copy protection. If it's more work to crack the software than it is worth to them financially, they will give up and go elsewhere. And anyway, it's a matter of principle. I don't like people stealing my stuff. Paul Sanders. - Original Message - From: Michael A. Crawford To: Cocoa-dev@lists.apple.com Cc: Paul Sanders Sent: Wednesday, February 24, 2010 10:57 PM Subject: Re: Looking for info on anti-piracy and trial-mode techniques for my app . . . Part of your response suggests that if there was an existing framework that was openly available, it wouldn't do me any good because the bad guys would have the source code. ___ 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
NSDeviceResolution
[window deviceDescription] is to return an NSDictionary of device description data NSDeviceResolution key is to return an NSString representing an NSSIze Calling NSSizeFromString on this returned string causes and exception -[NSConcreteValue getCString:maxLength:encoding:]: unrecognized selector sent to instance 0x130165e0 here is the code - (NSSize)deviceDPI { NSDictionary* dd = [m_window deviceDescription]; NSString* v = [dd valueForKey:NSDeviceResolution]; NSSize sz = NSSizeFromString(v); return sz; } v is @{72, 72} when print-object is called on it in the debugger I do not see anything wrong with the code ... do you? -db ___ 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: NSColorPanel changeColor not called [work around]
I replaced calling NSColorPanel from a button click by using an NSColorWell and setting an action on it. Looks more Mac like as you see the current color before getting the picker Still would like to know why changeColor isn't called, eh Apple? -db On Feb 25, 2010, at 9:30 AM, David Blanton wrote: Yes, I had done that before also to no avail. But thinking I might have been tired and erred I have done it again. Still does not work. I am including the code and a link to a debug picture that shows all is set correctly (as far as I can tell). Would someone be willing to run this code and post results? Might Apple comment or weigh in on this? - db The code: (in this example I moved cp to be an ivar thinking there was some scope issue) NSColorPanel* cp; - (IBAction)color:(id)sender { cp = [NSColorPanel sharedColorPanel]; [cp setDelegate:self]; [cp setTarget:self]; [cp setAction:@selector(changeColor:)]; [cp setContinuous:YES]; [NSApp runModalForWindow:cp]; [cp orderOut:cp]; } - (void)changeColor:(id)sender { NSLog(@changeColor); } - (void)windowWillClose:(NSNotification *)notification { [NSApp stopModalWithCode:0]; } A link to an annotated picture of the variables http://crusaderrabbit.net/NSColorPanel.jpg On Feb 25, 2010, at 12:30 AM, Graham Cox wrote: Ah, your reply prompted me to review the documentation, which I believe is in error. It's not the delegate that gets sent this message, it's the panel's target. use -setTarget: instead. -changeColor: is also sent to the responder chain regardless. The documentation lists -changeColor: under delegate methods but the panel only inherits the delegate methods of NSWindow, etc. --Graham On 25/02/2010, at 6:21 PM, David Blanton wrote: Well, no. I have run it modal from a modal panel non-modal from a modal panel non-modal from a non-modal panel changeColor is never called. I am stumped and going to pour a glass of wine and play a game of chess ! - db On Feb 24, 2010, at 11:53 PM, Graham Cox wrote: On 25/02/2010, at 5:44 PM, David Blanton wrote: Am I missing something obvious? Generally apps don't run the color panel modally. I believe there is a way to do it, I've seen it in some apps with an added OK/ Cancel button, though it seems rare and weird. It may be that running it this way works differently, or maybe what you're doing is just unsupported. ___ 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/airedale%40tularosa.net This email sent to aired...@tularosa.net ___ 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: NSDeviceResolution
On Thu, Feb 25, 2010 at 1:40 PM, David Blanton aired...@tularosa.net wrote: NSDeviceResolution key is to return an NSString representing an NSSIze No it's not. The documentation clearly states it's an NSValue: http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html#//apple_ref/doc/c_ref/NSDeviceResolution --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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSDeviceResolution
On Feb 25, 2010, at 1:40 PM, David Blanton wrote: [window deviceDescription] is to return an NSDictionary of device description data NSDeviceResolution key is to return an NSString representing an NSSIze Calling NSSizeFromString on this returned string causes and exception -[NSConcreteValue getCString:maxLength:encoding:]: unrecognized selector sent to instance 0x130165e0 NSDeviceResolution does not give you an NSString. It gives you an NSValue respresenting an NSSize. Try this: NSValue* v = [dd valueForKey:NSDeviceResolution]; NSSize sz = [v sizeValue]; (The error message gives you a hint: NSConcreteValue is one of the implementations of NSValue.) -- 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSDeviceResolution
I did the below ... duh, all good now! On Feb 25, 2010, at 2:50 PM, Greg Parker wrote: NSValue* v = [dd valueForKey:NSDeviceResolution]; NSSize sz = [v sizeValue]; ___ 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
Store more complex values into NSDictionary
Hi, i need help with solution about store more complex values into NSDictionary. I have following data which i need store in NSDictionary: value1:@A1 value2:@B1 key:1 value1:@A2 value2:@B2 key:2 value1:@A3 value2:@B3 key:3 etc. What is the ideal solution for this my case ? thnx Donald ___ 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: Store more complex values into NSDictionary
On Feb 25, 2010, at 2:51 PM, Daniel Káčer wrote: Hi, i need help with solution about store more complex values into NSDictionary. I have following data which i need store in NSDictionary: value1:@A1 value2:@B1 key:1 value1:@A2 value2:@B2 key:2 value1:@A3 value2:@B3 key:3 etc. What is the ideal solution for this my case ? Create a class to represent your complex values and store instances of that class in the dictionary. -- Dave Carrigan d...@rudedog.org Seattle, WA, USA ___ 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: Store more complex values into NSDictionary
On Feb 25, 2010, at 2:59 PM, Dave Carrigan wrote: On Feb 25, 2010, at 2:51 PM, Daniel Káčer wrote: i need help with solution about store more complex values into NSDictionary. I have following data which i need store in NSDictionary: value1:@A1 value2:@B1 key:1 value1:@A2 value2:@B2 key:2 value1:@A3 value2:@B3 key:3 etc. What is the ideal solution for this my case ? Create a class to represent your complex values and store instances of that class in the dictionary. Another option: put the values in some container (array or set or dictionary), and set the container as the dictionary's value. This is how plists and user defaults work. It does get messy fast, though, in which case you want the more rigid structure of a real class. -- 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Store more complex values into NSDictionary
On Feb 25, 2010, at 2:59 PM, Dave Carrigan wrote: On Feb 25, 2010, at 2:51 PM, Daniel Káčer wrote: i need help with solution about store more complex values into NSDictionary. I have following data which i need store in NSDictionary: value1:@A1 value2:@B1 key:1 value1:@A2 value2:@B2 key:2 value1:@A3 value2:@B3 key:3 etc. What is the ideal solution for this my case ? Create a class to represent your complex values and store instances of that class in the dictionary. Or, depending upon what you're trying to accomplish, you could also create a dictionary whose keys refer to other dictionaries. NSMutableDictionary* dictionary = [NSMutableDictionary dictionary]; NSDictionary* dictionary1 = [NSDictionary dictionaryWithObjectsAndKeys: @A1, @value1, @B1, @value2, nil]; [dictionary setObject:dictionary1 forKey:@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
Re: Store more complex values into NSDictionary
Ok, this good idea .. but which container contains 2 values ? ... Array is one dimensional container, set also one dimensional and dictionary is key based container .. so value with key .. there i know only about solution NSDictionary with my custom class [NSDictionary addObject:myClass forKey:[NSNumber numberWithInteger:1]] or NSDictionary in combination with some struct. [NSDictionary addObject:myStruct forKey:[NSNumber numberWithInteger:1]] but I would like to know whether exist any more elegant solution ... Donald On Feb 26, 2010, at 0:12 , Greg Parker wrote: On Feb 25, 2010, at 2:59 PM, Dave Carrigan wrote: On Feb 25, 2010, at 2:51 PM, Daniel Káčer wrote: i need help with solution about store more complex values into NSDictionary. I have following data which i need store in NSDictionary: value1:@A1 value2:@B1 key:1 value1:@A2 value2:@B2 key:2 value1:@A3 value2:@B3 key:3 etc. What is the ideal solution for this my case ? Create a class to represent your complex values and store instances of that class in the dictionary. Another option: put the values in some container (array or set or dictionary), and set the container as the dictionary's value. This is how plists and user defaults work. It does get messy fast, though, in which case you want the more rigid structure of a real class. -- 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Store more complex values into NSDictionary
On Feb 25, 2010, at 3:28 PM, Daniel Káčer wrote: but I would like to know whether exist any more elegant solution ... You could consider Core Data, but whether that is the right choice is very dependent on the real problem you're trying to solve. -- Dave Carrigan d...@rudedog.org Seattle, WA, USA ___ 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
Carbon is C++?
is Apple's Carbon basically code written in C++, while Cocoa is written in Objective-C? should developers avoid using frameworks written in C++ (like some sound frameworks)? ___ 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: Store more complex values into NSDictionary
thus more to i think over, I start giving you the truth .. that this solution is basically what I need .. :) NSDictionary *values = [NSDictionary dictionaryWithObjectsAndKeys:@A1, @subKey1, @B1, subKey2, nil]; NSDictionary *keyedValues = [NSDictionary dictionaryWithObjectsAndKeys:values, @1, nil]; On Feb 26, 2010, at 0:33 , Greg Parker wrote: On Feb 25, 2010, at 3:25 PM, Daniel Káčer wrote: Ok, this good idea .. but which container contains 2 values ? ... Array is one dimensional container, set also one dimensional and dictionary is key based container .. so value with key .. there i know only about solution NSDictionary with my custom class You store multiple values in an array, then store that array in a dictionary. Basically, you're using an array object instead of an object of a custom class. Something like this: NSArray *array = [NSArray arrayWithObjects:@MyValue1, @MyValue2, nil]; [myDict addObject:array forKey:@MyKey]; You'd fetch individual values like this: NSString *value1 = [[myDict objectForKey:@MyKey] objectAtIndex:0]; NSString *value2 = [[myDict objectForKey:@MyKey] objectAtIndex:1]; // value1 is @MyValue1, value2 is @MyValue2. -- 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Carbon is C++?
On Feb 25, 2010, at 3:40 PM, Chunk 1978 wrote: is Apple's Carbon basically code written in C++, while Cocoa is written in Objective-C? should developers avoid using frameworks written in C++ (like some sound frameworks)? Why? Objective-C and C++ mix just fine as long as you follow a few basic rules. Apple's documentation can tell you specifically what rules to follow. -- Dave Carrigan d...@rudedog.org Seattle, WA, USA ___ 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: Carbon is C++?
i've been reading about how apple dropped their plans for Carbon 64 a while back, so if carbon is C++ then i'm surprised that apple is still supporting it at all? On Thu, Feb 25, 2010 at 6:42 PM, Dave Carrigan d...@rudedog.org wrote: On Feb 25, 2010, at 3:40 PM, Chunk 1978 wrote: is Apple's Carbon basically code written in C++, while Cocoa is written in Objective-C? should developers avoid using frameworks written in C++ (like some sound frameworks)? Why? Objective-C and C++ mix just fine as long as you follow a few basic rules. Apple's documentation can tell you specifically what rules to follow. -- Dave Carrigan d...@rudedog.org Seattle, WA, USA ___ 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: Carbon is C++?
http://developer.apple.com/carbon/ http://en.wikipedia.org/wiki/Carbon_%28API%29 On Thu, Feb 25, 2010 at 15:40, Chunk 1978 chunk1...@gmail.com wrote: is Apple's Carbon basically code written in C++, while Cocoa is written in Objective-C? should developers avoid using frameworks written in C++ (like some sound frameworks)? ___ 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/hsiegel%40gmail.com This email sent to hsie...@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
Re: Carbon is C++?
On 26/02/2010, at 10:40 AM, Chunk 1978 wrote: is Apple's Carbon basically code written in C++, while Cocoa is written in Objective-C? Some parts of Carbon is C++ internally, some is C, but the APIs are C. should developers avoid using frameworks written in C++ (like some sound frameworks)? No, C++ is supported and works fine. It's slightly more efficient than Obj-C so for time critical code like audio it's probably a better bet. --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
Re: Carbon is C++?
On Thu, Feb 25, 2010 at 6:42 PM, Dave Carrigan d...@rudedog.org wrote: On Feb 25, 2010, at 3:40 PM, Chunk 1978 wrote: is Apple's Carbon basically code written in C++, while Cocoa is written in Objective-C? should developers avoid using frameworks written in C++ (like some sound frameworks)? Why? Objective-C and C++ mix just fine as long as you follow a few basic rules. Apple's documentation can tell you specifically what rules to follow. ... and what APIs are deprecated. sherm-- -- Cocoa programming in Perl: http://www.camelbones.org ___ 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: Carbon is C++?
On Feb 25, 2010, at 4:45 PM, Chunk 1978 wrote: i've been reading about how apple dropped their plans for Carbon 64 a while back, We just had a thread about this, but basically, Carbon is not dead; only parts of it were taken out of the 64-bit frameworks. so if carbon is C++ then i'm surprised that apple is still supporting it at all? First, Carbon might be internally implemented as C++, I don't know, but all of its exterior interfaces are in procedural C. Second, C++ is a fine language, and is not going to be deprecated any time soon, since a lot of stuff in the OS is written in C++ or ObjC++, such as the Security and WebKit frameworks. The only problem with C++ is the ABI keeps getting broken between compilers, so you might not be able to target really old versions of the OS with newer compilers. Nick Zitzmann http://www.chronosnet.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
Re: Carbon is C++?
On Thu, Feb 25, 2010 at 5:45 PM, Chunk 1978 chunk1...@gmail.com wrote: i've been reading about how apple dropped their plans for Carbon 64 a while back, so if carbon is C++ then i'm surprised that apple is still supporting it at all? You're confusing a library/framework with the language that library is written in. Cocoa, Carbon, AppKit, Foundation, CoreServices, CoreFoundation, CoreGraphics, IOKit, etc... these are libraries/frameworks. Objective-C, Objective-C++, C, C++... these are languages. Some of the libraries I listed are pure C or C++, some Objective-C, and most are a mixture of all the languages. Apple has deprecated libraries/frameworks. They haven't stopped supporting any languages though. It's 100% safe to keep writing apps that use C++ if you are also using Cocoa. A large part of OS X itself is C++ (see: IOKit and Directory Services). ___ 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: Carbon is C++?
On Thu, Feb 25, 2010 at 7:02 PM, Stephen J. Butler stephen.but...@gmail.com wrote: Apple has deprecated libraries/frameworks. They haven't stopped supporting any languages though. I'm pretty sure they no longer support Pascal. ;-) sherm-- -- Cocoa programming in Perl: http://www.camelbones.org ___ 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: Carbon is C++?
On Feb 25, 2010, at 4:02 PM, Stephen J. Butler wrote: Apple has deprecated libraries/frameworks. They haven't stopped supporting any languages though. Pretty sure we don't provide any Pascal or HyperCard tools anymore. I forget whether we shipped gfortran at any point in Mac OS X. In any case, the llvm/clang team is hard at work on a new C++ compiler. Feel free to draw your own conclusions about Apple's future support for C++. http://blog.llvm.org/2009/12/clang-builds-llvm.html http://blog.llvm.org/2010/02/clang-successfully-self-hosts.html -- 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Store more complex values into NSDictionary
I've run into the need for something like this often enough that I just end up writing a simple container class that mimic's C++'s pair class. Something like this: #import Cocoa/Cocoa.h @interface My_Pair : NSObject { id first; id second; } + (My_Pair *)pairWith:(id)_first and:(id)_second; - (id)initWith:(id)_first and:(id)_second; - (id)first; - (id)second; @end Andrew On Feb 25, 2010, at 2:51 PM, Daniel Káčer wrote: Hi, i need help with solution about store more complex values into NSDictionary. I have following data which i need store in NSDictionary: value1:@A1 value2:@B1 key:1 value1:@A2 value2:@B2 key:2 value1:@A3 value2:@B3 key:3 etc. What is the ideal solution for this my case ? thnx Donald ___ 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/asalamon%40mplab.ucsd.edu This email sent to asala...@mplab.ucsd.edu ___ 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
[iPhone 3.1] Core Animation that leaves a trial?
Hello, all ... I'm interested in having a CAKeyframeAnimation leave a trail i.e. imagine the image of a pencil being animated across the screen -- I want to draw a path of where the pencil has been along with the animated pencil. However, i'm not sure how to do this, since Core Animation is doing the drawing for me. If anyone can offer some pointers, i'd be quite appreciative :-) Regards, John ___ 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: Carbon is C++?
On Feb 25, 2010, at 4:08 PM, Greg Parker wrote: Feel free to draw your own conclusions about Apple's future support for C++. What Greg said. Note that a lot of major big-ticket Mac apps contain large amounts of C++ code — Photoshop, MS Office, etc. Most cross-platform apps are C++ at their core, even if they have a Cocoa UI layer. That includes even some Apple apps like Safari and iTunes. —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
Re: [iPhone 3.1] Core Animation that leaves a trial?
On Feb 25, 2010, at 4:55 PM, John Michael Zorko wrote: I'm interested in having a CAKeyframeAnimation leave a trail i.e. imagine the image of a pencil being animated across the screen -- I want to draw a path of where the pencil has been along with the animated pencil. However, i'm not sure how to do this, since Core Animation is doing the drawing for me. If anyone can offer some pointers, i'd be quite appreciative :-) There isn't a simple way to do this on iPhone OS – the class that would make it simpler (CAEmitterLayer) is not available. There are various approaches that all involve doing the work yourself, which means breaking the path apart into its components (CGPathApply) and doing the interpolation yourself. -- David Duncan Apple DTS Animation and Printing ___ 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 stupidity?
What exactly does @dynamic do? Specifically, in the context of a Core Data managed-object? Here's what I do understand: 1) You create an 'entity' in the .xcdatamodel file 2) You ask Xcode to create the class files for you 3) The .m file contains @dynamic instead of @synthesize for each of the entity's 'attributes' (which now correspond to instance variables in a class derived from NSManagedObject) Here's what I don't understand: Why doesn't it just @synthesize the accessors? What would happen if I replaced the @dynamic with @synthesize? Would it blow up, or just have weird performance issues? ___ 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: @dynamic stupidity?
On Feb 25, 2010, at 7:10 PM, William Squires wrote: Why doesn't it just @synthesize the accessors? What would happen if I replaced the @dynamic with @synthesize? Would it blow up, or just have weird performance issues? @dynamic and @synthesize are completely different. @synthesize causes the compiler to implement a getter/setter that directly changes the class' ivar (or fakes it in the 64-bit runtime). @dynamic tells the compiler that there at runtime, there will be an implementation of the getter/setter for the property in question, so that the compiler doesn't give a warning about missing methods. Replacing one with the other would cause your program to fail. You need to read http://www.devworld.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocProperties.html -- Dave Carrigan d...@rudedog.org Seattle, WA, USA ___ 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: @dynamic stupidity?
On Feb 25, 2010, at 7:10 PM, William Squires wrote: What exactly does @dynamic do? Specifically, in the context of a Core Data managed-object? Here's what I do understand: 1) You create an 'entity' in the .xcdatamodel file 2) You ask Xcode to create the class files for you 3) The .m file contains @dynamic instead of @synthesize for each of the entity's 'attributes' (which now correspond to instance variables in a class derived from NSManagedObject) Here's what I don't understand: Why doesn't it just @synthesize the accessors? What would happen if I replaced the @dynamic with @synthesize? Would it blow up, or just have weird performance issues? The accessors needed by Core Data and NSManagedObject are complicated, requiring things like change notifications. You can write your own accessor methods by hand, including the necessary complications. Or you can let Core Data add the methods at runtime for you. @dynamic tells the compiler that you have declared properties, but the method implementations for those properties will be provided by someone else. In the NSManagedObject case, someone else is equal to Core Data at runtime. @synthesize tells the compiler to emit method implementations for your properties. @synthesize does not work with NSManagedObject because the implementations it generates don't include the extra features needed by Core Data. The Core Data documentation includes more details about NSManagedObject accessors, with examples of @dynamic and hand-written implementations: http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/CoreData/Articles/cdAccessorMethods.html -- Greg Parkergpar...@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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: [iPhone 3.1] Core Animation that leaves a trial?
I don't know enough about the specifics, but could an image with a moving mask reveal the trail? Eric On Thu, Feb 25, 2010 at 8:32 PM, David Duncan david.dun...@apple.comwrote: On Feb 25, 2010, at 4:55 PM, John Michael Zorko wrote: I'm interested in having a CAKeyframeAnimation leave a trail i.e. imagine the image of a pencil being animated across the screen -- I want to draw a path of where the pencil has been along with the animated pencil. However, i'm not sure how to do this, since Core Animation is doing the drawing for me. If anyone can offer some pointers, i'd be quite appreciative :-) There isn't a simple way to do this on iPhone OS – the class that would make it simpler (CAEmitterLayer) is not available. There are various approaches that all involve doing the work yourself, which means breaking the path apart into its components (CGPathApply) and doing the interpolation yourself. -- David Duncan Apple DTS Animation and Printing ___ 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 -- http://ericd.net Interactive design and development ___ 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
Embedding Custom NSView in NSScroller having strange effect on drawRect calls.
Hi all, I've written a custom view and done some optimisation of the drawing calls so only the exact areas that need redrawing are passed to the 'setNeedsDisplayInRect' function. All was working well, until I embedded my view into an NSScroller. Since then my custom view seems to be being invalidated by grid sections. I've included a link to some pics to try and better show. http://www.flickr.com/photos/47616...@n08/sets/72157623505127258/ I added the green borders around the dirtyRect area to better show the problem. Thanks, Billy. ___ 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
Setting parent window
Is there any corresponding function call for ::SetParent(in Windows) in Cocoa? Basically I have a parent application from which I have to launch another application. I want the child application to open as modal within the parent application and not as a separate application. I have the window handles of both applications. I tried using [NSWindow setParentWindow] but this was not working for me. Is there any possible solution? -- Gaurav Srivastava ___ 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
[Moderator] List Guidelines
New Posters === A reminder that people who post for the first time are moderated. Messages should be approved or rejected within 24 hours. Once it’s clear that the posts are on topic and not violating the rules, the moderation is cleared. If your messages are automatically rejected the odds are that you’re posting from an email address that you are not subscribed with. iPhone SDK == Developers should be aware that any iPhone SDK greater than 3.1 is under non-disclosure (section 5.3 of the iPhone Development Agreement). It can't be discussed here. This includes other mailing lists, forums, services like Twitter, and blogs. Violating the NDA will result in WWDR being notified of the breach. Further action is at their (and legal's) discretion. The Apple Developer Forums at http://devforums.apple.com are available for discussion of NDA software under certain situations. Please consult the forums for more information. iPad We’re all excited about the iPad but discussion about it here isn’t appropriate. Copy Protection === The discussion of copy protection is not appropriate for this list. Instead try the Mac Small Business list noted below. Discussing Private API == The discussion of Private API is also not appropriate for this list. Using private API is strongly discouraged as it can (and often does) change in future software revisions. If you feel some private API should be made public contact WWDR directly or file a bug using bugreporter.apple.com. Please do not advocate for those changes here, it isn't effective. Please stay on-topic There are currently more than 8000 subscribers to this list and several hundred messages posted per day. In order to keep the list useful please stay on topic and stick to technical discussion. Cocoa-dev should not be the first place you turn when you encounter a problem. First you should: - Search the documentation in Xcode - Remember to select the appropriate doc set and, if applicable, turn on full text searching - Search the list archives at apple.com or cocoabuilder.com - Many questions have been asked repeatedly and good answers have already been provided. Check the archives _every time_. - Search Google - There are many Cocoa developers who blog about their experiences. This is a very useful resource. - Ensure that this is actually Cocoa related. - Basic C questions are not appropriate for this list. If someone posts a message that is off-topic, please do not reply to the list. You should contact the sender directly or alert a moderator. If a moderator flags a thread (typically with [Moderator] in the subject line), do not continue to post to that thread. Do feel free to contact the list admins at cocoa-dev-adm...@lists.apple.com with any issues. If you post a message that is blatantly off-topic, you are liable to be moderated. While Apple engineers often subscribe to the list and answer questions, they do so on a volunteer basis. This is not an official support channel, and you should not expect an Apple engineer to provide the answer. Instead contact d...@apple.com for technical issues. To file bugs use bugreporter at http://bugreporter.apple.com Other mailing lists === Other Apple mailing lists that may be relevant are listed at: http://lists.apple.com/mailman/listinfo in particular see: Xcode-users: http://lists.apple.com/mailman/listinfo/xcode-users The Omni Group hosts a general Mac OS X developer list: http://www.omnigroup.com/mailman/listinfo/macosx-dev There is a Yahoo Group for discussion of business-related issues at: http://groups.yahoo.com/group/macsb/ List etiquette == When you post a message, bear in mind that you are asking several thousand people to listen to what you're saying. Please ensure that you abide by the list rules: http://lists.apple.com/tc.html http://lists.apple.com/tips.html In particular: please Edit included messages in replies to minimize the amount of text. There is no need, for example, to include the list footer in your reply. Before posting a question, please check the list archives (see Online resources below) and try searching Google. Many questions have been asked before and have already been answered. When you ask a question, whenever possible please: 1. Describe what your high-level goal is 2. Include any relevant code 3. If appropriate, include URLs to screenshots For more details, see: http://www.mikeash.com/getting_answers.html If you post a message to the list and do not get a reply, you should not simply repost the message. There may be reasons why no-one has answered, see the references above. If you want to send again, add more information or background, or explain what further steps you have taken in the interim to solve your
[end of thread] Re: Looking for info on anti-piracy and trial-mode techniques for my app . . .
On Feb 24, 2010, at 4:54 PM, Michael A. Crawford wrote: I've purchased apps from other developers on this forum, which have mechanisms for limiting functionality until a valid registration code has been provided. I'd like to include this functionality in my own app but don't want to create it from scratch if I don't have to. To that end, I'm looking for existing libraries, techniques, blogs, and/or suggestions. The discussion of copy protection isn’t appropriate for the list. I wish I had caught this earlier. Instead try the Mac Small Business list http://groups.yahoo.com/group/macsb/ . ___ 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
Improving the User Experience when Installing a Snow Leopard Service
Folks; I'm a big fan of Snow Leopard's revised support for Services. In fact my application has a service that I would like most of my customers to use. What I have found from watching test subjects install my software is that many folks stumble on enabling the service. I understand that user needs to be in charge but ... What I'm looking for here is if anyone on this list has encountered these issues and has developed improved experiences for the user. My initialization process 1) creates the user 'Services' directory if required 2) installs the XYZ.service file into this 'Services' directory 3) calls NSUpdateDynamicServices() so the user's view is updated 4) calls NSWorkspace with an 'openFile' to get the Keyboard pane open @/System/Library/PreferencePanes/Keyboard.prefPane At this point all the user has to do is check the checkbox for the XYZ Service (it's a Text service) The issues that I've observed are: The prefpane does not initially necessarily open to the 'shortcuts' tabView The 'Services' item is not selected in the source list The 'Text' section is far down out of view and the order of the section is not alphabetic so the user is confused where to find this section. Is there a Cocoa way to remedy any of these that does not involve SystemEvents? mainly 'cause using 'System Events' cascades a whole new 'get the user to check the checkbox' activity….. All in all getting the user to simply check this checkbox makes for a really bumpy out-of-box experience for my new customers…. Any and all thoughts on this appreciated Steve___ 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: Setting parent window
On Feb 25, 2010, at 4:38 PM, Gaurav Srivastava wrote: Basically I have a parent application from which I have to launch another application. I want the child application to open as modal within the parent application and not as a separate application. Mac OS X does not support window child/parent relationships across processes, so I think this approach isn't going to work for you. -eric ___ 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
Improving the User Experience for First Use of Downloadable Software
Folks; My Mac-based Cocoa application is now available as a free trial download from the internet. The first time a user opens the software a warning is shown informing the user that this software has never been used and was downloaded from the internet -- thanks redmond =[:-( I understand the necessity of this but the warning triggers a context change to the Finder which buries the newly opened software under an array of open Finder windows. I've now seen many users think that the new software doesn't start and become discouraged and dismissive of the software. Are there any tools or best practices which have been developed to deal with this immediate push into the background effect? Thanks for any thoughts! Steve ___ 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: Improving the User Experience for First Use of Downloadable Software
On Feb 25, 2010, at 21:40, Steve Cronin wrote: Folks; My Mac-based Cocoa application is now available as a free trial download from the internet. The first time a user opens the software a warning is shown informing the user that this software has never been used and was downloaded from the internet -- thanks redmond =[:-( I understand the necessity of this but the warning triggers a context change to the Finder which buries the newly opened software under an array of open Finder windows. I've now seen many users think that the new software doesn't start and become discouraged and dismissive of the software. Are there any tools or best practices which have been developed to deal with this immediate push into the background effect? Yep, I have seen it and it's very annoying. I would love to know what can be do to minimize the bad side effect. -Laurent. -- Laurent Daudelin AIM/iChat/Skype:LaurentDaudelin http://nemesys.dyndns.org Logiciels Nemesys Software laurent.daude...@gmail.com Photo Gallery Store: http://laurentdaudelin.shutterbugstorefront.com/g/galleries___ 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: Improving the User Experience for First Use of Downloadable Sof tware
What you are experancing is the setting of the q Quarintene xattr value. This cannot be avoided, as how can the OS know that your application has no macious intent. The best recomendation I can offer is provide a pkg installer instead as it Steve Cronin wrote: Folks; My Mac-based Cocoa application is now available as a free trial download from the internet. The first time a user opens the software a warning is shown informing the user that this software has never been used and was downloaded from the internet -- thanks redmond =[:-( I understand the necessity of this but the warning triggers a context change to the Finder which buries the newly opened software under an array of open Finder windows. I've now seen many users think that the new software doesn't start and become discouraged and dismissive of the software. Are there any tools or best practices which have been developed to deal with this immediate push into the background effect? Thanks for any thoughts! Steve ___ 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/almightylinuxgod%40me.com This email sent to almightylinux...@me.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
Re: Embedding Custom NSView in NSScroller having strange effect on drawRect calls.
On Thu, Feb 25, 2010 at 3:00 AM, Billy Flatman b.flat...@googlemail.com wrote: Hi all, I've written a custom view and done some optimisation of the drawing calls so only the exact areas that need redrawing are passed to the 'setNeedsDisplayInRect' function. All was working well, until I embedded my view into an NSScroller. Since then my custom view seems to be being invalidated by grid sections. I've included a link to some pics to try and better show. http://www.flickr.com/photos/47616...@n08/sets/72157623505127258/ I added the green borders around the dirtyRect area to better show the problem. Is your view layer-backed, either directly or by being a subview of one which is explicitly layer-backed? If so, then it will automatically become backed by a CATiledLayer once it's embedded in a scroll view, which would cause exactly the sort of thing you're seeing. Mike ___ 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: Improving the User Experience for First Use of Downloadable Software
On Feb 25, 2010, at 11:40 PM, Steve Cronin wrote: Folks; My Mac-based Cocoa application is now available as a free trial download from the internet. The first time a user opens the software a warning is shown informing the user that this software has never been used and was downloaded from the internet -- thanks redmond =[:-( I understand the necessity of this but the warning triggers a context change to the Finder which buries the newly opened software under an array of open Finder windows. Sounds to me like the best thing to do would be to file a bug report requesting Apple to fix this so that new applications come to the front after you dismiss the warning, since this seems like it’s pretty clearly a bug. I suppose for the time being, you could use -[NSApplication activateIgnoringOtherApps:] in your application delegate’s applicationDidFinishLaunching: method as a workaround. 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com