Re: Creating NSViewController with -init.

2014-03-25 Thread Uli Kusterer
On 25 Mar 2014, at 02:36, Seth Willits wrote: > 2. Either call initWithNibName:bundle: or override nibName. Don't rely on > NSVC being smart and appropriately grabbing a file with the desired name. > Offhand, I believe this is documented to be supported on iOS, but no such > documentation or fe

Re: Simulating sublayers in CATiledLayer

2014-03-25 Thread Remco Poelstra
David Duncan schreef op 24-3-2014 20:41: On Mar 22, 2014, at 2:18 AM, Remco Poelstra > wrote: How can I make sure that some custom drawing method get's called? Call -setNeedsDisplay on the layer (layers are valid by default) Hi, I tried that, but it only draws t

Re: Simulating sublayers in CATiledLayer

2014-03-25 Thread Sandor Szatmari
Remco, I don't know if zooming the layer counts as a change in the layer's bounds, but if your not already doing so, you could try calling -setNeedsDisplayOnBoundsChange: with YES. Sandor > On Mar 25, 2014, at 4:56, Remco Poelstra wrote: > > David Duncan schreef op 24-3-2014 20:41: >>> On Ma

Re: Simulating sublayers in CATiledLayer

2014-03-25 Thread Remco Poelstra
Hi, No, it doesn't. The zooming is done by changing the transform of the tiled layer, scrolling changes the bounds of the tiled layer. Remco Sandor Szatmari schreef op 25-3-2014 12:14: Remco, I don't know if zooming the layer counts as a change in the layer's bounds, but if your not alread

Write with NSFileWrapper vs. copy with NSFileManager

