How to update all views when underlying data changes?

2010-11-29 Thread G S
Hi all. I'm writing an iPhone app that interacts with a database over the Web using XML, and PHP on the server side. Obviously, delays in downloading data are frequent, so I'm using Grand Central Dispatch to do a bunch of it asynchronously. This brings up a basic question: How do I notify all

Re: How to update all views when underlying data changes?

2010-11-29 Thread jonat...@mugginsoft.com
On 29 Nov 2010, at 11:27, G S wrote: Hi all. I'm writing an iPhone app that interacts with a database over the Web using XML, and PHP on the server side. Obviously, delays in downloading data are frequent, so I'm using Grand Central Dispatch to do a bunch of it asynchronously. This

bindings via file's owner don't update

2010-11-29 Thread Mikkel Eide Eriksen
Hi all, In a document-based app, I have the main Document xib a Loading xib. The latter is shown while the program reads a file closes after. When reading a file, my Document object tells LoadingWindowController to show its window [loadingWindowController setDocument:self]; This is to

Re: [ANN] DDMathParser

2010-11-29 Thread Florent Pillet
Great work from Dave! I had been using Graham's GCMathParser but we needed something more powerful, and I stumbled upon muParser (http://muparser.sourceforge.net/) which is quite excellent, albeit much more complex en Dave's or Graham's solution (I had to write my own thin wrapper around it,

Re: bindings via file's owner don't update

2010-11-29 Thread James Bucanek
Mikkel Eide Eriksen mailto:mikkel.erik...@gmail.com wrote (Monday, November 29, 2010 6:00 AM +0100): When reading a file, my Document object tells LoadingWindowController to show its window [loadingWindowController setDocument:self]; I'm not sure this is your problem (and I'm sure someone

Re: bindings via file's owner don't update

2010-11-29 Thread James Bucanek
James Bucanek mailto:subscri...@gloaming.com wrote (Monday, November 29, 2010 8:37 AM -0700): Basically, if I add an observer using the path document.someProperty, KVO attaches the observer to the the someProperty object, not document. So if I change it (document.someProperty = newProperty),

Re: bindings via file's owner don't update

2010-11-29 Thread Mikkel Eide Eriksen
I don't think I'm replacing the document per se. In my NSDocument init override, I do this (only relevant parts copied): if (![self loadingWindowController]) [self setLoadingWindowController:[[MyLoadingWindowController alloc] init]]; [[self loadingWindowController] setDocument:self];

Re: bindings via file's owner don't update

2010-11-29 Thread Mikkel Eide Eriksen
I just tried properly adding the loadingWindowController to NSDocument's windowControllers without any luck. Then I tried moving the @property objectCount to my loadingWindowController and updating it from NSDocument: [[self loadingWindowController] setObjectCount:[[self

iOS: UIWindow orientation

2010-11-29 Thread Phillip Mills
While attempting to track movement during a long press, I was surprised to discover that the x direction of an application's UIWindow seems to be for the portrait x dimension no matter how the device is turned. Using [recognizer locationOfTouch:i inView:[recognizer view]] matches the apparent

Re: bindings via file's owner don't update

