Re: QuickTime Player - like application

2011-05-29 Thread Nick
Jodischlange, it's a messenger application, that has as its feature a possibility to play video files to other users. I was thinking to make the part that actually does playing the video (it's interface) similar to the QuickTime player (since most users are using this player, and therefore

Re: How to implement while there are objects in the array - run runloop idea?

2011-05-29 Thread Nick
Thanks for the ideas! ___ 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:

Re: UIColor vs. NSColor methods

2011-05-29 Thread Kyle Sluder
On Sat, May 28, 2011 at 10:50 PM, Roland King r...@rols.org wrote: You can use CGColorGetComponents on a CGColorRef to get the values of whatever colorspace the CGColorRef is in and you can create new CGColorRefs with those values. I don't see a way to convert from one colorspace to another

How can logging a pointer value cause EXC_BAD_ACCESS?

2011-05-29 Thread Jerry Krinock
I'm really losing it; or maybe I never understood to begin with. How can this code crash? - (void)dealloc { NSLog(@0988 %p %s, self, __PRETTY_FUNCTION__) ; NSLog(@1250 ) ; CRASH- int myPointer = (int)m_managedObjectContext ; NSLog(@1335 myPointer =

Re: How can logging a pointer value cause EXC_BAD_ACCESS?

2011-05-29 Thread Stephen J. Butler
On Sun, May 29, 2011 at 1:30 PM, Jerry Krinock je...@ieee.org wrote: I'm really losing it; or maybe I never understood to begin with.  How can this code crash?      - (void)dealloc      {          NSLog(@0988 %p %s, self, __PRETTY_FUNCTION__) ;          NSLog(@1250 ) ; CRASH-   int

Re: [super dealloc] when init fails. Was: Logging pointer EXC_BAD_ACCESS?

2011-05-29 Thread Jerry Krinock
On 2011 May 29, at 11:38, Stephen J. Butler wrote: On Sun, May 29, 2011 at 1:30 PM, Jerry Krinock je...@ieee.org wrote: I'm really losing it; or maybe I never understood to begin with. How can this code crash? - (void)dealloc { NSLog(@0988 %p %s, self,

Re: [super dealloc] when init fails. Was: Logging pointer EXC_BAD_ACCESS?

2011-05-29 Thread Quincey Morris
On May 29, 2011, at 12:20, Jerry Krinock wrote: Ah, I get it now. It's the access to the pointer m_managedObjectContext itself that's the problem. So, let's look at the subclass init method which invokes -dealloc: - (id)initWithDocUuid:(NSString*)docUuid { NSManagedObjectContext*

Re: [super dealloc] when init fails. Was: Logging pointer EXC_BAD_ACCESS?

2011-05-29 Thread Ken Thomases
On May 29, 2011, at 2:20 PM, Jerry Krinock wrote: So, let's look at the subclass init method which invokes -dealloc: - (id)initWithDocUuid:(NSString*)docUuid { NSManagedObjectContext* moc ; moc = [[BkmxBasis sharedBasis] exidsMocForIdentifier:docUuid] ; self = [super

Re: [super dealloc] when init fails. Was: Logging pointer EXC_BAD_ACCESS?

2011-05-29 Thread Ken Thomases
On May 29, 2011, at 2:43 PM, Quincey Morris wrote: The difference in the second case is that the compiler translates it (AFAIK) into a call to objc_msgSendSuper instead of objc_msgSend. What I'm winding up to here is that the failure in messaging a nil 'super' looks to me like a bug in the

Re: [super dealloc] when init fails. Was: Logging pointer EXC_BAD_ACCESS?

2011-05-29 Thread Quincey Morris
On May 29, 2011, at 12:20, Jerry Krinock wrote: - (id)initWithDocUuid:(NSString*)docUuid { NSManagedObjectContext* moc ; moc = [[BkmxBasis sharedBasis] exidsMocForIdentifier:docUuid] ; self = [super initWithManagedObjectContext:moc

Why does NSArray count return NSUInteger?

2011-05-29 Thread julius
Hi, I have just spent time investigating why an if statement involving an [array count] was apparently misbehaving. The construct was this: if(3 ([zAry count] - 10)) It delivers a (to me unexpected) result when [zAry count] 10. In fact if(3 = ([zAry count] - 10)) also returns

Re: Why does NSArray count return NSUInteger?

2011-05-29 Thread mlist0...@gmail.com
Maybe array indexes and counts are unsigned because you can't have a negative number of objects in an array? _murat On May 29, 2011, at 1:04 PM, julius wrote: Hi, I have just spent time investigating why an if statement involving an [array count] was apparently misbehaving. The

Re: Why does NSArray count return NSUInteger?

2011-05-29 Thread Siegfried
On 29/05/2011, at 17:04, julius wrote: … The reason is that [zAry count] returns a result of type NSUInteger Exactly. … Why might the Cocoa developers have chosen to do this? … Not exactly Cocoa developers. In C, considering uint an unsigned int variable set to -1, a statement like

Re: Why does NSArray count return NSUInteger?

2011-05-29 Thread Kyle Sluder
On Sun, May 29, 2011 at 1:04 PM, julius jul...@juliuspaintings.co.uk wrote: Hi, I have just spent time investigating why an if statement involving an [array count] was apparently misbehaving. The construct was this:        if(3 ([zAry count] - 10)) It delivers a (to me unexpected) result

Re: [super dealloc] when init fails. Was: Logging pointer EXC_BAD_ACCESS?

2011-05-29 Thread Quincey Morris
On May 29, 2011, at 12:57, Ken Thomases wrote: But it's important to recognize that there are good arguments on both sides and the design decision involved a tradeoff. In any case, it doesn't seem to me that that design decision necessarily implies that calling super with a nil self

Re: Why does NSArray count return NSUInteger?

2011-05-29 Thread Siegfried
On 29/05/2011, at 17:13, Siegfried wrote: When one of the literals is unsigned, the other is implicitly converted, and -1 is the highest int possible. I'm sorry, I mean operands instead of literals___ Cocoa-dev mailing list

Re: Why does NSArray count return NSUInteger?

2011-05-29 Thread Jeffrey Walton
On Sun, May 29, 2011 at 4:04 PM, julius jul...@juliuspaintings.co.uk wrote: Hi, I have just spent time investigating why an if statement involving an [array count] was apparently misbehaving. The construct was this:        if(3 ([zAry count] - 10)) It delivers a (to me unexpected) result

Re: UIColor vs. NSColor methods

2011-05-29 Thread Graham Cox
On 29/05/2011, at 3:50 PM, Roland King wrote: You can use CGColorGetComponents on a CGColorRef to get the values of whatever colorspace the CGColorRef is in and you can create new CGColorRefs with those values. I don't see a way to convert from one colorspace to another however a quick

Re: [super dealloc] when init fails. Was: Logging pointer EXC_BAD_ACCESS?

2011-05-29 Thread Jerry Krinock
Thanks, all. Quincey, the three Error Points you defined are great. Fortunately, in this case I have the easy one… On 2011 May 29, at 13:03, Quincey Morris wrote: Error point #2 (super returns nil) is easy. Just return nil. because one should assume that the superclass will have cleaned up

Cocoa-preferred licensing key style?

2011-05-29 Thread Todd Heberlein
For Cocoa apps not distributed through the Mac App Store, is there a common/recommended design pattern for license keys? A little googling around I found common locations were: /Library/Application Support/YourApp/ /Library/Preferences/YourAppBundleID.plist I'm leaning towards a

Re: Cocoa-preferred licensing key style?

2011-05-29 Thread Conrad Shultz
On May 29, 2011, at 16:58, Todd Heberlein todd_heberl...@mac.com wrote: Are there any standard Cocoa classes/frameworks that are helpful for using license keys? I haven't used it myself but I've heard good things about AquaticPrime (http://www.aquaticmac.com/). (Sent from my iPhone.) --

Re: Cocoa-preferred licensing key style?

2011-05-29 Thread Gleb Dolgich
Have a look at my CocoaFob at https://github.com/glebd/cocoafob/ Regards, -- Gleb Dolgich PixelEspresso http://www.pixelespressoapps.com On 30 May 2011, at 00:58, Todd Heberlein wrote: For Cocoa apps not distributed through the Mac App Store, is there a common/recommended design pattern

Re: Cocoa-preferred licensing key style?

2011-05-29 Thread Graham Cox
On 30/05/2011, at 10:06 AM, Conrad Shultz wrote: I haven't used it myself but I've heard good things about AquaticPrime (http://www.aquaticmac.com/). AP is certainly easy to use, but my understanding is that it's very weak and easy to hack, and one hack fits all meaning that all apps that

Re: Cocoa-preferred licensing key style?

2011-05-29 Thread Indragie Karunaratne
Check out Elliptic License: https://github.com/dchest/ellipticlicense It's newer than most of the other solutions out there. On 2011-05-29, at 6:12 PM, Gleb Dolgich wrote: Have a look at my CocoaFob at https://github.com/glebd/cocoafob/ Regards, -- Gleb Dolgich PixelEspresso

Re: Cocoa-preferred licensing key style?

2011-05-29 Thread Tom Hohensee
http://www.aquaticmac.com/ Sent from my iPhone On May 29, 2011, at 6:58 PM, Todd Heberlein todd_heberl...@mac.com wrote: For Cocoa apps not distributed through the Mac App Store, is there a common/recommended design pattern for license keys? A little googling around I found common

Re: Linearly Scaling Text

2011-05-29 Thread Ajay Sabhaney
Also, you should disable screen font substitution via -[NSLayoutManager setUsesScreenFont:NO]. This is the main source of glyph advancement differences you're seeing. Thanks Aki, indeed this has removed the small horizontal offset that was there. I am however unable to figure out where

Re: Linearly Scaling Text

2011-05-29 Thread Ajay Sabhaney
On 2011-05-25, at 3:41 PM, Douglas Davidson wrote: On May 25, 2011, at 2:37 PM, Ajay Sabhaney wrote: - Instead of trying to scale text linearly, use a transformation to scale the NSTextView and image representation appropriately. While this is easy to do with an image, I am having

Re: Cocoa-preferred licensing key style?

2011-05-29 Thread Seth Willits
On May 29, 2011, at 5:15 PM, Graham Cox wrote: I haven't used it myself but I've heard good things about AquaticPrime (http://www.aquaticmac.com/). AP is certainly easy to use, but my understanding is that it's very weak and easy to hack, and one hack fits all meaning that all apps that

Re: Linearly Scaling Text

2011-05-29 Thread Ajay Sabhaney
Also, you should disable screen font substitution via -[NSLayoutManager setUsesScreenFont:NO]. This is the main source of glyph advancement differences you're seeing. Thanks Aki, indeed this has removed the small horizontal offset that was there. I am however unable to figure out

Re: Linearly Scaling Text

2011-05-29 Thread Kyle Sluder
On Sun, May 29, 2011 at 5:54 PM, Ajay Sabhaney co...@mothercreative.com wrote: I have a suspicion that the reason for this has something to do with the fact that the NSTextView instance is being added as a subview of a layer-hosting view. Yes, this is very much unsupported. You will need to

Re: Cocoa-preferred licensing key style?

2011-05-29 Thread Seth Willits
On May 29, 2011, at 6:28 PM, Seth Willits wrote: I haven't used it myself but I've heard good things about AquaticPrime (http://www.aquaticmac.com/). AP is certainly easy to use, but my understanding is that it's very weak and easy to hack, and one hack fits all meaning that all apps

Re: Cocoa-preferred licensing key style?

2011-05-29 Thread Graham Cox
On 30/05/2011, at 11:28 AM, Seth Willits wrote: My understanding it's it's not weak, it's just a classic case of one-hack-fits-all like you say. The keyed authentication is as good as it gets for a license scheme. The only problem is that it generates long (250ish) character keys and some

A Return NSString Problem

2011-05-29 Thread Bing Li
Dear all, I got a problem when processing NSString returned from a method, which extracting data from an XML. The data is extracted correctly by the following method. However, when executing isEqualToString with the returned NSString, it got the exception as follows. -[NSXMLNode

Re: A Return NSString Problem

2011-05-29 Thread Graham Cox
On 30/05/2011, at 1:19 PM, Bing Li wrote: If tracking with XCode, the NSString variable which holds the returned value from the following method is specified as Variable is not a CFString. How to fix the bug? + (NSString *) Read:(NSString *)xml Path:(NSString *)xPath NSArray

Re: Linearly Scaling Text

2011-05-29 Thread Ajay Sabhaney
Thanks Kyle, that's quite helpful. We were initially hesitant to add the NSTextView directly to the layer-hosted view, however the following thread consoled us a little, especially since we were able to get geometry working correctly:

getObjectValue:forString:range:error: not behaving as expected?

2011-05-29 Thread Prentice Alvin
Greetings, When I'm trying to use getObjectValue:forString:range:error: to parse a string that has a date in it, I'm not getting what I would expect as the right range back. For example, in the following code NSString * substring = @junk tomorrow; BOOL gotdate = false; gotdate =

Re: A Return NSString Problem

2011-05-29 Thread Ken Thomases
On May 29, 2011, at 10:19 PM, Bing Li wrote: I got a problem when processing NSString returned from a method, which extracting data from an XML. The data is extracted correctly by the following method. However, when executing isEqualToString with the returned NSString, it got the exception

Re: A Return NSString Problem

2011-05-29 Thread Chris Hanson
On May 29, 2011, at 8:19 PM, Bing Li lbl...@gmail.com wrote: + (NSString *) Read:(NSString *)xml Path:(NSString *)xPath You need to start following the Cocoa naming and other conventions. They may be different than what you're used to, but it will help you a lot in the long term to write code