2014-03-25 Thread Colas B
Hi, I am having troubles using NSFileWrapper. In order to have a better understanding of it, I would like to ask you the following question. Is there a difference between     NSURL *referenceURL, *destinationURL ;          [[[NSFileManager alloc] init] copyItemAtURL:referenceURL                

Re: Creating NSViewController with -init.

2014-03-25 Thread Keary Suska
On Mar 24, 2014, at 6:56 PM, Rick Mann wrote: > On Mar 24, 2014, at 17:53 , Kyle Sluder wrote: > >> On Mon, Mar 24, 2014, at 05:41 PM, Rick Mann wrote: >>> I'm creating an NSViewController subclass by calling -init, and at no >>> time passing a name for nibNameOrNil. According to the docs, this

Re: Understanding Application crash

2014-03-25 Thread Fritz Anderson
On 25 Mar 2014, at 12:48 AM, Appa Rao Mulpuri wrote: All of this depends on your being able to produce the exception at least once. I agree that this is easier said than done. > Exception type is: > > ERROR 2014-03-22 08:21:59 +0530 An uncaught exception occured > Name: NSUncaughtSystemExcepti

Re: Understanding Application crash

2014-03-25 Thread Jens Alfke
On Mar 25, 2014, at 7:26 AM, Fritz Anderson wrote: > (I am delighted/dismayed to find that “zombified” is apparently in the Apple > spelling dictionary.) Off-topic: At some point about ten years ago, the AppKit team invited people at Apple to (anonymously) send them their custom spelling ove

Re: Creating NSViewController with -init.

2014-03-25 Thread Kyle Sluder
On Mar 25, 2014, at 7:22 AM, Keary Suska wrote:. > > > The argument name tells it all: "nibNameOrNil" says that nil is a acceptable > option. Why would it be named thus if a nil value would throw an exception? Nobody said the initializer should throw an exception. But -loadView is documented

Re: Creating NSViewController with -init.

2014-03-25 Thread Seth Willits
On Mar 25, 2014, at 12:50 AM, Uli Kusterer wrote: > On 25 Mar 2014, at 02:36, Seth Willits wrote: >> 2. Either call initWithNibName:bundle: or override nibName. Don't rely on >> NSVC being smart and appropriately grabbing a file with the desired name. >> Offhand, I believe this is documented t

GIF frame duration

2014-03-25 Thread Andreas Mayer
I'm working with GIF animations. To find out the delay between frames, there's NSBitmap's -valueForProperty: with a value of NSImageCurrentFrameDuration. I.e. [bitmap valueForProperty:NSImageCurrentFrameDuration] should report the delay time for the current frame. Now what I'm seeing is AppKit

Re: GIF frame duration

2014-03-25 Thread Andreas Mayer
Am 25.03.2014 um 16:58 schrieb Andreas Mayer : > Now what I'm seeing is AppKit reporting a frame delay of 0.1 s for any value > below 0.6 s. That's supposed to read 0.06 s, of course. > Safari and Quicklook seem to use a threshold setting of 0.2 s. And 0.02 s. Andreas __

Re: Simulating sublayers in CATiledLayer

2014-03-25 Thread David Duncan
On Mar 25, 2014, at 1:56 AM, Remco Poelstra wrote: > David Duncan schreef op 24-3-2014 20:41: >> On Mar 22, 2014, at 2:18 AM, Remco Poelstra wrote: >> >>> How can I make sure that some custom drawing method get's called? >> >> >> Call -setNeedsDisplay on the layer (layers are valid by default

Re: GIF frame duration

2014-03-25 Thread Kevin Meaney
If AppKit is using CoreGraphics for reading/writing GIF files then you might have hit the same issue I did. http://blog.yvs.eu.com/2013/10/creating-gif-animations-using-coreimagequartz/ Kevin On 25 Mar 2014, at 16:10, Andreas Mayer wrote: > > Am 25.03.2014 um 16:58 schrieb Andreas Mayer : >

Re: GIF frame duration

2014-03-25 Thread Andreas Mayer
Am 25.03.2014 um 17:12 schrieb D. Felipe Torres : > That is normal and documented behaviour for GIFs. > > Here are some links about it: Yes, I've already read those pages. I don't care at what speed the browsers play animated GIFs. I'm using a system framework to find out the values stored in

Re: Simulating sublayers in CATiledLayer

2014-03-25 Thread Remco Poelstra
> Op 25 mrt. 2014 om 17:25 heeft David Duncan het > volgende geschreven: > >> On Mar 25, 2014, at 1:56 AM, Remco Poelstra wrote: >> >> David Duncan schreef op 24-3-2014 20:41: >>> On Mar 22, 2014, at 2:18 AM, Remco Poelstra wrote: >>> How can I make sure that some custom drawing method

Re: GIF frame duration

2014-03-25 Thread Andreas Mayer
Am 25.03.2014 um 17:25 schrieb Kevin Meaney : > If AppKit is using CoreGraphics for reading/writing GIF files then you might > have hit the same issue I did. Hm. Not sure. First, I'm not trying to write GIFs. And I don't see any problems with delay times forced to multiples of 0.5s. 0.27s, for

Re: Simulating sublayers in CATiledLayer

2014-03-25 Thread Kyle Sluder
> On Mar 25, 2014, at 9:50 AM, Remco Poelstra wrote: > > I've tried with both CALayer and CATiledLayer sublayers, but the CATiledLayer > also did not redraw (at higher resolution) when its parent layer has a > transform. Sounds like your solution involves ceasing the use of transforms for zoom

cocoa-dev@lists.apple.com

2014-03-25 Thread Jerry Krinock
When CFXMLCreateStringByUnescapingEntities is passed the string "�”, it returns a string of two unassigned Unicode characters which cause an NSLog containing it to not print, and also upsets Core Data. // Define the problematic string NSString* bomb1 = @"�" ; NSLog(@"bomb1 length=%ld", (long)[bo

Re: GIF frame duration

2014-03-25 Thread Greg Parker
On Mar 25, 2014, at 9:30 AM, Andreas Mayer wrote: > I don't care at what speed the browsers play animated GIFs. I'm using a > system framework to find out the values stored inside the GIF file. And what > the system reports is wrong in some cases. If this behaviour of AppKit is > documented som

cocoa-dev@lists.apple.com

2014-03-25 Thread Quincey Morris
On Mar 25, 2014, at 10:04 , Jerry Krinock wrote: > // Examine the result > NSLog(@"bomb2 length=%ld", (long)[bomb2 length]) ; > unichar char0 = [bomb2 characterAtIndex:0] ; > NSLog(@"char0 = '%c' = %x = %d", char0, char0, char0) ; > unichar char1 = [bomb2 characterAtIndex:1] ; > NSLog(@"char1 = '

Re: Simulating sublayers in CATiledLayer

2014-03-25 Thread Remco Poelstra
Op 25 mrt. 2014 om 17:59 heeft Kyle Sluder het volgende geschreven: >> On Mar 25, 2014, at 9:50 AM, Remco Poelstra wrote: >> >> I've tried with both CALayer and CATiledLayer sublayers, but the >> CATiledLayer also did not redraw (at higher resolution) when its parent >> layer has a transfor

Re: GIF frame duration

2014-03-25 Thread Andreas Mayer
Am 25.03.2014 um 18:24 schrieb Greg Parker : > NSImage is not describing the contents of the file. NSImage is describing the > contents of the image as AppKit will present it. That seems reasonable. I guess I'd have to complain about how AppKit will present animated GIFs then. ;) > You may g

Re: Creating NSViewController with -init.

2014-03-25 Thread Keary Suska
On Mar 25, 2014, at 9:29 AM, Kyle Sluder wrote: > On Mar 25, 2014, at 7:22 AM, Keary Suska wrote:. >> >> >> The argument name tells it all: "nibNameOrNil" says that nil is a acceptable >> option. Why would it be named thus if a nil value would throw an exception? > > Nobody said the initializ

cocoa-dev@lists.apple.com

2014-03-25 Thread Jens Alfke
On Mar 25, 2014, at 10:49 AM, Quincey Morris wrote: > I agree this is probably a bug in CFXMLCreateStringByUnescapingEntities. It > seems to have assumed a missing ‘;’ at the end of an otherwise valid escaped > character entity. It probably shouldn’t make this assumption. Allowing a missing

cocoa-dev@lists.apple.com

2014-03-25 Thread Quincey Morris
On Mar 25, 2014, at 11:12 , Jens Alfke wrote: > Now, what method/function should we use to validate that an NSString actually > contains valid Unicode code points? This may have been intended as a rhetorical question, but I’d suggest -[NSString dataUsingEncoding:allowLossyConversion:], specify

Re: Creating NSViewController with -init.

2014-03-25 Thread Kyle Sluder
On Tue, Mar 25, 2014, at 11:08 AM, Keary Suska wrote: > Yes, and yes, but also it is documented to not throw an exception is > setView: is used before the view is loaded, which the OP must be using to > avoid the exception. The whole point is that he's not. Try it for yourself. @interface SomeVie

cocoa-dev@lists.apple.com

2014-03-25 Thread Kyle Sluder
On Tue, Mar 25, 2014, at 10:49 AM, Quincey Morris wrote: > However, I also see this as a bug in your code, since you’re accepting > “random” user input as formatted text (i.e. escaped HTML) without > validation. Unfortunately, NSTextView lets users paste invalid UTF-16 codepoints directly into the

Re: GIF frame duration

2014-03-25 Thread Andreas Mayer
CGImageSource and kCGImagePropertyGIFUnclampedDelayTime is what I want. Thanks again. Andreas ___ 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-

What do you guys use to convert an XSD to objective C data classes/structures?

2014-03-25 Thread Alex Zavatone
We have a lot of legacy systems at my latest gig that all use and output XML data. For the purpose of consuming server based XML files, we're looking for a method to automate creation of objective c classes that represent the internal XML data structure. Is there any compelling reason not to d

cocoa-dev@lists.apple.com

2014-03-25 Thread Wim Lewis
On 25 Mar 2014, at 11:12 AM, Jens Alfke wrote: > I agree — it seems like the 32-bit equivalent of the more common mistake of > accepting an input blob containing text without first checking that it’s > valid UTF-8. I did that once, and after debugging the resulting file > corruption bug I made

Re: What do you guys use to convert an XSD to objective C data classes/structures?

2014-03-25 Thread Luther Baker
> We have a lot of legacy systems at my latest gig that all use and output XML data. I remember building a few data-driven webpages completely in XML and XSLT --- and I clearly remember thinking it was the _future_! :-) I must admit up front that I'm not sure which general approach would be best

