Re: First trials in Cocoa app

2010-09-08 Thread Dave Carrigan
On Sep 8, 2010, at 9:40 PM, Jeff Laing wrote: >>> If that's not possible, how can I define a function that can reach the >> objects of my application? The ViewController is stored in the >> ApplicationDeletegate, but I can't find any reference to that object. > > Ummm, is this really hard? > >

RE: First trials in Cocoa app

2010-09-08 Thread Jeff Laing
> > If that's not possible, how can I define a function that can reach the > objects of my application? The ViewController is stored in the > ApplicationDeletegate, but I can't find any reference to that object. Ummm, is this really hard? id MyAppDelegate = [[UIApplication sharedApplication] dele

Re: First trials in Cocoa app

2010-09-08 Thread Dave Carrigan
You can't pass a method so you'll have to write a C function as your callback function. If the library allows you to pass a parameter to the function which will be in turn passed to the callback, then you would pass your view controller to the function and then call the method from the function.

Re: Compress/decompress NSStrings or NSData

2010-09-08 Thread Kyle Sluder
On Sep 8, 2010, at 2:28 AM, "Rufat A. Abdullayev" wrote: > Hello All > > Sorry if that topic already is in the list. I just could not find it > > I need simple solution for compressing/decompressing NSData or NSString using > only standard tools and libs > > I'm planning to compress JSON data

RE: Lake Forest Cocoaheads meeting 9/8 - design patterns, Cocoa and other

2010-09-08 Thread Shawn Bakhtiar
Since were posting "This month [they] are incredibly pleased to have @upsidedowndog, aka Niilo Tippler, talking about the development and release of his iOS app, The Home Gene-Splicing Kit." http://www.cocoaheadsla.org/2010/09/next-meeting-september-9-2010/ Which sounds REAL REAL cool. I'

Compress/decompress NSStrings or NSData

2010-09-08 Thread Rufat A. Abdullayev
Hello All Sorry if that topic already is in the list. I just could not find it I need simple solution for compressing/decompressing NSData or NSString using only standard tools and libs I'm planning to compress JSON data on web server side and decompress it on iphone side I googled for soluti

First trials in Cocoa app

2010-09-08 Thread Remco Poelstra
Hi all, I'm very new to Cocoa and I'm trying to build my first app after reading and doing tutorials. I've a view with a UITextView on it and a button. When I press the button I want to call a third party C library which sends out and UDP packet searching for devices on the network. The respons

why textFieldShouldBeginEditing is called twice in iOS4?

2010-09-08 Thread Rufat A. Abdullayev
Hi All Sorry if that topic is already there in the mailing list (actually I could not find it) I noted that textFieldShouldBeginEditing of an UITextField called twice in iOS4. This is probably bug in iOS4 b/c I have this event called one in prev versions of iOS Though I found work-around (jus

Re: NSNumber compare: Giving Unexpected Results

2010-09-08 Thread Darren Minifie
"After linking them my warning count went way down" Chris this is a GREAT line haha. Seriously though, treat all warnings as errors. Fix em' up, as they are usually the cause of strange behavior. On Wed, Sep 8, 2010 at 2:28 PM, Chris Tracewell wrote: > After linking them my warning count went

some no-op animation options?

2010-09-08 Thread Matt Neuburg
I have been experimenting with the new iOS 4 block-based UIView animation, and I cannot find any situation where the option UIViewAnimationOptionAllowAnimatedContent makes any difference. What I expect from the documentation is that this should cause drawRect: to be called repeatedly, but it doesn'

Re: delayed NSWorkspaceDidTerminateApplicationNotification under 10.6?

2010-09-08 Thread Shane Stanley
On 9/9/10 8:13 AM, "Dave Keck" wrote: >> No, this is not correct. You can compile a script without launching >> the target - at least on Snow Leopard. > > I'm afraid my testing shows otherwise; on my system, the following > code always launches Safari on both 10.5 and 10.6: > > NSAppleS

Re: delayed NSWorkspaceDidTerminateApplicationNotification under 10.6?

2010-09-08 Thread slasktrattena...@gmail.com
On Thu, Sep 9, 2010 at 12:13 AM, Dave Keck wrote: > I don't think performance is going to be a big issue with the process > APIs; at any given time a user probably isn't going to have over 20 or > 30 foreground+background apps running, so even iterating over each one > shouldn't be much an issue.

Re: delayed NSWorkspaceDidTerminateApplicationNotification under 10.6?

2010-09-08 Thread Dave Keck
> > Anyway, I ended up using the Process Manager APIs > > to check whether the app in question was running before executing an > > AppleScript to issue commands to it. > > It's worth a try. But I'm afraid it will put a heavy load on the CPU > for a timer firing every second, no? You'll have to pro

Re: NSNumber compare: Giving Unexpected Results

2010-09-08 Thread Chris Tracewell
On Sep 8, 2010, at 1:29 PM, Greg Parker wrote: > On Sep 8, 2010, at 12:40 PM, Chris Tracewell wrote: >> On Sep 8, 2010, at 12:02 PM, cocoa-dev-requ...@lists.apple.com wrote: >>> It's not YES that's being "returned as" -256, but NO. (The answer is NO in >>> all 3 cases.) -256 is 0xFF00, so yo

Re: delayed NSWorkspaceDidTerminateApplicationNotification under 10.6?

2010-09-08 Thread slasktrattena...@gmail.com
Hi Dave, Thanks for your reply. On Wed, Sep 8, 2010 at 7:18 PM, Dave Keck wrote: >> After the release of Snow Leopard, it seems that [iTunes isRunning] >> returns YES for a short while even after the application has quit (I >> believe this applies to all apps, not just iTunes, but I haven't >> c

Re: NSNumber compare: Giving Unexpected Results

2010-09-08 Thread Greg Parker
On Sep 8, 2010, at 12:40 PM, Chris Tracewell wrote: > On Sep 8, 2010, at 12:02 PM, cocoa-dev-requ...@lists.apple.com wrote: >> It's not YES that's being "returned as" -256, but NO. (The answer is NO in >> all 3 cases.) -256 is 0xFF00, so you can see that NO (i.e. (signed char) >> 0) is being

Re: NSNumber compare: Giving Unexpected Results

2010-09-08 Thread Quincey Morris
On Sep 8, 2010, at 12:40, Chris Tracewell wrote: > I must admit that I do not understand why this is so. I can for example use > if ([someButton isEnabled]) and it returns a BOOL and the if statement works > fine. If you have any pointers or docs that explains this further I would > really app

Re: NSView alphaValue animation on 10.5

2010-09-08 Thread Kyle Sluder
On Wed, Sep 8, 2010 at 12:32 PM, Alexander Cohen wrote: > I've got a lot of code that depends on 10.6's use of NSView's animator and > setAlphaValue for showing and hiding animations. Now, i need to bring this to > 10.5. On 10.5, to animate the alphaValue, i learnt that the NSView needs to > be

Re: NSTableView/NSOutlineView variable row height code has detected re-entry.

2010-09-08 Thread Keith Blount
Hello Clark, Many thanks for the reply, much appreciated. I figured the "re-entry" probably meant something along those lines, but I wasn't sure, so thank you for clarifying it. I'm not calling anything explicitly in my -outlineView:heightOfRowByItem: method, and there are no other threads ope

Re: Cocoa-dev Digest, Vol 7, Issue 890

2010-09-08 Thread Kyle Sluder
On Wed, Sep 8, 2010 at 11:50 AM, Quincey Morris wrote: > So, the problem is not your 'isLessThanZero' method, but the calling code, > which is treating the returned value as an int (or something). Presumably the > calling code was compiled with an incompatible declaration of your method, or > o

Re: NSNumber compare: Giving Unexpected Results

2010-09-08 Thread Chris Tracewell
On Sep 8, 2010, at 12:02 PM, cocoa-dev-requ...@lists.apple.com wrote: > It's not YES that's being "returned as" -256, but NO. (The answer is NO in > all 3 cases.) -256 is 0xFF00, so you can see that NO (i.e. (signed char) > 0) is being correctly returned in the low order byte, with trash in

NSView alphaValue animation on 10.5

2010-09-08 Thread Alexander Cohen
Hi, I've got a lot of code that depends on 10.6's use of NSView's animator and setAlphaValue for showing and hiding animations. Now, i need to bring this to 10.5. On 10.5, to animate the alphaValue, i learnt that the NSView needs to be backed by a layer. I tried doing that and it created mayhem

missing features in iOS 4 block-based UIView animation

2010-09-08 Thread Matt Neuburg
The iOS 4 syntax for using Objective-C blocks with UIView animation (instead of the old-style UIView "animation block", love the confusing terminology here) is delightful, but some features are missing: * You can't designate a delegate, so you can't get a notification when the animation is about t

Re: NSTableView/NSOutlineView variable row height code has detected re-entry.

2010-09-08 Thread Kevin Wojniak
That usually means drawRect: is being called while the table is already inside its own drawRect: method. I've had to deal with this recently. One possible way to find out where it's happening is to subclass your table view and override drawRect:, then setup a counter to check to see if the re-e

Re: Cocoa-dev Digest, Vol 7, Issue 890

2010-09-08 Thread Quincey Morris
On Sep 8, 2010, at 11:07, Chris Tracewell wrote: > I am truly perplexed - the boolean YES is being returned as -256. I think my > problem is with how BOOL is being passed, cast, interpreted... I know it is > typedef, it's as if though something is getting "lost in translation. Take a > look at

Re: NSNumber compare: Giving Unexpected Results

2010-09-08 Thread Kyle Sluder
On Tue, Sep 7, 2010 at 5:58 PM, Chris Tracewell wrote: > I have a category on NSDecimalNumber that seems very straight forward - yet > is producing odd results. The code below shows my logging and everything > outputs as expected - but the final evaluation does not work. Am I > misunderstanding

Re: NSNumber compare: Giving Unexpected Results

2010-09-08 Thread Chris Tracewell
On Sep 8, 2010, at 10:21 AM, cocoa-dev-requ...@lists.apple.com wrote: > The message in the 'if' ([theNumOne compare:theNumTwo]) is an invocation of > [NSNumber compare:], not [NSDecimalNumber compare:]. It's not absolutely > clear what is supposed to happen when the compare parameter is an inst

Re: NSTableView/NSOutlineView variable row height code has detected re-entry.

2010-09-08 Thread Clark Cox
On Wed, Sep 8, 2010 at 11:11 AM, Keith Blount wrote: > Hello, > > I have an NSOutlineView with variable row heights, as determined in > my -outlineView:heightOfRowByItem: delegate method. This has always seemed to > work fine, and the code of this delegate method hasn't changed much in the > past

NSTableView/NSOutlineView variable row height code has detected re-entry.

2010-09-08 Thread Keith Blount
Hello, I have an NSOutlineView with variable row heights, as determined in my -outlineView:heightOfRowByItem: delegate method. This has always seemed to work fine, and the code of this delegate method hasn't changed much in the past three years, but I have had a user report a case whereby his o

Re: Cocoa-dev Digest, Vol 7, Issue 890

2010-09-08 Thread Chris Tracewell
On Sep 8, 2010, at 10:21 AM, cocoa-dev-requ...@lists.apple.com wrote: > The message in the 'if' ([theNumOne compare:theNumTwo]) is an invocation of > [NSNumber compare:], not [NSDecimalNumber compare:]. It's not absolutely > clear what is supposed to happen when the compare parameter is an insta

Re: delayed NSWorkspaceDidTerminateApplicationNotification under 10.6?

2010-09-08 Thread Dave Keck
> > After the release of Snow Leopard, it seems that [iTunes isRunning] > returns YES for a short while even after the application has quit (I > believe this applies to all apps, not just iTunes, but I haven't > confirmed this yet). As a result, my app would relaunch iTunes, > assuming it was still

delayed NSWorkspaceDidTerminateApplicationNotification under 10.6?

2010-09-08 Thread slasktrattena...@gmail.com
Hello, This problem was introduced in Mac OS X 10.6 and has remained unsolved ever since. I've got a timer that polls iTunes for its player position every second. I used to use ScriptingBridge for this task: if ( [iTunes isRunning] ) { if ( [self isPlaying] ) return [iTunes playerPosition]; }

Re: NSEntityMigrationPolicy subclass methods not being called

2010-09-08 Thread Jerry Krinock
On 2010 Sep 08, at 01:43, Ben wrote: > I get the following… > > NSUnderlyingError = Error Domain=NSCocoaErrorDomain Code=256 > UserInfo=0x1ec540 "Operation could not be completed. (Cocoa error 256.)"; > reason = "Failed to save new store after first pass of migration."; Nice-looking error,

Core Data and Managed Object Context Question

2010-09-08 Thread Ajay Sabhaney
Hello list, I have a Core Data based application with a simple data model. There is an entity 'ItemContainer' which has a to-many relationship with the entity 'Item'. An item model entity corresponds to a Core Animation layer, so when a new Item managed object is added to the ItemContainer ma

Re: NSEntityMigrationPolicy subclass methods not being called

2010-09-08 Thread Ben
Hi Jerry, thanks for the reply. I managed to get the subclass methods to fire eventually, I have no idea what I was doing wrong though. I trashed all my files and started again and for some reason that fixed it. But I now have another problem, core data migrates fine without the NSEntityMigrati