2010-11-29 Thread James Bucanek
Mikkel Eide Eriksen mailto:mikkel.erik...@gmail.com wrote (Monday, November 29, 2010 10:00 AM +0100): [[self loadingWindowController] setObjectCount:[[self loadingWindowController] objectCount]+1]; Still no go on the interface (I can tell via logs that controller.objectCount is incrementing

Foundation vs Core Foundation

2010-11-29 Thread Jon Sigman
I'm new to OSX/Cocoa, coming from Solaris. I'm porting the functionality of a Solaris connection server to Mac OS X. Porting isn't exactly the right word since I'm taking the liberty to use Cocoa and whatever else OSX offers to get things working well, including rearchitecting. Before I start

Re: Foundation vs Core Foundation

2010-11-29 Thread James Bucanek
Jon Sigman mailto:rf_...@yahoo.com wrote (Monday, November 29, 2010 12:59 PM -0800): Before I start down the wrong path: What is the difference between a Foundation tool and a Core Foundation tool? Short answer: Foundation: Objective-C Core Foundation: C If you plan to write your

Re: Foundation vs Core Foundation

2010-11-29 Thread Dave Keck
Before I start down the wrong path: What is the difference between a Foundation tool and a Core Foundation tool? Primarily I will be needing to use TCP/IP sockets, file I/O, and multithreading, so is one a better fit than the other? I believe OSX calls this type of GUI-less background

Re: Foundation vs Core Foundation

2010-11-29 Thread Sherm Pendley
On Mon, Nov 29, 2010 at 2:59 PM, Jon Sigman rf_...@yahoo.com wrote: Before I start down the wrong path: What is the difference between a Foundation tool and a Core Foundation tool? You mean, the project types when you start a new project in Xcode? A Core Foundation tool links against (you

accelerometer puzzle

2010-11-29 Thread David Rowland
I have a class defined like this, @interface GAppDelegate : NSObject UIApplicationDelegate, UIAccelerometerDelegate { and inside that class I have implemented this, // UIAccelerometerDelegate method, called when the device accelerates. - (void)accelerometer:(UIAccelerometer *)accelerometer

Re: accelerometer puzzle

2010-11-29 Thread David Duncan
On Nov 29, 2010, at 12:31 PM, David Rowland wrote: When I build, I get a warning, type 'id UIApplicationDelegate' does not conform to the 'UIAccelerometerDelegate' protocol Whatever is being referred to on the line you are getting this warning is only typed as idUIApplicationDelegate so

iOS: erratic compass behaviour

2010-11-29 Thread sebi
hello, I spent all day getting some AR app done and used the CLLocationManager's heading and the CMMotionManager a lot. then in the evening the compass freaked out, not only in my app, also the built in Compass.app, which would be sometimes correct, but most of the time between 20 an 180°

Re: bindings via file's owner don't update

2010-11-29 Thread Quincey Morris
On Nov 29, 2010, at 08:10, Mikkel Eide Eriksen wrote: Reading up on the documentation, I guess what I should do in my Document init is this: if (![self loadingWindowController]) [self setLoadingWindowController:[[MyLoadingWindowController alloc] init]]; [self

Re: Foundation vs Core Foundation

2010-11-29 Thread Jon Sigman
It sounds like Foundation is the safer way to go, especially to safeguard future functionality expansion. I take it Foundation does not contain Core Foundation, but at least they're not mutually exclusive? If I go Foundation, I can include Core Foundation as well, should I want something in

Re: iOS: erratic compass behaviour

2010-11-29 Thread David Rowland
I believe this is true: Under 4.1 the reading is updated only when the heading changes. Under 4.2 it is updated at the rate requested. My test app was highly erratic until the new OS, now it acts (more or less) the way I expect. What I find strange is that when I bring a magnet near the

Re: How to update all views when underlying data changes?

2010-11-29 Thread Leonardo
On any view to have to update, on the init method or on the awakeFromNib method you add this line of code to register to a given notification. You choose the name of the notification e.g. UnderlyingDataHasChanged, and the method that has to be called, e.g. RefreshMe: [[NSNotificationCenter

Re: how to add a custom view (a pair of controls) to an NSToolbar in Interface Builder

2010-11-29 Thread Joey Hagedorn
Rua, This won't work with an instance of the custom view in the toolbar. A workaround would be to use a borderless (Custom / No Border) NSBox instead of a custom view. This is probably the most straightforward fix. There is some more info in this older post to the list:

Re: how to add a custom view (a pair of controls) to an NSToolbar in Interface Builder

2010-11-29 Thread Rua Haszard Morris
Thank you Joey! This most certainly works a treat. cheers Rua HM. On 30/11/2010, at 10:59 AM, Joey Hagedorn wrote: Rua, This won't work with an instance of the custom view in the toolbar. A workaround would be to use a borderless (Custom / No Border) NSBox instead of a custom

Re: Foundation vs Core Foundation

2010-11-29 Thread Nick Zitzmann
On Nov 29, 2010, at 2:18 PM, Jon Sigman wrote: It sounds like Foundation is the safer way to go, especially to safeguard future functionality expansion. I take it Foundation does not contain Core Foundation, but at least they're not mutually exclusive? No; many of the classes in

Re: QTKit Exception

2010-11-29 Thread Mark Ritchie
Hey, On 27/Nov/2010, at 7:41 PM, Francisco Garza wrote: ... unrecognized selector sent to instance 0x119fd0 ... This makes me think that you're not talking to the object that you think you are... ;-) NSZombieEnabled has been useful when tracking down similar cases in the past. Good luck! M.

NSTableColumn Binding Question

2010-11-29 Thread Peter Zegelin
Hi All, I have successfully bound most of the columns of my table to the contents of an arraycontroller but I have one column that needs to be treated differently. I would like the column to just display the row number of the item in the table (ie 1,2,3 etc.). Is it possible to do this by

Re: Foundation vs Core Foundation

2010-11-29 Thread Aaron Burghardt
On Nov 29, 2010, at 4:18 PM, Jon Sigman wrote: It sounds like Foundation is the safer way to go, especially to safeguard future functionality expansion. I take it Foundation does not contain Core Foundation, but at least they're not mutually exclusive? Check out AsyncSocket as an

Text colour button problem in Font Panel

2010-11-29 Thread Graham Cox
Hi, I've added some custom controls to the Font Panel using an accessory view. Some of these controls are NSColorWells. When the standard text colour button is clicked for setting text's foreground colour, it does not deactivate the color wells and vice versa - clicking a color well does not

aborting init

2010-11-29 Thread Rainer Standke
Hello, I am thinking about doing something like this: - to init a custom object, call a convenience initializer that in turn calls the designated initializer - in the convenience initializer, before the designated initializer is called, check some conditions. If that test fails return nil.

Re: How to approach to write such an app?

2010-11-29 Thread Shazron Abdullah
Use the Keychain. https://github.com/ldandersen/scifihifi-iphone/tree/master/security/ On 2010-11-28, at 8:14 PM, ico wrote: btw, how can I encrypt those login data such as login name and password in the iPhone? ___ Cocoa-dev mailing list

Re: aborting init

2010-11-29 Thread Graham Cox
On 30/11/2010, at 1:59 PM, Rainer Standke wrote: The intended behavior is not to get anything if the conditions are not met. Is this kosher? Do I have to do any kind of clean-up after doing something like that? Yes, it's OK to do this. As it's your own class, you can do what you like -

Re: aborting init

2010-11-29 Thread Wim Lewis
On 29 Nov 2010, at 6:59 PM, Rainer Standke wrote: I am thinking about doing something like this: - to init a custom object, call a convenience initializer that in turn calls the designated initializer - in the convenience initializer, before the designated initializer is called, check

Re: Draggable On/Off button

2010-11-29 Thread Max Howell
I made a pretty good one here:https://github.com/mxcl/playdar.prefpaneScreenshot:http://www.playdar.org/static/prefpane.pngThe code needs to be extracted but it's all open source.Hi,I need to create a On/Off button similar to that of Time machine's On/Off button(similar one

[MEET] CocoaHeads Mac Developer Meetings

2010-11-29 Thread Stephen Zyszkiewicz
Greetings, CocoaHeads is an international Mac programmer's group. Meetings are free and open to the public. We specialize in Cocoa, but everything Mac programming related is welcome. Australia Sydney - Thursday, December 2, 2010 18:30 Canada Ottawa/Gatineau, Ontario - Thursday, December 9,

Re: bindings via file's owner don't update

2010-11-29 Thread Mikkel Eide Eriksen
On Nov 30, 2010, at 3:18 AM, Quincey Morris wrote: On Nov 29, 2010, at 08:10, Mikkel Eide Eriksen wrote: Reading up on the documentation, I guess what I should do in my Document init is this: if (![self loadingWindowController]) [self

Re: Text colour button problem in Font Panel

2010-11-29 Thread Quincey Morris
On Nov 29, 2010, at 18:15, Graham Cox wrote: I've added some custom controls to the Font Panel using an accessory view. Some of these controls are NSColorWells. When the standard text colour button is clicked for setting text's foreground colour, it does not deactivate the color wells and

Re: bindings via file's owner don't update

2010-11-29 Thread Quincey Morris
On Nov 29, 2010, at 21:36, Mikkel Eide Eriksen wrote: I'm updating the objectCount property during readFromURL:ofType:error: - could that be it? No, that's a suitable method, but the question is whether it's running in the main thread or if the document initialization process got switched to

Reducer Sample Code

2010-11-29 Thread John Joyce
Does anybody know where to locate the Collapsible Box Plugin for the Reducer sample project? Whenever I try to open the nib file in IB (Xcode 3.x) it wants me to locate some plugin... ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do