cocoa-dev@lists.apple.com

2014-03-25 Thread Quincey Morris
On Mar 25, 2014, at 11:28 , Kyle Sluder wrote: > On Tue, Mar 25, 2014, at 10:49 AM, Quincey Morris wrote: >> However, I also see this as a bug in your code, since you’re accepting >> “random” user input as formatted text (i.e. escaped HTML) without >> validation. > > Unfortunately, NSTextView le

Re: What do you guys use to convert an XSD to objective C data classes/structures?

2014-03-25 Thread Alex Zavatone
On Mar 25, 2014, at 3:32 PM, Luther Baker wrote: > > We have a lot of legacy systems at my latest gig that all use and output > > XML data. > > I remember building a few data-driven webpages completely in XML and XSLT --- > and I clearly remember thinking it was the _future_! :-) > > I must a

Re: What do you guys use to convert an XSD to objective C data classes/structures?

2014-03-25 Thread Andy Lee
Maybe you could check with the developer of Objectify whether he has something similar in the works for XML? http://tigerbears.com/objectify/ --Andy > On Mar 25, 2014, at 3:15 PM, Alex Zavatone wrote: > > We have a lot of legacy systems at my latest gig that all use and output XML > data. >

cocoa-dev@lists.apple.com

2014-03-25 Thread Jerry Krinock
Looking at the open source CFXMLCreateStringByUnescapingEntities(), I’d say the code was written to an unrealistic deadline and never reviewed. They scan through the string, looking for the '&', then the ‘#', then the digits, and finally scan past the ‘;' up to the end of the string if necessar

