Re: NSBlockOperation with +[sendSynchronousRequest sendSynchronousRequest:...] or async?

2011-01-20 Thread Aurélien Hugelé
Always use the async API. For networking, there are *tons* of reasons to avoid your own threading (ie, CPU -> battery consumption) when Apple does all that for your using their Async API (and only one global thread to manage the network) Look at the free WWDC videos from 2010, this is very well e

Re: best way of making a constant animation

2011-01-20 Thread Gustavo Pizano
Gerry thank you very much. I have used CA before, but sometimes I get complicated it with it, dunno why.. and i end up using UIView block animations. I will implement this and see how it looks G On Jan 21, 2011, at 1:01 AM, Gerry Beggs wrote: > Hello Gustavo. > > This sounds like a perf

Re: Help on Cocoa Class references

2011-01-20 Thread Michael Hall
On Jan 19, 2011, at 9:18 PM, Scott Anguish wrote: > Apple won’t even be shipping Java with the OS in the future (there was an > announcement about this recently). You’ll need to get it from Oracle (who > Apple transferred things to as I recall in another announcement) Announcing: OpenJDK for M

Problem with garbage collection in server application

2011-01-20 Thread Rick Hoge
I have an application based on the "Cocoa Application" template in Xcode (x86_64, currently testing on OSX 10.6.5) that listens for client messages using an NSConnection. Both client and server have been designed for garbage collection, and are compiled GC-only. The client is a simple command

Re: Help on Cocoa Class references

2011-01-20 Thread Leanne Attard
Thanks a lot for your help and the problem has now been solved by creating a subclass of nsview and adding as a subview to the nsview brought about from the AWT surface --- On Thu, 1/20/11, Marco Frisan wrote: From: Marco Frisan Subject: Re: Help on Cocoa Class references To: sc...@cocoadoc.

Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )

2011-01-20 Thread Andy Lee
On Jan 20, 2011, at 9:39 PM, Corbin Dunn wrote: > Now for something like a button, it obviously won't run into this type of > latent drawing issue, since they don't message the delegate every time they > draw. However, if you temporarily allocated an object and set it as the > target/action of a

Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )

2011-01-20 Thread Andy Lee
On Jan 20, 2011, at 8:51 PM, Eric Gorr wrote: > On Jan 20, 2011, at 4:27 PM, Corbin Dunn wrote: [...] >> Yes, please do file a bug. The sample should set the delegate/datasource to >> nil, as it is good practice to do so, and we can update the sample. > > Bug filed: rdar://8896270 I just submit

Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )

2011-01-20 Thread Corbin Dunn
On Jan 20, 2011, at 1:33 PM, Abdul Sowayan wrote: > Hi Corbin, > > >> I wrote that sample, and gave the WWDC talk based on it a few years ago. I >> also "own" NSTableView. >> >> Yes, please do file a bug. The sample should set the delegate/datasource to >> nil, as it is good practice to do so,

Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )

2011-01-20 Thread Eric Gorr
On Jan 20, 2011, at 4:27 PM, Corbin Dunn wrote: > Hi Eric, > > On Jan 20, 2011, at 9:26 AM, Eric Gorr wrote: > >> >> On Jan 20, 2011, at 12:17 PM, Kyle Sluder wrote: >> >>> On Thu, Jan 20, 2011 at 7:22 AM, Eric Gorr wrote: Based on my current understanding, the dealloc should be setting

Re: iOS Pass NSManagedObjectContext from my app delegate

2011-01-20 Thread Eeyore
On Jan 20, 2011, at 4:46 PM, Nick Zitzmann wrote: > > On Jan 20, 2011, at 5:25 PM, Philip Vallone wrote: > >> Currently, my NSManagedObjectContext is retained like this in my app >> delegate: >> >> @property (nonatomic, retain, readonly) NSManagedObjectContext >> *managedObjectContext; > >

Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )

2011-01-20 Thread Eric Gorr
On Jan 20, 2011, at 4:56 PM, Sean McBride wrote: > On Thu, 20 Jan 2011 13:27:35 -0800, Corbin Dunn said: > >>> For a specific example, check out the AnimatedTableView sample code >> from Apple. The ATColorTableController class is a datasource for the >> table, but it's dealloc looks like: >>>

Re: printing a different representation than what is on the screen

2011-01-20 Thread David Reed
On Jan 20, 2011, at 10:03 AM, Sherm Pendley wrote: > On Thu, Jan 20, 2011 at 9:24 AM, Dave Reed wrote: >> I'm working on a document-based application that has a couple tabs. Most of >> the tabs contain NSTableViews, NSTextFields, etc. >> >> I want to provide a way for the user to print the dat

Re: iOS Pass NSManagedObjectContext from my app delegate

2011-01-20 Thread Philip Vallone
Hi Nick, > Did you use the Xcode template for making a CoreData application? Yes > If you have declared the property to be read-only, then the retain keyword is > not necessary. Retain and assign are only necessary if it's a read/write > property, since they tell the synthesizer what to do wi

