Re: Several Questions

2009-05-30 Thread Ammar Ibrahim
But my app is a "normal" Cocoa App, it's not a daemon or an agent. On Sun, May 31, 2009 at 6:16 AM, Chris Hanson wrote: > The best way to ensure your daemon or agent is always running is to have it > run via launchd. > > Start by reading the launchd man page and the "Daemons and Agents" tech > n

Re: How to draw background image in my app window

2009-05-30 Thread M Pulis
No, the conclusion is : That _is_ the easy and straight way to do it. Subclassing is your power and friend, my friend. Once you understand what those lines actually do, you should have a different point-of-view. "Embrace the subclass, for they know what they are doing." :-) gary On May 30,

Re: Message from view to viewController

2009-05-30 Thread Pierre Berloquin
I get warning "UIViewController may not respond to '-vagTouchesBegan:' (Messages without a matching method signature will be assumed to return 'id' and accept '...' as arguments)" when I call the view controller from the sub view - (void) touchesBegan: (NSSet *)touches withEvent:(UIEvent *)event {

[Announce] A Core Data Tutorial Part 2: Polishing the Basics

2009-05-30 Thread Michael Swan
Part 2 of my tutorial is up for anyone that is interested. A Core Data Tutorial Part 2: Polishing the Basics Mike Swan ETCP Certified Entertainment Electrician http://www.michaelsswan.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please d

Re: Several Questions

2009-05-30 Thread Ken Thomases
On May 30, 2009, at 7:57 PM, Ammar Ibrahim wrote: On Sun, May 31, 2009 at 3:27 AM, Kyle Sluder wrote: On Sat, May 30, 2009 at 5:20 PM, Ammar Ibrahim > wrote: 2- Is there a way to launch applications like iTunes from cocoa without the need to use AppleScript? Look at the NSWorkspace do

Re: Showing more warnings possible in Xcode?

2009-05-30 Thread George Warner
On Sat, 30 May 2009 20:31:36 -0400, Eric Hermanson wrote: > Thanks for that list. > Regarding your choice of >GCC_WARN_UNUSED_PARAMETER = YES > How do you get around the fact that you often get warnings for > delegate methods you are forced to implement where you don't ever use > given p

Re: How to draw background image in my app window

2009-05-30 Thread cocoa learner
Ok. Let me try this.So conclusion is there is no easy and straight way to do it. Have to subclass NSView. Thanx Michael. Cocoa.learner On Sun, May 31, 2009 at 1:12 AM, Michael Vannorsdel wrote: > You'd really be better off making an NSView subclass and having it draw the > image you want in draw

Re: Showing more warnings possible in Xcode?

2009-05-30 Thread Eric Hermanson
Yes Mike, you ask a very pertinent question. First I'm looking for a source-time (not compile-time) monitor that would alert me to potential code problems as I type. Second, to get an idea of the code inspection capabilities of the Java IDE I've been using for the past 8 years, see: http

[ NSSplitview ] -setAutosaveName

2009-05-30 Thread Erg Consultant
What does setAutosaveName actually do? I assume it saves the position of the splitview to user defaults? If so, how does one retrieve that value? Erg ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

Re: Several Questions

2009-05-30 Thread Chris Hanson
The best way to ensure your daemon or agent is always running is to have it run via launchd. Start by reading the launchd man page and the "Daemons and Agents" tech note; these will give you an overview of how Mac OS X used launchd to manage these types of on-demand and always-on services.

Re: Showing more warnings possible in Xcode?

2009-05-30 Thread Michael Ash
On Sat, May 30, 2009 at 9:54 PM, Eric Hermanson wrote: > Thanks for all the input.  It would be nice if xCode not only allow an > easy-to-use configuration panel for all GCC warnings (not just some), but > also if xCode would parse source code on the fly to notify of > compiler-independent, comple

Re: Several Questions

2009-05-30 Thread Todd Heberlein
Sorry about the confusion, yes I meant it will run normally but unattended. I need to make sure it recovers from any errors. in the worst case if it crashes, I need it to launch again automatically, even if there's 1 minute or whatever delay, it's absolutely fine. So it is a GUI app that w

Re: Several Questions

2009-05-30 Thread Ammar Ibrahim
On Sun, May 31, 2009 at 4:56 AM, Kyle Sluder wrote: > Well in that case I don't understand what you mean by "no users will > be using the system." Do you mean you intend for your application to > run normally but unattended? I interpreted what you said to mean you > were writing a background da

Re: Showing more warnings possible in Xcode?

2009-05-30 Thread Kyle Sluder
On Sat, May 30, 2009 at 6:54 PM, Eric Hermanson wrote: > Thanks for all the input.  It would be nice if xCode not only allow an > easy-to-use configuration panel for all GCC warnings (not just some), but > also if xCode would parse source code on the fly to notify of > compiler-independent, comple

Re: Several Questions

2009-05-30 Thread Kyle Sluder
Well in that case I don't understand what you mean by "no users will be using the system." Do you mean you intend for your application to run normally but unattended? I interpreted what you said to mean you were writing a background daemon of some form. --Kyle Sluder

Re: Showing more warnings possible in Xcode?

2009-05-30 Thread Eric Hermanson
The problem I have with this GCC __attribute__(unused) thing is that it does not result in an error if you actually end up using the attribute (as I would expect it should). If it went that extra step I would find it more useful than doing just (void)param..., but since it doesn't, I guess

Re: Showing more warnings possible in Xcode?

2009-05-30 Thread Clark Cox
On Sat, May 30, 2009 at 6:38 PM, Gwynne Raskind wrote: > On May 30, 2009, at 9:11 PM, Alex Curylo wrote: >>> >>> You also have the "unused" attribute: >>> http://gcc.gnu.org/onlinedocs/gcc-3.1.1/gcc/Variable-Attributes.html >> >> That's out because I commonly have to share code with Windows compil

Re: Showing more warnings possible in Xcode?

2009-05-30 Thread Gwynne Raskind
On May 30, 2009, at 9:11 PM, Alex Curylo wrote: You also have the "unused" attribute: http://gcc.gnu.org/onlinedocs/gcc-3.1.1/gcc/Variable-Attributes.html That's out because I commonly have to share code with Windows compilers. ... although much less commonly now that I'm about 80% focused on

Re: Several Questions

2009-05-30 Thread Ammar Ibrahim
On Sun, May 31, 2009 at 4:02 AM, Kyle Sluder wrote: > If you're not writing an application that connects to the > WindowServer, you can't do things like AppleScript or controlling > other apps. You should read TN2083, "Daemons and Agents": > http://developer.apple.com/technotes/tn2005/tn2083.htm

Re: Showing more warnings possible in Xcode?

2009-05-30 Thread Alex Curylo
On 30-May-09, at 6:04 PM, Kyle Sluder wrote: You also have the "unused" attribute: http://gcc.gnu.org/onlinedocs/gcc-3.1.1/gcc/Variable-Attributes.html --Kyle Sluder That's out because I commonly have to share code with Windows compilers. ... although much less commonly now that I'm about 8

Re: Showing more warnings possible in Xcode?

2009-05-30 Thread Kyle Sluder
You also have the "unused" attribute: http://gcc.gnu.org/onlinedocs/gcc-3.1.1/gcc/Variable-Attributes.html --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact

Re: Several Questions

2009-05-30 Thread Kyle Sluder
If you're not writing an application that connects to the WindowServer, you can't do things like AppleScript or controlling other apps. You should read TN2083, "Daemons and Agents": http://developer.apple.com/technotes/tn2005/tn2083.html --Kyle Sluder _

Re: Several Questions

2009-05-30 Thread Ammar Ibrahim
On Sun, May 31, 2009 at 3:27 AM, Kyle Sluder wrote: > On Sat, May 30, 2009 at 5:20 PM, Ammar Ibrahim > wrote: > > 1- How do you ensure only one instance of your app is running? How do you > > detect if it stops responding? Can you restart it using something like a > > watchdog? And how would you

Re: Showing more warnings possible in Xcode?

2009-05-30 Thread Alex Curylo
On 30-May-09, at 5:31 PM, Eric Hermanson wrote: Thanks for that list. Regarding your choice of GCC_WARN_UNUSED_PARAMETER = YES How do you get around the fact that you often get warnings for delegate methods you are forced to implement where you don't ever use given parameter(s)?

Re: Showing more warnings possible in Xcode?

2009-05-30 Thread Eric Hermanson
Thanks for that list. Regarding your choice of GCC_WARN_UNUSED_PARAMETER = YES How do you get around the fact that you often get warnings for delegate methods you are forced to implement where you don't ever use given parameter(s)? Do you use a "#pragma GCC diagnostic ignored ..."

Re: Several Questions

2009-05-30 Thread Kyle Sluder
On Sat, May 30, 2009 at 5:20 PM, Ammar Ibrahim wrote: > 1- How do you ensure only one instance of your app is running? How do you > detect if it stops responding? Can you restart it using something like a > watchdog? And how would you go about implementing it? The system already does this for you

Several Questions

2009-05-30 Thread Ammar Ibrahim
Hello everyone, I'm writing an App, and I have the following list of questions, of which I couldn't find any satisfying answers elsewhere. 1- How do you ensure only one instance of your app is running? How do you detect if it stops responding? Can you restart it using something like a watchdog? An

Re: [ NSKeyedArchiver ] archiveRootObject:toFile: hoses my directory's permissions

2009-05-30 Thread Greg Guerin
Erg Consultant wrote: BOOLflushed = NO; What purpose does this variable serve? pathUtils = [ [ mypathUtils alloc ] init ]; Post the code for this class's alloc and init. registryFileFullPath = [ pathUtils registryFileFullPath ]; Post the code for th

Re: [ NSKeyedArchiver ] archiveRootObject:toFile: hoses my directory's permissions

2009-05-30 Thread Erg Consultant
- (void)flushRegistry { BOOLflushed = NO; NSString*registryFileFullPath = nil; mypathUtils*pathUtils = nil; if( gReg ) { // Make path utils... pathUtils = [ [ mypathUtils alloc ] init ]; if( pathUtils ) {

Re: How to activate Find and Replace for Textview?

2009-05-30 Thread Kyle Sluder
On Sat, May 30, 2009 at 10:41 AM, archana udupa wrote: >  i tried it, But i m not able to get itCan u just help me wot 2 do > exactly(with the code). Members of this list do not exist to write your code for you. You haven't posted one line of code, yet you've thrown your hands up in the air

Re: Showing more warnings possible in Xcode?

2009-05-30 Thread George Warner
On Sat, 30 May 2009 13:22:08 +1000, Graham Cox wrote: > On 30/05/2009, at 1:13 PM, Eric Hermanson wrote: > Is there a way to tune xCode so that it warns you of these types of > potential problems (and more)? The Java development environment > I've been using for the past several years (Jetbra

Cocoa Bindings and Dependent Keys question

2009-05-30 Thread Kelvin Chung
I seem to have a very simple question, but the answer is eluding me for some odd reason, but here goes: Suppose I have two NSArrayControllers, ac1 and ac2. Suppose now that I have a third controller ac3, whose content array is dependent on both ac1.selection and ac2.selection (or some keypat

Re: Message from view to viewController

2009-05-30 Thread WT
On May 30, 2009, at 5:43 PM, Pierre Berloquin wrote: Declaring in .h -(void)vagTouchesBegan:(id)sender; was my first impulse. But that's not enough. It's not clear from your two posts which method you're getting a warning for. I thought it was for the -vagTouchesBegan method, but you clai

Re: How to draw background image in my app window

2009-05-30 Thread Michael Vannorsdel
You'd really be better off making an NSView subclass and having it draw the image you want in drawRect:. - (void)awakeFromNib { myImage = [[NSImage alloc] init [self setNeedsDisplay:YES]; } - (void)drawRect:(NSRect)rect { NSSize isize = [myImage size]; [myImage dr

Re: How to draw background image in my app window

2009-05-30 Thread cocoa learner
Yah Andy and Michael you all were right. But still I have some problem.1>. While resizing the window Image is not getting resized. 2>. My controls (NSButton and NSTextField) are not visible after the awakeFromNib call. Here is modified code - - (void) awakeFromNib { if (appWindow == NULL) { N

Re: Modeling "Smart Playlists"

2009-05-30 Thread Dave DeLong
Here's how I'm doing it in an app I'm writing: I have an abstract entity called AbstractGroup, which has a string attribute called "name", a number attribute called "weight", and a method stub that returns an NSSet * called "items". AbstractGroup has two subclasses: AbstractSmartGroup and Gr

Re: Showing more warnings possible in Xcode?

2009-05-30 Thread Alex Curylo
On 30-May-09, at 8:14 AM, cocoa-dev-requ...@lists.apple.com wrote: Is there a way to tune xCode so that it warns you of these types of potential problems (and more)? Here's what I've got in my standard base .xcconfig right now. // C Only Warnings TW_GENERAL_OTHER_CFLAGS = -Wdiv-by-zero -Wbad

Re: Message from view to viewController

2009-05-30 Thread Pierre Berloquin
Declaring in .h -(void)vagTouchesBegan:(id)sender; was my first impulse. But that's not enough. About the memory problem, I suppose I should receive touchesBegan in the controller and sort out what I get ? 2009/5/30 WT > On May 30, 2009, at 4:40 PM, Pierre Berloquin wrote: > > [theViewControl

Re: How to draw background image in my app window

2009-05-30 Thread Michael Vannorsdel
You're creating an NSImage and pretending it's an NSImageView which it's not. You'll need to create a new NSImageView and then the NSImage and set the image as the imageview's image. On May 30, 2009, at 8:27 AM, cocoa learner wrote: Thanx Nick for your reply.But in my window I am not getti

Re: Message from view to viewController

2009-05-30 Thread WT
On May 30, 2009, at 4:40 PM, Pierre Berloquin wrote: [theViewController vagTouchesBegan:self]; QED There's still a warning that the view controller may not respond. But it works seamlessly. Can I get rid of the warning? Yes, by declaring the method -vagTouchesBegan: in the header file of

Re: How to draw background image in my app window

2009-05-30 Thread Andy Lee
I suspect appWindow is nil, which you can check with one more NSLog: NSLog(@"appWindow is %@", appWindow); Your init method is being called before the nib file has completely loaded, so not all the connections have been made yet. Try adding an awakeFromNib method and moving your code th

[SOLVED} Help needed with setting autoresizing masks

2009-05-30 Thread WT
It turns out that everything works as is if the table view has the "plain" style, rather than the "grouped" style. So, the problem is really that I didn't account for the fact that a grouped cell will be horizontally shrunk if the custom cell in the nib file has the full screen width. Thi

Re: Message from view to viewController

2009-05-30 Thread Pierre Berloquin
I kept working on it and reached THE solution with the help of a fellow programmer, Nicolas :I treat the controller as an object and define UIViewController *theViewController; with a regular setViewController function The viewController sends its identity to the view through that function when it

Re: How to draw background image in my app window

2009-05-30 Thread cocoa learner
Thanx Nick for your reply.But in my window I am not getting the image I want to display. Here is my code - - (id) init { [super init]; NSLog(@"AppController::init : Setting the windows content"); NSBundle *myBundle = [NSBundle mainBundle]; if (myBundle == NULL) { NSLog(@"AppController::init

Modeling "Smart Playlists"

2009-05-30 Thread Ulai Beekam
How would you model "smart playlists" (like in iTunes) with Core Data? If you have a Song entity, it is fairly obvious how you model a "regular playlist". The RegularPlaylist entity would simply have a to-many relationship to the Song entity, being a simple collection of songs that the user ad

Re: [ NS KeyedArchiver ] archiveRootObject:toFile: hoses my directory's permissions

2009-05-30 Thread Jim Correia
On Sat, May 30, 2009 at 1:39 AM, Erg Consultant wrote: > Why does archiveRootObject:toFile: change the permissions on the parent > directory? I didn't ask it to. This dir has to be writable for all users - > the way I installed it - not by only the current user. > > How can I avoid having the per

Re: Showing more warnings possible in Xcode?

2009-05-30 Thread Michael Ash
On Fri, May 29, 2009 at 11:37 PM, Gwynne Raskind wrote: > In short, you can't get this warning in a Debug-style build unless you want > to sabotage your debugging efforts by adding optimization. Your best workaround for this is probably to use the Clang static analyzer instead. It's not quite as

Re: Question about NSFileHandle class

2009-05-30 Thread Andrew Farmer
On 30 May 2009, at 00:14, Graham Cox wrote: On 30/05/2009, at 5:09 PM, Adil Saleem wrote: Does the class NSFileHandle implements endianness checks or is it the responsibility of the programmer? I am using its method - (NSData *)readDataOfLength:(NSUInteger)length I want to read binary data f

Re: Question about NSFileHandle class

2009-05-30 Thread Graham Cox
On 30/05/2009, at 5:09 PM, Adil Saleem wrote: Does the class NSFileHandle implements endianness checks or is it the responsibility of the programmer? I am using its method - (NSData *)readDataOfLength:(NSUInteger)length I want to read binary data from files and i want it to be same every

Question about NSFileHandle class

2009-05-30 Thread Adil Saleem
Hi, Does the class NSFileHandle implements endianness checks or is it the responsibility of the programmer? I am using its method  - (NSData *)readDataOfLength:(NSUInteger)length I want to read binary data from files and i want it to be same every time in my application (no endianness issues)  w