NSInteger/NSUInteger Considerations (64 bit)

2014-03-25 Thread Dave
Hi, I’m working on a Mac App (that may be ported to iOS at some point). The application has to read files in old propriety formats. This files are made up mostly of 8, 16 and 32 bit Signed and Unsigned Integers. In order to do the task and have it work easilly with the rest of the App, the idea

Re: NSInteger/NSUInteger Considerations (64 bit)

2014-03-25 Thread Jens Alfke
On Mar 25, 2014, at 3:51 PM, Dave wrote: > Some of the files I am processing contain in excess of 500 Integer values and > there can be around 3000 of these active at any one time. That’s only a couple megabytes’ worth of address space (12MB if all of them are 64-bit.) > I’m wondering if it

cocoa-dev@lists.apple.com

2014-03-25 Thread Gary L. Wade
Since this could be a security exploit with malformed data being allowed in a bad way, you might set your bug to be a security issue and that¹ll raise eyebrows fast. You do remember how you could crash an app by using a malformed file URL some time back? -- Gary L. Wade http://www.garywade.com/

Re: Simulating sublayers in CATiledLayer

2014-03-25 Thread Graham Cox
Did you notice what David Duncan said?: > For CATiledLayer you need to ensure the levelOfDetail and levelOfDetailBias > is set correctly This is crucial to being able to zoom properly. It's also not that obvious what these mean or the proper values to use, but there was a discussion about this

Re: NSInteger/NSUInteger Considerations (64 bit)

2014-03-25 Thread Rick Mann
On Mar 25, 2014, at 16:55 , Jens Alfke wrote: > So if something is supposed to be a particular size (as seems to happen in > your app) declare it as a type of that size. If you don’t care about the size > and it won’t ever exceed a few billion, use `int` or `unsigned`. If it needs > to hold h

Re: Write with NSFileWrapper vs. copy with NSFileManager

2014-03-25 Thread Mike Abdullah
On 25 Mar 2014, at 12:52, Colas B wrote: > Hi, I am having troubles using NSFileWrapper. In order to have a better > understanding of it, I would like to ask you the following question. > > Is there a difference between > > NSURL *referenceURL, *destinationURL ; > > [[[NSFileMana

NSArrayController and multiple Entities

2014-03-25 Thread Rick Mann
I have this Core Data-backed drawing app (more of a CAD app). It's got a bunch of different types of Core Data Entity, some of which have direct representations in the window, and some which don't. The user can select the drawn ones, and I'm trying to use an NSArrayController to manage that sele

Re: Write with NSFileWrapper vs. copy with NSFileManager

2014-03-25 Thread Jens Alfke
For what it’s worth, I’ve been coding with Cocoa for 13 years and have almost never found a reason to use NSFileWrapper. I think the only times are when I’ve needed to add image or file attachments to an NSTextView (because the API basically requires it.) —Jens _

Re: Write with NSFileWrapper vs. copy with NSFileManager

2014-03-25 Thread Graham Cox
How about when a document is a file package on disk and contains a variety of resources? I've found NSFileWrapper to be a fairly natural fit for that sort of situation. If not, what else would you use? --Graham On 26 Mar 2014, at 2:11 pm, Jens Alfke wrote: > For what it’s worth, I’ve been co

Re: NSArrayController and multiple Entities

2014-03-25 Thread Quincey Morris
On Mar 25, 2014, at 19:57 , Rick Mann wrote: > The problem is that I have to specify an NSManagedObject subclass in IB for > the NSArrayController, so it seem that I have to make a more general base > class in Core Data for the objects that are selectable, is that right? Have to specify? I don

Re: NSArrayController and multiple Entities

2014-03-25 Thread Rick Mann
On Mar 25, 2014, at 21:11 , Quincey Morris wrote: > On Mar 25, 2014, at 19:57 , Rick Mann wrote: > >> The problem is that I have to specify an NSManagedObject subclass in IB for >> the NSArrayController, so it seem that I have to make a more general base >> class in Core Data for the object

Re: NSArrayController and multiple Entities

2014-03-25 Thread Quincey Morris
On Mar 25, 2014, at 21:28 , Rick Mann wrote: > I think it only started complaining when I checked "Prepares Content," but it > didn't seem to work at all until I did that. It does a fetch for you when it “prepares content”, and I guess it needs the class for that too. Can’t you just specify NS