Re: iOS Pass NSManagedObjectContext from my app delegate

2011-01-20 Thread Nick Zitzmann
On Jan 20, 2011, at 5:25 PM, Philip Vallone wrote: > Hi, > > Whats the best way to pass a NSManagedObjectContext object from an app > delegate to other view controllers? Did you use the Xcode template for making a CoreData application? > Currently, my NSManagedObjectContext is retained like t

iOS Pass NSManagedObjectContext from my app delegate

2011-01-20 Thread Philip Vallone
Hi, Whats the best way to pass a NSManagedObjectContext object from an app delegate to other view controllers? Currently, my NSManagedObjectContext is retained like this in my app delegate: @property (nonatomic, retain, readonly) NSManagedObjectContext *managedObjectContext; @private NSMa

Re: best way of making a constant animation

2011-01-20 Thread Gerry Beggs
Hello Gustavo. This sounds like a perfect job for Core Animation. With Core Animation, you can apply the animation to the UIImageView's layer. Core Animation allows for animations to run once and stop automatically, repeat a specific number of times, or repeat indefinitely until you tell it to st

NSBlockOperation with +[sendSynchronousRequest sendSynchronousRequest:...] or async?

2011-01-20 Thread Rick Mann
With the advent of code blocks and NSBlockOperation, it's a lot tidier, and easier, to write code using NSURLConnection, particularly in the presence of multiple operations. The approach is to use an NSBlockOperation and +[NSURLConnection sendSynchronousRequest:returningResponse:error:] to sync

NSTask -launch fails sheepishly when ARG_MAX exceeded

2011-01-20 Thread jonat...@mugginsoft.com
The docs for NSTask -launch state: Raises an NSInvalidArgumentException if the launch path has not been set or is invalid or if it fails to create a process. What it doesn't address is what happens if the process command line formed from the NSTask properties exceeds ARG_MAX. The path is valid,

best way of making a constant animation

2011-01-20 Thread Gustavo Pizano
Hello all, sorry to bother with such a question... here it goes. I need to have a rotate animation of a UIImageView, very very soft, I know using UIView class methods I can make the animation and setting the affine transform + plus the duration to something really big like 1e100f, the thing is

Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )

2011-01-20 Thread Sean McBride
On Thu, 20 Jan 2011 13:27:35 -0800, Corbin Dunn said: >> For a specific example, check out the AnimatedTableView sample code >from Apple. The ATColorTableController class is a datasource for the >table, but it's dealloc looks like: >> >> - (void)dealloc >> { >> [_colorList release]; >> [_colo

Re: Odd Crash when adding table columns manually

2011-01-20 Thread Lee Ann Rucker
On Jan 20, 2011, at 1:24 PM, Corbin Dunn wrote: On Jan 19, 2011, at 4:51 PM, Lee Ann Rucker wrote: On Jan 19, 2011, at 3:21 PM, Corbin Dunn wrote: In general, it is good practice in your apps to set your delegate and datasource to nil. Who is to say something might cause a draw to happen, w

Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )

2011-01-20 Thread Abdul Sowayan
Hi Corbin, > I wrote that sample, and gave the WWDC talk based on it a few years ago. I > also "own" NSTableView. > > Yes, please do file a bug. The sample should set the delegate/datasource to > nil, as it is good practice to do so, and we can update the sample. Thanks for the clarification, i

Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )

2011-01-20 Thread Corbin Dunn
Hi Eric, On Jan 20, 2011, at 9:26 AM, Eric Gorr wrote: > > On Jan 20, 2011, at 12:17 PM, Kyle Sluder wrote: > >> On Thu, Jan 20, 2011 at 7:22 AM, Eric Gorr wrote: >>> Based on my current understanding, the dealloc should be setting it's >>> datasource and delegate to nil. Correct? If so, I wi

Re: Odd Crash when adding table columns manually

