Re: newbie question (SOLVED)

2011-03-18 Thread Luca Ciciriello
Sorry for this question. I've find out how to solve my problem in apple documentation. At my first reading I'd missed it. Luca. On Mar 18, 2011, at 4:17 PM, Luca Ciciriello wrote: > Hi All. Im' new in Cocoa and Cocoa touch programming. > My question is: How can I make the keyboard disappear whe

Re: Newbie Question re: callback signatures

2010-06-04 Thread Quincey Morris
On Jun 4, 2010, at 13:03, Brad Stone wrote: > How do I create the callback method? I don't understand what the signature > is telling me. I have > canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo: in my > NSDocument and I want to set up the callback method. When I create a method

Re: newbie question - number of lines a text string wraps to

2010-04-20 Thread Jens Alfke
On Apr 19, 2010, at 11:55 AM, Paul J. Ascenzo wrote: > I'm looking to find out how many lines a given string of text will wrap to in > a given NSTextField. in other words, once I know the string and the size of > the field it is going into, how do I find out how many lines the system will > wr

Re: newbie question -views and MCV model

2010-01-15 Thread Alexander Spohr
Am 15.01.2010 um 05:57 schrieb Martin Beroiz: > My problem is with the controller. I subclassed NSViewController (with the > name FilterBankViewController) and tried to bind the class with the file's > owner. But I noticed that in IB I cannot do that, actually the bind tab says > it's "Not App

Re: Newbie question - core data

2009-09-14 Thread Stamenkovic Florijan
Darren, On Sep 14, 2009, at 09:11, Darren Wheatley wrote: Hi, I'm learning Cocoa / Objective-C. Right now I'm trying to build a simple Core Data application. I've built a helper app to read in CSV and populate an XML core data store. That works fine. I have seen lots of examples of bin

[SOLVED] Re: Newbie question on listing out detailed items

2009-05-23 Thread Stamenkovic Florijan
Graham, Jason, Thanks for your replies. What I want: a listout of items, each of which presents info and a number of controls. Typical example: Safari's downloads window. ... Any pointers to documentation on how to deal with this would be very appreciated. Perhaps I am simply using the wr

Re: Newbie question on listing out detailed items

2009-05-22 Thread Jason Foreman
On May 22, 2009, at 5:33 PM, Stamenkovic Florijan wrote: What I want: a listout of items, each of which presents info and a number of controls. Typical example: Safari's downloads window. ... Any pointers to documentation on how to deal with this would be very appreciated. Perhaps I am si

Re: Newbie question on listing out detailed items

2009-05-22 Thread Graham Cox
On 23/05/2009, at 8:33 AM, Stamenkovic Florijan wrote: NSTableView does not seem to be of much help. It accepts an NSCell as means of rendering, but if I understand it correctly, an NSCell can't contain subviews nor subcells, and is therefore of little use. Any pointers to documentation on

Re: Newbie question about non-document-based app

2009-05-04 Thread Graham Cox
On 05/05/2009, at 8:36 AM, Chris Goedde wrote: Hi, I have a simple question about my non-document-based app. It's a computer simulation of a physical system, and I've implemented file saving and loading to save the state of the system. Works great except for one thing. If I double-click

Re: newbie question on creating .png files

2009-02-13 Thread Steven Spencer
To get a NSBitmapImageRep from a NSImage, have a look at the Reducer sample code at location : http://developer.apple.com/samplecode/Reducer/listing16.html file : ImageReducer.m routine : BitmapImageRepFromNSImage at the end of the file. - Steve > > >On 12.02.2009, at 17:14, Jean-Daniel Dup

Re: newbie question on creating .png files