2011-01-20 Thread Corbin Dunn
On Jan 19, 2011, at 4:51 PM, Lee Ann Rucker wrote: > > On Jan 19, 2011, at 3:21 PM, Corbin Dunn wrote: > >> >> In general, it is good practice in your apps to set your delegate and >> datasource to nil. Who is to say something might cause a draw to happen, >> which would then message your (n

Re: Help on Cocoa Class references

2011-01-20 Thread Marco Frisan
> Message: 3 > Date: Wed, 19 Jan 2011 22:18:04 -0500 > From: Scott Anguish > Subject: Re: Help on Cocoa Class references > To: Leanne Attard > Cc: cocoa-dev@lists.apple.com > Message-ID: <8c659320-34f8-4b47-830d-796386224...@cocoadoc.com> > Content-Type: text/plain; charset=windows-1252 > > I‚m

Re: non-NSString values in model user info via xcode UI

2011-01-20 Thread Mikkel Eide Eriksen
Hi Quincey Thanks for the speedy reply. I'll look into having the root entity either parse from a plist or something similar. Hmm, it just occured to me that I can put json strings in the user info, and parse them back into the user info. That would enable me to put complex nested dictionaries

Re: non-NSString values in model user info via xcode UI

2011-01-20 Thread Quincey Morris
On Jan 20, 2011, at 11:57, Mikkel Eide Eriksen wrote: > I have a Core Data model and I'd like to add some metadata about the > entities/attributes/relationships. In most cases, strings are fine, but I'd > also like to record arrays or even sub-dictionaries. This will reduce the > amount of code

Re: Store a file vs create on the fly?

2011-01-20 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 1/20/11 2:21 AM, Uli Kusterer wrote: > On Jan 19, 2011, at 2:30 AM, Jeremy Matthews wrote: >> So I have a simple app which, in essence, creates a text file with >> some items determined by the user (kind of like an old-fashioned >> Mad Libs page). M

Re: loop not running

2011-01-20 Thread Quincey Morris
On Jan 20, 2011, at 11:48, Amy Heavey wrote: > NSArray *newOrderProducts; > newOrderProducts = [Products selectedObjects]; > NSEnumerator *loop = [newOrderProducts objectEnumerator]; > NSObject *product; > NSLog(@"Hello There!"); > //for each selected product: >

non-NSString values in model user info via xcode UI

2011-01-20 Thread Mikkel Eide Eriksen
Hi all, I have a Core Data model and I'd like to add some metadata about the entities/attributes/relationships. In most cases, strings are fine, but I'd also like to record arrays or even sub-dictionaries. This will reduce the amount of code in my app by a fair deal. As far as I can tell, the

Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )

2011-01-20 Thread Abdul Sowayan
Hi folks, I'm trying to figure out a clear guideline on how to handle weak references. Let's consider the following scenarios: 1- Say I have a button, and set its action/target (via a nib file) to call method on the controller. In the controller dealloc method, should the controller set the actio

loop not running

2011-01-20 Thread Amy Heavey
I've got the following code that is almost identical to code I've got in another app. The other app works, this one doesn't. The only difference between the two is the variable names; - (IBAction)addItemsToOrder:sender;{ NSObject *order; order = [[Orders selectedObjects] objec

Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )

2011-01-20 Thread Quincey Morris
On Jan 20, 2011, at 07:22, Eric Gorr wrote: > I was wondering why this was such a surprise to me, so I went hunting through > sample code, books, etc. > > I cannot seem to find any sample code, either in books (even Cocoa > Programming for Mac OS X (3rd Edition)) or in Apple's own sample code w

Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )

2011-01-20 Thread Eric Gorr
On Jan 20, 2011, at 12:17 PM, Kyle Sluder wrote: > On Thu, Jan 20, 2011 at 7:22 AM, Eric Gorr wrote: >> Based on my current understanding, the dealloc should be setting it's >> datasource and delegate to nil. Correct? If so, I will file a bug. > > No. It is the responsibility of the delegate t

Re: Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )

2011-01-20 Thread Kyle Sluder
On Thu, Jan 20, 2011 at 7:22 AM, Eric Gorr wrote: > Based on my current understanding, the dealloc should be setting it's > datasource and delegate to nil. Correct? If so, I will file a bug. No. It is the responsibility of the delegate to set the table view's backpointer to nil. The delegate usu

Cleaning up weak references ( was Re: Odd Crash when adding table columns manually )

2011-01-20 Thread Eric Gorr
On Jan 19, 2011, at 8:24 PM, Eric Gorr wrote: > On Jan 19, 2011, at 8:19 PM, Graham Cox wrote: > >> On 20/01/2011, at 12:14 PM, Eric Gorr wrote: >> >>> The table is also owned by the the scrolling view and therefore the window >>> and would not be deallocated here...it will stick around long af

Re: printing a different representation than what is on the screen

2011-01-20 Thread Sherm Pendley
On Thu, Jan 20, 2011 at 9:24 AM, Dave Reed wrote: > I'm working on a document-based application that has a couple tabs. Most of > the tabs contain NSTableViews, NSTextFields, etc. > > I want to provide a way for the user to print the data contained in them > (just text, possibly with some grid l

printing a different representation than what is on the screen

2011-01-20 Thread Dave Reed
I'm working on a document-based application that has a couple tabs. Most of the tabs contain NSTableViews, NSTextFields, etc. I want to provide a way for the user to print the data contained in them (just text, possibly with some grid lines), but not the actual table view. I've read through (a

Re: Sending multiple files via Bluetooth using GameKit

2011-01-20 Thread Ricky Sharp
You can but keep in mind the following: The max packet size is 87K so for larger blocks of data, you will have to break things up. You will need a mini state machine to keep track of what was sent vs. what is left to send. And will of course need all the logic to handle error conditions, retr

Re: Store a file vs create on the fly?

2011-01-20 Thread Uli Kusterer
On Jan 19, 2011, at 2:30 AM, Jeremy Matthews wrote: > So I have a simple app which, in essence, creates a text file with some items > determined by the user (kind of like an old-fashioned Mad Libs page). Most of > the file does not change...I just change a few portions based upon checkbox > stat