2009-02-12 Thread David Duncan
On Feb 12, 2009, at 8:28 AM, Felix Franz wrote: You can create a new NSBitmapImageRep using the TIFFRepresentation and use representationUsingType:properties: to get the PNG-data: NSData* TIFFData = [img TIFFRepresentation]; NSBitmapImageRep* bitmapImageRep = [NSBitmapImageRep imag

Re: newbie question on creating .png files

2009-02-12 Thread Felix Franz
On 12.02.2009, at 17:14, Jean-Daniel Dupas wrote: Unfortunately, I don't think you can save an NSImage as a PNG (it only supports the TIFFRepresentation method). You can create a new NSBitmapImageRep using the TIFFRepresentation and use representationUsingType:properties: to get the P

Re: newbie question on creating .png files

2009-02-12 Thread Jean-Daniel Dupas
Le 12 févr. 09 à 16:31, Smith, Steven (MCP) a écrit : Hi folks, I'm relatively new to Cocoa and need some direction on creating .png files. I need to create 365 png files (one for each day of the year) to be used as tags by other folks (eg "JAN01.png" "JAN2.png"..."DEC31.png"). I think

Re: Newbie Question: implementing a stack

2008-12-20 Thread Michael Ash
On Sat, Dec 20, 2008 at 6:52 PM, Steve Wetzel wrote: > I do see your point Graham but what I am trying to understand is how to work > with the stack if I don't copy the object to put on it. If I simply push > the pointer on the stack, it seems that I have to make a lot of objects in > the code th

Re: Newbie Question: implementing a stack

2008-12-20 Thread Graham Cox
On 21 Dec 2008, at 10:52 am, Steve Wetzel wrote: I guess can simply assign the pointer, but if I do, it seems to me I will need an NSMutableArray to hold myObj1... myObj10 (or more). If I do that, what benefit is the stack? I don't really follow your argument. Presumably you decided you

Re: Newbie Question: implementing a stack

2008-12-20 Thread Steve Wetzel
On Dec 20, 2008, at Dec 20:12:08 AM, Graham Cox wrote: On 20 Dec 2008, at 4:52 pm, Graham Cox wrote: On 20 Dec 2008, at 3:15 pm, Steve Wetzel wrote: Regarding memory management - does it make more sense to copy the object to be pushed from within the Stack object rather then copying it

Re: Newbie Question: implementing a stack

2008-12-20 Thread Dave DeLong
Sorry to jump in to this a little late, but a guy in our CocoaHeads group wrote a framework as part of his Master's thesis work. It's a datastructure framework and contains a bunch of datastructures not available (publicly) in Cocoa, such as stacks, queues, dequeues, avl/ rb/aa-trees, treap

Re: Newbie Question: implementing a stack

2008-12-19 Thread Graham Cox
On 20 Dec 2008, at 4:52 pm, Graham Cox wrote: On 20 Dec 2008, at 3:15 pm, Steve Wetzel wrote: Regarding memory management - does it make more sense to copy the object to be pushed from within the Stack object rather then copying it externally before the push call? I am thinking that it

Re: Newbie Question: implementing a stack

2008-12-19 Thread Graham Cox
On 20 Dec 2008, at 3:15 pm, Steve Wetzel wrote: Regarding memory management - does it make more sense to copy the object to be pushed from within the Stack object rather then copying it externally before the push call? I am thinking that it does because then that object is encapsulated wh

Re: Newbie Question: implementing a stack

2008-12-19 Thread Steve Wetzel
On Dec 19, 2008, at Dec 19:6:31 PM, Ricky Sharp wrote: On Dec 19, 2008, at 1:22 PM, Steve Wetzel wrote: I am new to this list and new to mac programming as well. I am working on implementing a stack as a category of NSMutableArray. I want this stack to be able to store objects. This is

Re: Newbie Question: implementing a stack

2008-12-19 Thread Ricky Sharp
On Dec 19, 2008, at 1:22 PM, Steve Wetzel wrote: I am new to this list and new to mac programming as well. I am working on implementing a stack as a category of NSMutableArray. I want this stack to be able to store objects. This is what I have so far: // // Stack.h // Stack implemen

Re: Newbie question: Object as input arguments

2008-11-26 Thread
- -- 3.5 BAYES_99 BODY: Bayesian spam probability is 99 to 100% [score: 1.] De: Ken Thomases <[EMAIL PROTECTED]> Fecha: 27 de noviembre de 2008 01:57:03 GMT+01:00 Para: "Jose A.

Re: Newbie question: Object as input arguments

2008-11-26 Thread Ken Thomases
On Nov 25, 2008, at 2:14 AM, Jose A. Guerrero-Colón wrote: Imagine that we have a cocoa application, "App_A" which create an object with information introduced by the user (the object is rather ellaborated and complex). At the very last point of this application, I would like to pass that o

Re: newbie question: tangential compiler errors

2008-10-15 Thread JB
I unchecked "Precompile Prefix Header" in the new target's build settings (per Chris's comments) and it compiles without error now. Thanks! JB On Mon, Oct 13, 2008 at 8:07 PM, Chris Hanson <[EMAIL PROTECTED]> wrote: > On Oct 13, 2008, at 12:42 PM, JB wrote: > > I've added Apple's sample LoginIt

Re: newbie question: tangential compiler errors

2008-10-13 Thread Chris Hanson
On Oct 13, 2008, at 12:42 PM, JB wrote: I've added Apple's sample LoginItemsAE class to autolaunch an app I've built for Tiger and Leopard. However, the app fails to compile when I add "LoginItemsAE.c" to the app target, throwing over 3000 "syntax" and "conflicting types" errors here: AppKit

Re: newbie question: tangential compiler errors

2008-10-13 Thread Michael Ash
On Mon, Oct 13, 2008 at 3:42 PM, JB <[EMAIL PROTECTED]> wrote: > Hi all, > > I've added Apple's sample LoginItemsAE class to autolaunch an app I've built > for Tiger and Leopard. However, the app fails to compile when I add > "LoginItemsAE.c" to the app target, throwing over 3000 "syntax" and > "c

Re: Newbie question: What does "no-op" mean?

2008-09-01 Thread Andy Lee
On Aug 30, 2008, at 10:31 PM, Jon Davis wrote: So do no-ops exist solely for the sake of being there for convention, i.e. "do this if you're implemented, ignore if not"? I'd adjust two things about your wording. First, a no-op method *is* implemented. It has an implementation that happens

Re: Newbie question: What does "no-op" mean?

2008-09-01 Thread Dale Jensen
On Aug 30, 2008, at 9:31 PM, Jon Davis wrote: So do no-ops exist solely for the sake of being there for convention, i.e. "do this if you're implemented, ignore if not"? In this case, that's what it's being used for. Initially (back when we coded in assembly language,) NOP was most often u

Re: Newbie question: What does "no-op" mean?

2008-08-30 Thread Jon Davis
So do no-ops exist solely for the sake of being there for convention, i.e. "do this if you're implemented, ignore if not"? Jon On Aug 30, 2008, at 7:13 PM, Steven Noyes wrote: No operation. This is used to indicate a method or instruction that performs nothing. Steven On Aug 30, 2008,

Re: Newbie question: What does "no-op" mean?

2008-08-30 Thread Steven Noyes
No operation. This is used to indicate a method or instruction that performs nothing. Steven On Aug 30, 2008, at 7:59 PM, Jon Davis wrote: See subject; I'm just discovering Cocoa and documentation such as that surrounding NSAutoReleasePool's release function is described as "a no-op". Wh

Re: Newbie question re Xcode on Leopard

2008-08-21 Thread Kiel Gillard
Hi Paul, Hope you're enjoying Cocoa ;-) As you probably noticed, the Classes tab has been removed in Interface Builder 3 (the Leopard Interface Builder). The projects header files are automagically synced with the xib. To instansiate your custom class; 1) Drag an Object (plain blue cube) from the

Re: Newbie Question on "self"

2008-08-11 Thread Charles Steinman
--- On Mon, 8/11/08, Scott Ribe <[EMAIL PROTECTED]> wrote: > > Using dot-syntax calls getters and setters. You would > get exactly the same > > behavior by calling self.myString = anotherString. > > That assumes Objective-C 2. The code in question was using properties with synthesized accessors.

Re: Newbie Question on "self"

2008-08-11 Thread Scott Ribe
> Using dot-syntax calls getters and setters. You would get exactly the same > behavior by calling self.myString = anotherString. That assumes Objective-C 2. -- Scott Ribe [EMAIL PROTECTED] http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-

Re: Newbie Question on "self"

2008-08-11 Thread Charles Steinman
--- On Mon, 8/11/08, Todd Heberlein <[EMAIL PROTECTED]> wrote: > Well, you don't need the "self" prefix, but > you may want to look at > using "setters" and "getters". It would > look like this > > @interface MyThingy : NSObject { > ... > NSString* myString; > ... > }; >

Re: Newbie Question on "self"

2008-08-11 Thread Gregory Weston
Matt Keyes wrote: Hello again, In C/C++ and the .NET languages I am used to, I have generally tried to prefix any member variables inside class methods with "this" i.e. this.m_sMyString = "this is my string"; In Objective-C, this doesn't seem as clear to me (or at least it doesn't compil

Re: Newbie Question on "self"

2008-08-11 Thread Todd Heberlein
- (id)initWithString:(NSString *) string { self.myString = [[NSString alloc] initWithString:string]; } Well, you don't need the "self" prefix, but you may want to look at using "setters" and "getters". It would look like this @interface MyThingy : NSObject { ... NSString*

RE: Newbie Question on "self"

2008-08-11 Thread Matt Keyes
Thanks y'all... in all the Obj-C examples I've read, I've never seen the -> operator used. I should have thought to check! (since in C++ it would be this->whatever). Thanks again, Matt > Date: Mon, 11 Aug 2008 11:05:55 -0700 > Subject: Re: Newbie Question on &quo

Re: Newbie Question on "self"

2008-08-11 Thread Matt Neuburg
On Mon, 11 Aug 2008 17:47:59 +, Matt Keyes <[EMAIL PROTECTED]> said: >Hello again, > >In C/C++ and the .NET languages I am used to, I have generally tried to prefix any member variables inside class methods with "this" > >i.e. this.m_sMyString = "this is my string"; > >In Objective-C, this does

Re: Newbie Question on "self"

2008-08-11 Thread Jonathan Hess
On Aug 11, 2008, at 10:47 AM, Matt Keyes wrote: Hello again, In C/C++ and the .NET languages I am used to, I have generally tried to prefix any member variables inside class methods with "this" i.e. this.m_sMyString = "this is my string"; In Objective-C, this doesn't seem as clear to me (

Re: Newbie Question on "self"

2008-08-11 Thread I. Savant
> In Objective-C, this doesn't seem as clear to me (or at least it doesn't > compile). For example: > > - (id)initWithString:(NSString *) string { >self.myString = [[NSString alloc] initWithString:string]; > } > > Produces an error: > > error: request for member 'myString' in something not a

Re: newbie question: NSURLConnection delegation and "method instance"

2008-07-20 Thread Dmitri Goutnik
On Jul 20, 2008, at 11:43 PM, JB Ashton wrote: Hi all, I'm struggling with "receivedData is declared as a method instance elsewhere" in this explanation of NSURLConnection delegation: http://developer.apple.com/documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html Wh

Re: newbie question: NSURLConnection delegation and "method instance"

2008-07-20 Thread Scott Anguish
receivedData should be an instance variable of the class that contains the code in Listing 1 - Creating a connection using NSURLConnection. often an instance of that class is also used as the delegate (which is what this example code is assuming) the code for these snippets really needs to

RE: Newbie question: Timers

2008-07-01 Thread Matthew Youney
Thanks, I will have to investigate further about how exactly to implement this. Again, thanks for your help, Matt -Original Message- From: Daniel Richman [mailto:[EMAIL PROTECTED] Sent: Monday, June 30, 2008 5:46 PM To: Matthew Youney Cc: Cocoa Subject: Re: Newbie question: Timers Use

Re: Newbie question: Timers

2008-06-30 Thread j o a r
On Jun 30, 2008, at 2:36 PM, Matthew Youney wrote: In the VS environment, there is a “timer” control that can be dropped onto a form, and will generate timer events every X milliseconds. How would I impliment similar functionality in Cocoa, or what would you gurus suggest that I look int

Re: Newbie question: Timers

2008-06-30 Thread Daniel Richman
Use this: NSTimer *myTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 // number of seconds as double target:self // targer selector:@selector(checkTimer:) // selector to call (parameter is the timer) userInfo:nil // I don't use any user info repeats:YES]; // whether the timer repeats or is o

Re: Newbie question: error in creating a NSData object using handle (Resource Management)

2008-06-27 Thread Kai
On 27.6.2008, at 05:00, Tran Kim Bach wrote: Wow, thanks Ken a lot. About the endian issues, I have a compatible swap function to convert data to Big-endian (and vice verse). Then, I will correct big-endian issues. I may know where the problem is. When I read to your suggestion, On Fri, Jun

Re: Newbie question: error in creating a NSData object using handle (Resource Management)

2008-06-26 Thread Graham Cox
Just an aside that may or may not be relevant. In the old days, often variable-length resources and other OS types would have a struct defined for them that used a fixed field size to represent some variable length field in the real resource, for example: typedef struct { short count;

Re: Newbie question: error in creating a NSData object using handle (Resource Management)

2008-06-26 Thread Tran Kim Bach
Wow, thanks Ken a lot.About the endian issues, I have a compatible swap function to convert data to Big-endian (and vice verse). Then, I will correct big-endian issues. I may know where the problem is. When I read to your suggestion, On Fri, Jun 27, 2008 at 6:11 AM, Ken Thomases <[EMAIL PROTECTED]

Re: Newbie question: error in creating a NSData object using handle (Resource Management)

2008-06-26 Thread Ken Thomases
On Jun 25, 2008, at 9:49 PM, Tran Kim Bach wrote: On Wed, Jun 25, 2008 at 3:36 PM, Ken Thomases <[EMAIL PROTECTED]> wrote Also, in the pseudo-code you provide, the NSData objects will accumulate in the autorelease pool until some point after your "for" loop. You can try using an autorel

Re: Newbie question: error in creating a NSData object using handle (Resource Management)

2008-06-26 Thread Tran Kim Bach
> > > if((type2 =='PREC')&&([resID intValue]== 302)) > There is a typo in the above code line:It should be: if((resType1 =='PREC')&&([resID intValue]== 302)) > Regards, Bachtk ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post

Re: Newbie question: error in creating a NSData object using handle (Resource Management)

2008-06-25 Thread Tran Kim Bach
Thanks everybody for your kind helps. I'm so happy that all of you welcome me warmly here. On Wed, Jun 25, 2008 at 3:36 PM, Ken Thomases <[EMAIL PROTECTED]> wrote > > > Also, in the pseudo-code you provide, the NSData objects will accumulate in > the autorelease pool until some point after your "fo

Re: Newbie question: error in creating a NSData object using handle(Resource Management)

2008-06-25 Thread Jens Alfke
Handle dataHandle = Get1IndResource( type1, n); I hope you checked that dataHandle!=NULL and *dataHandle!=NULL. struct A_STRUCT aStruct; memcpy(& aStruct,[data bytes], [data length]); This is dangerous — if [data length] is larger than sizeof(aStruct), you've just clobbered yo

RE: Newbie question: error in creating a NSData object using handle(Resource Management)

2008-06-25 Thread Gary L. Wade
1. Have you set the resource file you're iterating over as the current resource file (UseResFile)? Make sure you save off the current resource file (CurResFile) before you do that so you can reset it once you close it. The Resource Manager is not good at keeping track of state in the way you m

Re: Newbie question: error in creating a NSData object using handle (Resource Management)

2008-06-25 Thread I. Savant
> PS: In case you have more questions about old-style resource access, > you'd better take them to Apples Carbon list. People there are > probably more understanding about the need to use time proven but no > longer fancy APIs. ;-) Not that you're bitter, though ... ;-) -- I.S.

Re: Newbie question: error in creating a NSData object using handle (Resource Management)

2008-06-25 Thread Kai
On 25.6.2008, at 10:42, Tran Kim Bach wrote: Thanks Ken and Kai for your very very quick responses This is my first post in the list, I'm sorry for not clarifying my problem. Actually, the program stopped at the mentioned line. In console, it said something like: objc[2144]: FREED(id): mess

Re: Newbie question: instantiate a class in its header file OR in IB

2008-06-25 Thread Jens Alfke
On 25 Jun '08, at 7:01 AM, JArod Wen wrote: So if I have initialization method in the class, I need not to instantiate it explicitly in code, correct? IB will create the instant using the initialization method. Is this correct? You don't need a custom -init method for an object in a nib. I

Re: Newbie question: error in creating a NSData object using handle (Resource Management)

2008-06-25 Thread Andrew Farmer
On 25 Jun 08, at 06:43, Hamish Allan wrote: Someone who knows more about these things than I do may be able to point you in the direction of a more modern way of accessing resources :) There is, in fact, no "more modern way" of accessing resources. The preferred alternative is to use indivi

Re: Newbie question: instantiate a class in its header file OR in IB

2008-06-25 Thread JArod Wen
First of all, thanks for kind reply! Nope. All this does is define a variable - it doesn't allocate an instance. That'd have to happen in +initialize or something. So if I have initialization method in the class, I need not to instantiate it explicitly in code, correct? IB will create the i

Re: Newbie question: error in creating a NSData object using handle (Resource Management)

2008-06-25 Thread Hamish Allan
On Wed, Jun 25, 2008 at 2:08 PM, Kyle Sluder <[EMAIL PROTECTED]> wrote: > On Wed, Jun 25, 2008 at 4:42 AM, Tran Kim Bach <[EMAIL PROTECTED]> wrote: > >> But I checked the exe file and it's absolutely there(in the bundle). > > What is this "exe file" nonsense? I don't have any files with the > ext

Re: Newbie question: error in creating a NSData object using handle (Resource Management)

2008-06-25 Thread Kyle Sluder
On Wed, Jun 25, 2008 at 4:42 AM, Tran Kim Bach <[EMAIL PROTECTED]> wrote: > Actually, the program stopped at the mentioned line. > In console, it said something like: > > *objc[2144]: FREED(id): message release sent to freed object=0x17d1d0* > > This GDB was configured as "i386-apple-darwin" > (Err

Re: Newbie question: error in creating a NSData object using handle (Resource Management)

2008-06-25 Thread Tran Kim Bach
Thanks Ken and Kai for your very very quick responsesThis is my first post in the list, I'm sorry for not clarifying my problem. Actually, the program stopped at the mentioned line. In console, it said something like: *objc[2144]: FREED(id): message release sent to freed object=0x17d1d0* This GD

Re: Newbie question: error in creating a NSData object using handle (Resource Management)

2008-06-24 Thread Ken Thomases
On Jun 25, 2008, at 1:19 AM, Tran Kim Bach wrote: Hi folks,I'm a newbie to Cocoa. Recently, I'm working on a project relating to Resource Management. In my project, there's a part that I'm reading through the resources in a resource file. I'm using: int count = CountResources( typeName ); to

Re: Newbie question: error in creating a NSData object using handle (Resource Management)

2008-06-24 Thread Kai
Hi, "I GOT AN ERROR HERE" may be a little too unspecific. Perhaps you can elaborate: crash, exception, nil return, Console entry, what else? That said, you should use GetHandleSize (dataHandle) instead of GetResourceSizeOnDisk(dataHandle). GetResourceSizeOnDisk() can return values which a

Re: Newbie question: instantiate a class in its header file OR in IB

2008-06-24 Thread Jens Alfke
On 24 Jun '08, at 8:34 PM, JArod Wen wrote: I am a cocoa newbie from Java. Recently I found an example code in which the instance of a class is defined in its own class's header file, as following: @interface AppController : NSObject { // Instance variables here } AppController *app

Re: Newbie question: instantiate a class in its header file OR in IB

2008-06-24 Thread Andrew Farmer
On 24 Jun 08, at 20:34, JArod Wen wrote: I am a cocoa newbie from Java. Recently I found an example code in which the instance of a class is defined in its own class's header file, as following: @interface AppController : NSObject { // Instance variables here } App

Re: Newbie Question on a method signature

2008-06-04 Thread Hamish Allan
On Wed, Jun 4, 2008 at 9:38 PM, James Cicenia <[EMAIL PROTECTED]> wrote: > What the heck is wrong with my declaration? It's for a method called returnUIForFont:, not returnUIColorForFont:. Take a few minutes to try to work out what's wrong before asking the list. Finding your own mistakes is an

Re: Newbie Question on a method signature

2008-06-04 Thread James Cicenia
OK - When I put the method ahead of the call it compiled and work. So I decided to declare it in my header as: - (UIColor *) returnUIForFont: (NSString *) theString; Now the compiler complains: /Users/jcicenia/Documents/iPhone/TOSPhone/ProjectViewController.m:142: warning: incomplete impleme

Re: Newbie Question on a method signature

2008-06-04 Thread Shawn Erickson
On Wed, Jun 4, 2008 at 1:26 PM, James Cicenia <[EMAIL PROTECTED]> wrote: > Wow.. > > I didn't know the order of methods was important. They aren't really. It is just a matter of the compiler seeing the declaration for a method/function before it is used. You normally do that by declaring the meth

Re: Newbie Question on a method signature

2008-06-04 Thread Michael Vannorsdel
If the method is defined above the place you use it, you can avoid compiler warnings. But the most common and more correct thing to do is declare the method in the header with the rest of your class so anyone that imports that header will know the specifics of that method (and the compiler

Re: Newbie Question on a method signature

2008-06-04 Thread Michael Watson
It's not the method order, it's declaration vs definition. The compiler scans the file top to bottom, so you must declare a method's prototype before you actually use it anywhere, otherwise the compiler will give you a warning because it hasn't seen the protoype yet. -- m-s On 04 Jun, 200

Re: Newbie Question on a method signature

2008-06-04 Thread Bill Bumgarner
On Jun 4, 2008, at 1:26 PM, James Cicenia wrote: I didn't know the order of methods was important. Objective-C is C + a set of syntactic extensions that yields an object model. As such, you need to follow the rules of C and ensure that things are declared prior to use. b.bum __

Re: Newbie Question on a method signature

2008-06-04 Thread Andrew Merenbach
Hi, James, I'd say, though, that the order of methods isn't actually important, as long as you've declared them in your @interface context -- generally in your header file. Hope this helps. :) Cheers, Andrew On Jun 4, 2008, at 1:26 PM, James Cicenia wrote: Wow.. I didn't know t

Re: Newbie Question on a method signature

2008-06-04 Thread James Cicenia
Wow.. I didn't know the order of methods was important. thanks James On Jun 4, 2008, at 3:20 PM, Hamish Allan wrote: On Wed, Jun 4, 2008 at 9:14 PM, James Cicenia <[EMAIL PROTECTED]> wrote: why does it tell me: warning: (Messages without a matching method signature will be assumed to

Re: Newbie Question on a method signature

2008-06-04 Thread Michael Vannorsdel
You have to make sure your header has - (UIColor *) returnUIColorForFont:(NSString *) theString in it so when you use the method in other source files the compiler will know what the arguments and return types to returnUIColorForFont: are. Without this the compiler has to make assumptions

Re: Newbie Question on a method signature

2008-06-04 Thread Bill Bumgarner
Class names changed to not perpetuate NDA violation... On Jun 4, 2008, at 1:14 PM, James Cicenia wrote: I have the following: ((ProjectListCell *)cell).budgetHealth.textColor = [self returnNSColorForFont:s]; And here is my method: - (NSColor *) returnNSColorForFont:(NSString *) theString{

Re: Newbie Question on a method signature

2008-06-04 Thread Hamish Allan
On Wed, Jun 4, 2008 at 9:14 PM, James Cicenia <[EMAIL PROTECTED]> wrote: > why does it tell me: > > warning: (Messages without a matching method signature will be assumed to > return 'id' and accept... I'm guessing your method's definition comes after the code that uses that method, and you have

Re: newbie question: menu item appears when app runs, but is not visible in NIB

2008-05-30 Thread Gary L. Wade
If you did that with the version of your NIB that was showing the extra menu item when running your application that you did not see in the Interface Builder edit mode, then things are really weird, unless, of course, you have some code that added that menu item, but that's not something one do

Re: Re: newbie question: menu item appears when app runs, but is not visible in NIB

2008-05-29 Thread Paul Archibald
I am really a total newbie (3 or 4 days) with IB, so I have NO confidence that I can tell what is a bug yet. I barely understand what I am doing as yet. However, I should have done the "IB run mode" thing. I did not think of that. I just looked at it and it looks correct (no extra item). Go

Re: newbie question: menu item appears when app runs, but is not visible in NIB

2008-05-29 Thread I. Savant
Paul Archibald wrote: When I run the app, I see a menu item that is not visible in the NIB file. I recognize the extra item, I built it. However, I had some problems with the NIB, so I reverted to an older copy of the NIB, and started modifying that. I thought I had gotten rid of the old

Re: newbie question: menu item appears when app runs, but is not visible in NIB

2008-05-29 Thread Bill Bumgarner
On May 29, 2008, at 3:47 PM, Gary L. Wade wrote: Interface Builder can be buggy at times, leaving some "leftovers" around when they should be gotten rid of. I've got a couple of leftovers myself, but they're harmless so far; one of these days, I'll just go all down-and-dirty editing on it,

Re: newbie question: menu item appears when app runs, but is not visible in NIB

2008-05-29 Thread Gary L. Wade
Interface Builder can be buggy at times, leaving some "leftovers" around when they should be gotten rid of. I've got a couple of leftovers myself, but they're harmless so far; one of these days, I'll just go all down-and-dirty editing on it, but I don't have the time right now. If you've stil

Re: newbie question: menu item appears when app runs, but is not visible in NIB

2008-05-29 Thread Paul Archibald
Yes, I did that. No dice. At this point I am doing better. Since I have just barely begun, I just made a new branch of the codebase and started over (in the nib, the source code I copied and pasted into the new branch). So, now the menu looks okay. I still don't understand what was going

Re: newbie question: menu item appears when app runs, but is not visible in NIB

2008-05-29 Thread Jean-Daniel Dupas
Le 29 mai 08 à 20:25, Paul Archibald a écrit : Comrades, -- Newbie Alert -- This is my first posting to this list, and has to do with my first foray into Cocoa + ObjC + Interface Builder. I am trying to understand the relationships between resource elements in the NIB and the ObjC code t

Re: Newbie question about Database

2008-05-20 Thread Jens Alfke
On 20 May '08, at 6:29 PM, Mathieu Spénard-Gingras wrote: I was also wondering if storing data to a database is a good design pattern for Cocoa, since Apple provides something I haven't had time to look at yet: Core Data. I am simply developing a small project that will run locally on my

Re: Newbie question about Database

2008-05-20 Thread Andrew Farmer
On 20 May 08, at 18:29, Mathieu Spénard-Gingras wrote: I am learning Cocoa and would like to develop an application that can connect to a database, such as MySQL. However, I cannot find any tutorial, nor drivers in order to connect to a MySQL database, in such a way JDBC works with Java. H

Re: Newbie question about Database

2008-05-20 Thread Nick Zitzmann
On May 20, 2008, at 7:29 PM, Mathieu Spénard-Gingras wrote: I am learning Cocoa and would like to develop an application that can connect to a database, such as MySQL. However, I cannot find any tutorial, nor drivers in order to connect to a MySQL database, in such a way JDBC works with J

Re: Newbie Question re Allocation & Initialization

2008-05-19 Thread Nick Zitzmann
On May 19, 2008, at 7:07 PM, Brad Gibbs wrote: It all makes perfect sense, I just didn't know that not alloc'ing and init'ing was a fully legit move. Well, you do need to set the pointer to point to something, or else accessing it will in the best case raise an exception, and in the wor

Re: Newbie Question re Allocation & Initialization

2008-05-19 Thread Brad Gibbs
Thanks to all who replied. It all makes perfect sense, I just didn't know that not alloc'ing and init'ing was a fully legit move. I will add Masters of the Void to the already tall stack of reading material. On May 19, 2008, at 6:03 PM, Jack Repenning wrote: On May 19, 2008, at 5:18 PM,

Re: Newbie Question re Allocation & Initialization

2008-05-19 Thread Jack Repenning
On May 19, 2008, at 5:18 PM, Brad Gibbs wrote: Is it because numberToPrint is simply pointing to newNumber objects in the array that have already been allocated and initialized? Yes, both newNumber and numberToPrint are merely pointers to some object. These objects are created in the first

Re: Newbie Question re Allocation & Initialization

2008-05-19 Thread Simon Wolf
On 20 May 2008, at 01:18, Brad Gibbs wrote: On pages 36-7 of Aaron Hillegass' new book, he provides sample code for a Foundation Tool called Lottery. The code is below: NSMutableArray *array; array = [[NSMutableArray alloc] init]; int i; for (i = 0; i < 10; i++) {

Re: Newbie Question re Allocation & Initialization

2008-05-19 Thread Frank McGeough
The first loop is allocating an object an initializing it with the value of the loop variable (i) multiplied by 3. The second loop is just assigning a pointer to that allocated object. It could have also been written : for (i = 0 i < 10; i++) { NSLog(@"The number at index %d is %@", i,

Re: Newbie Question re Allocation & Initialization

2008-05-19 Thread Nick Zitzmann
On May 19, 2008, at 6:18 PM, Brad Gibbs wrote: It compiled and ran as expected, too. But, when I tried to eliminate allocation and initialization for newNumber in the first 'for loop', the app threw an exception. I don't see an explanation in the book re why numberToPrint can be, but doe

Re: Newbie Question: Controls not redrawing on changes

2008-05-04 Thread Christopher Kempke
Bah, yes, I missed Michael Ash's correct answer at the end of yesterday's digest.Setting the window backing store to "buffered" fixed the control drawing and even a coupe of other interface issues I hadn't realized were related. Thanks to everyone for your help. --Christopher Kempke __

Re: Newbie Question: Controls not redrawing on changes

2008-05-04 Thread Kyle Sluder
On Sun, May 4, 2008 at 6:47 PM, Adam Leonard <[EMAIL PROTECTED]> wrote: > Just change backing:NSBackingStoreRetained to NSBackingStoreBuffered and > see if that works. You're also displaying your window before NSApplication starts pumping the runloop. Perhaps you should consider making a delegat

Re: Newbie Question: Controls not redrawing on changes

2008-05-04 Thread Adam Leonard
Hi, Did you see Michael Ash's message? That certainly seems like the problem to me. Just change backing:NSBackingStoreRetained to NSBackingStoreBuffered and see if that works. Adam Leonard On May 4, 2008, at 3:23 PM, Christopher Kempke wrote: Thanks to those folks who have tried (unsuccessf

Re: Newbie Question: Controls not redrawing on changes

2008-05-04 Thread Christopher Kempke
Thanks to those folks who have tried (unsuccessfully) to help me. My first post clearly contained too many magenta mackerels, so I've done what I should have started with and reduced it to a shorter example. Given the following complete, nibless, and astoundingly uninteresting app: #impo

Re: Newbie Question: Controls not redrawing on changes

2008-05-04 Thread Mike Abdullah
Are you sure you're running the event loop correctly? It sounds to me that Cocoa is not getting a chance to do its usual behaviour of calling -displayIfNeeded at the end of the event loop. What if you manually call that method yourself? Mike. On 4 May 2008, at 10:19, Christopher Kempke wro

Re: Newbie Question: Controls not redrawing on changes

2008-05-04 Thread Christopher Kempke
Yes, it appears that I want an NSPanel instead of an NSWindow for my modal dialogs, but I think the modality is a red herring here: I just tried adding the same checkbox and button controls to a floating window and a document window: they don't visibly update based on mouse clicks there, e

Re: Newbie Question: Controls not redrawing on changes

2008-05-03 Thread Kyle Sluder
On Sat, May 3, 2008 at 7:08 PM, Christopher Kempke <[EMAIL PROTECTED]> wrote: > Thanks for the tip, but no go. It actually makes the behavior worse: now > the modal dialog is still drawn, but never becomes active (the title bar > never gets dark, and the previously visible (document) window never

Re: Newbie Question: Controls not redrawing on changes

2008-05-03 Thread Christopher Kempke
Thanks for the tip, but no go. It actually makes the behavior worse: now the modal dialog is still drawn, but never becomes active (the title bar never gets dark, and the previously visible (document) window never deactivates, although the dialog is drawn on top), and the default button do

  1   2   >