Re: Apple MVC and Document Based application confusion.

2009-11-29 Thread Jason Stephenson
Sandro Noël wrote: Hello. I'm reading COCOA Design Patterns from Eric M. Buck Donald A. Yacktman. and i'm having a hard time applying the principle in my architecture. for example, if i create a new document based application in XCode, the MyDocument xib file binds the window outlet to the

Re: Apple MVC and Document Based application confusion.

2009-11-29 Thread Jason Stephenson
Graham Cox wrote: On 30/11/2009, at 12:04 PM, Jason Stephenson wrote: NSDocument and the document-based architecture in Cocoa is a bad example of MVC. As a statement that doesn't really stand up to scrutiny. Sure, you can abuse NSDocument and violate MVC, but as it comes it does

Re: avoiding spagetti code

2009-11-09 Thread Jason Stephenson
Oftenwrong Soong wrote: Hi all, In the MVC style, I want to avoid connecting directly between a view and a model. However I have a custom NSView subclass that renders a graphical view of the model and therefore it needs information from the model. I think it is considered bad practice to put

Re: microsoft file formats in cocoa

2009-05-17 Thread Jason Stephenson
Alexander Cohen wrote: Does anyone know of any libraries that can read microsoft formats ( xls, ppt, doc, etc, ... )? I'd rther not reinent the wheel if something is already out there. You could look at the source code for OpenOffice.org. It does a pretty good job of handling MS Office

Re: Calling delegates explicitly

2009-05-16 Thread Jason Stephenson
Uli Kusterer wrote: On 16.05.2009, at 19:28, Bill Bumgarner wrote: On May 16, 2009, at 10:21 AM, Sourabh Sahu wrote: Can we call delegates explicitly, Please reply soon. Yes. But it is a bad idea. What exactly was the question, and why is it a bad idea? I'm unable to follow the

Re: Calling delegates explicitly

2009-05-16 Thread Jason Stephenson
:. Thanks, E. On May 16, 2009, at 4:27 PM, Jason Stephenson ja...@sigio.com wrote: Uli Kusterer wrote: On 16.05.2009, at 19:28, Bill Bumgarner wrote: On May 16, 2009, at 10:21 AM, Sourabh Sahu wrote: Can we call delegates explicitly, Please reply soon. Yes. But it is a bad idea

unrecognized selector sent to instance

2009-04-15 Thread Jason Stephenson
Hello, all. I am stumped by the error message in the subject of this email. I have spent several hours looking over my code, googling the list archives, etc. Typically, it seems that the error in question occurs at runtime when someone has a memory management issue in their application, and

Re: unrecognized selector sent to instance

2009-04-15 Thread Jason Stephenson
Thanks, Bill. I did read the documentation, and in the very documents you point out it says: To create a subclass of NSOutputStream you may have to implement initializers for the type of stream data supported and suitably reimplement existing initializers. You must also provide complete

Re: unrecognized selector sent to instance

2009-04-15 Thread Jason Stephenson
Thanks to Bill and BJ. Don't I feel silly. I have a new implementation of the output stream class that works. (See attachement.) Now, I have five other NSInputStream/NSOutputStream subclasses to modify and test. Y'know, when I first started coding these classes the other day, I heard a

Re: unrecognized selector sent to instance

2009-04-15 Thread Jason Stephenson
Bill Bumgarner wrote: On Apr 15, 2009, at 8:12 AM, BJ Homer wrote: Seems to be concrete to me. Nevertheless, calling it on super does throw an exception; you might just try calling [super init] and see what happens. // NSOutputStream is an abstract class representing the base functionality

Re: Memory allocation pattern related question

2009-03-29 Thread Jason Stephenson
Daniel Luis dos Santos wrote: Hello, I have a shared library and some client code. In the shared library I am adopting the following method signature pattern : - (int) someMethod: (aType*)someInParam anotherParam: (aType**)someOutParam; I use the return value to indicate success or

Re: Cocoa Client/Server App

2009-01-07 Thread Jason Stephenson
Try the following in Google: site:developer.apple.com tcp client server The first result should be a link to the TCP Server sample application. Your three questions are really far too general to be answered in a mailing list. You need to find some introductory material on network programming

Re: Cocoa Client/Server App

2009-01-07 Thread Jason Stephenson
of asking for help online is learning to help yourself. (Please don't take that personally. It is a general rule for everyone.) Cheers, Jason Thanks, Ammar On Wed, Jan 7, 2009 at 1:58 PM, Jason Stephenson ja...@sigio.com mailto:ja...@sigio.com wrote: Try the following in Google

Re: Wow - what happened to IB

2008-12-11 Thread Jason Stephenson
Ian H Stewart wrote: I created a new project in xcode, I then got into IB and created my layout - buttons, text fields, etc. connected them all together with actions and defined my outlets, then tried to get the details back into xcode and found out you can no longer sync from IB to xcode, but

Re: Starting Cocoa apps from the command line

2008-12-11 Thread Jason Stephenson
Shayne Wissler wrote: I've got an application that isn't specifically for the Mac, and I want the same standard user-experience whether they are on the Mac or on Windows or on Linux. I want them to be able to run this program from the command line by directly using the binary (without calling

Re: Starting Cocoa apps from the command line

2008-12-10 Thread Jason Stephenson
Andrew Farmer wrote: I'm not sure, but I can tell you that mplayer does what you're talking about and works fine. You may want to take a look at how they do it. OpenOffice.org, too. It builds an app bundle, etc., using command line tools. It may not be a good place to start, though. It is

Re: Monitor Magic packet(wake on lan packet )

2008-12-08 Thread Jason Stephenson
sheen mac wrote: In my app,I want to monitor the magic packet . Where I will get more info about this. Could give some link for this?.I found a command tcpdump, Could I use this for wol packet monitoring?. As Andrew Farmer pointed out, you don't typically monitor for the magic packet, since

Re: [Reposted] Document based resource strategy

2008-11-25 Thread Jason Stephenson
Gerriet M. Denkmann wrote: What version of Xcode do you have installed? I have 3.1.1 and Safari just says: No file exists at the address

Re: Autorelease Question

2008-11-21 Thread Jason Stephenson
Luke Hiesterman wrote: So thinking gets in the way of understanding and not thinking is the path to enlightenment? Yes, Grasshopper. You must stop thinking about the rules. You must stop thinking about the code. You must stop thinking about the computer. You must instead *become* the rules,

Re: Porting from Windows to Mac

2008-11-01 Thread Jason Stephenson
Rakesh Singhal wrote: I do not know about porting Windows code (MFC based) to Mac OS. The existing code is written in C++. As suggested that it is possible then how to do it? Do I need to change the existing code (Windows code) very much. I have not used Qt before this. Does Qt support the MFC?

Re: Persistent Connection to Web Server in cocoa, emulating AJAX

2008-10-23 Thread Jason Stephenson
Jack Carbaugh wrote: What is the best way to emulate, with cocoa, an AJAX persistent connection to a web server. There is no persistent connection to a web server. HTTP does not preserve state between discrete requests. This is why cookies were invented and session variables stored on the

Re: Persistent Connection to Web Server in cocoa, emulating AJAX

2008-10-23 Thread Jason Stephenson
Jack Carbaugh wrote: the process is as follows ... a request/command is sent to a URL which processes the request. The result is then sent out of a responder at another URL. So what i'm wanting to do, i suppose, is to continually poll the responder URL and process it's results.

Re: @property and HeaderDoc

2008-10-22 Thread Jason Stephenson
Jerry Krinock wrote: If anyone has written any Xcode user scripts for inserting Doxygen templates, to replace those useless HeaderDoc Insert templates, let me know. You might want to look at this: http://brianray.chipy.org/doxygen/ (Although it does not appear to be working at the

Re: Mutable arrays

2008-10-20 Thread Jason Stephenson
DKJ wrote: Since mutable arrays and dictionaries expand as required when new objects are added, when should one use -initWithCapacity: methods? I have used it when my program can figure out roughly how many items will be in the mutable object to begin with. Say my program is pulling some

Re: Help for a beginner..

2008-10-04 Thread Jason Stephenson
Rob Keniger wrote: On 04/10/2008, at 9:46 AM, mmalc crawford wrote: Start with Programming in Objective-C by Stephen Kochan (depending on how quickly you want to get underway, you may consider waiting for the second edition):

Re: Cocoa Programming for Mac OsX Third Edition eBook search

2008-10-04 Thread Jason Stephenson
Jamie Daniel wrote: Anyone know where I can get the above book in eBook ? If you have a Safari account (http://safari.oreilly.com/) and enough download tokens, you could download each chapter as a PDF. Other than that, I don't know how you could get a Mac-compatible copy of the book.

Re: Opening an external file in a external application

2008-08-12 Thread Jason Stephenson
has wrote: ... and don't forget stuff like OpenOffice which contain full-blown spreadsheet engines and Excel file importers/exporters. I'll make a plug for OpenOffice.org here. The 3.0 release for Mac OS X is going to be completely Aqua native with the interface done in Cocoa. This work is

Re: KBML Generator/Parser

2008-08-06 Thread Jason Stephenson
Apparao Mulpuri wrote: Sorry, mentioned incorrect url for KBML. Working url for KBML is: http://koala.ilog.fr/kbml/. I was just about to point that out to you. I found the above also by googling kbml. Any pointers on this would greatly help. My question is, what are you trying to do

Re: Hillegass, Third Edition, Chapter 18

2008-07-15 Thread Jason Stephenson
Tommy Nordgren wrote: ... Don't even think about storing the NSRects in an NSArray. NSRect is a struct -- not a class Instead store NSBezierPath instances, or create an oval class. If you're feeling ambitious, you'd make your own class to hold the oval information, such as its NSRect,

Re: looking for some help

2008-07-11 Thread Jason Stephenson
Gary Robertson wrote: I'm very new to programming the mac looking for some help also #1 I want to make the about my app window larger I cant seem to figure out where to do this I'm fairly new myself, and can't really help you with #2, though I.S. gave you a good pointer in another

Re: Does this caution need fixed? (newb)

2008-07-03 Thread Jason Stephenson
Chris Paveglio wrote: My code is like this: NSMutableString *theSettings; theSettings = [[NSMutableString alloc] init]; //myPrefs is an array of strings, each item is like Library/Safari int i; for (i = 0; i 8; i++ { theSettings = [NSHomeDirectory()

Re: Does this caution need fixed? (newb)

2008-07-03 Thread Jason Stephenson
Chris Paveglio wrote: Thanks all for your help and insight! I believe Jason's solution will work for me as I am changing the assignment of what theSetting is each time through the loop. I have a list (array) of files that gets copied from one place to the other, and I change the origin and the

NSFormatter/NSControl and valid object notification

2008-06-22 Thread Jason Stephenson
I am writing a Cocoa application as a GUI for a command line utility, and I decided to create a custom NSFormatter to ensure that the value entered in a NSTextField matches what the command line program expects for that parameter. (The format is actually rather complicated since it will accept

Re: NSPanel should not close on command-W

2008-06-21 Thread Jason Stephenson
Georg Seifert wrote: I cannot reproduce this. If I close all documents in Textedit (or any other Mac-App) the font panel stays there and I get a NSBeep on hitting command-w. According to what I read in the docs and what I've experienced in my own applications, panels don't respond to

Static Functions and Variables

2008-06-15 Thread Jason Stephenson
My question is: Does it make a difference if I put static functions and variables inside or outside of my Class' @interface? I tend to treat them like C functions and variables and place them at the top of my source (.m) file, before the @interface declaration. When it comes to static

Re: Static Functions and Variables

2008-06-15 Thread Jason Stephenson
Whoops! Had a brain fart. In my previous message where I say @interface, I meant to say @implemenation. Sorry for any confusion. Got too much going on today. I should have just stayed away from email. --Jason ___ Cocoa-dev mailing list

3rd Party Nonsense (was Re: Regular Expressions?)

2008-06-07 Thread Jason Stephenson
Ilan Volow wrote: Back in the Jaguar-era when I had to write applications that made heavy use of XML and regular expressions, Cocoa-Java saved the day--no 3rd-party nonsense required. This in not a knock on Ilan. His mail just happens to embody an attitude that I see quite frequently on

Re: Regular Expressions?

2008-06-06 Thread Jason Stephenson
Hi, You've gotten a lot of decent answers so far. As a long time UNIX programmer, I'll suggest looking into the regexp library that already comes with OS X. man regcomp on the command line to find out how to use. I've used it for years in my C applications on UNIX and UNIX-like operating

Re: Regular Expressions?

2008-06-06 Thread Jason Stephenson
dream cat7 wrote: I agree that to be able to use that syntax is highly desirable, and indeed missing from all the cocoa libraries that I have looked at. One way would be a category addition to NSString class, which would call the perl -pe 's/\b(.*?)/\u\L$1/g' for you and return the result

Re: Regular Expressions?

2008-06-06 Thread Jason Stephenson
glenn andreas wrote: [wrote about how using regex is not a good idea, particularly with NSString and unicode. Pretty much the same things that Jens wrote earlier.] Yes, that's all very true. Regex is a poor choice if you're working on non-ASCII text. I'm generally not doing so, but just

Re: Xcode - IB problems

2008-06-01 Thread Jason Stephenson
Hamish Allan wrote: On Sun, Jun 1, 2008 at 8:56 PM, Ashley Perrien [EMAIL PROTECTED] wrote: Should I create all the actions and outlets in IB and let it create the class? No. I'm not even sure that's possible in the latest version of IB. What version are you using? It is still possible,

Re: odd problem with NSMutableDictionary and initWithContentsOfFile

2008-05-29 Thread Jason Stephenson
Leslie Smith wrote: Hi: I found out what I was doing wrong: rather than [SimParamnames initWithContentsOfFile: aFile]; I should have had SimParamnames = [SimParamnames initWithContentsOfFile: aFile]; A more normal way of doing the above is NSMutableDictionary *SimParamnames;

Re: A directory site for open-source Cocoa components?

2008-05-22 Thread Jason Stephenson
Jens Alfke wrote: Anyone interested? (Or know of an existing site that I've overlooked?) I don't guess we could convince Apple to open up Mac OS Forge? In addition to the other sites listed, Source Forge http://www.sourceforge.net/ has some Mac OS X related projects on it. I would

+initialize (was Re: Trying to understand -- please help...)

2008-05-21 Thread Jason Stephenson
Vijay Malhan wrote: What exactly do you mean by initializing the *class*? what exactly is initialized with +initialize() method? When exactly this method gets called? If you are at all familiar with Java, this is the same thing as a static initializer. It sets up data required

Re: Cocoa et al as HCI usability problem

2008-05-19 Thread Jason Stephenson
Regarding the arrangement of the docs: I find it much easier to read the guides, and oftentimes also the reference documentation, from a web browser rather than in Xcode's documentation window. If I'm using Xcode, I will usually have the doc window open. However, I'll very often have the

Re: [OT] generating API docs

2008-05-19 Thread Jason Stephenson
I was going to suggest Doxygen, also, but Uli beat me to it. I will add this link, which explains how to create docsets with Doxygen: http://developer.apple.com/tools/creatingdocsetswithdoxygen.html Cheers, Jason ___ Cocoa-dev mailing list

Re: Cocoa et al as HCI usability problem

2008-05-18 Thread Jason Stephenson
Julius, You could change Apple for just about any other vendor, and Cocoa for just about another GUI/system interface, and your argument will still hold. (Have you ever tried programming X11 with just XLib C calls? Nasty stuff that) Also, please don't confuse the language, Objective-C

Re: Cocoa et al as HCI usability problem

2008-05-18 Thread Jason Stephenson
Johnny Lundy wrote: Tutorials to me are pretty much useless, as I am not looking for a step by step cookbook to just getting something working, but rather a discussion of the why. How many times have we seen a tutorial say something like control-drag from the textfield to the File's Owner

Learning Curve/Documentation Challenge/Recommendation

2008-05-17 Thread Jason Stephenson
. That is, I realize just how much more there is to learn. So, I'd recommend anyone looking to learn Cocoa, who already has programming experience in other languages/paradigms get the two books listed above. I found them most helpful. Cheers, Jason Stephenson

Re: How to send email without using email client

2008-05-09 Thread Jason Stephenson
Jens' description of the intent of the LGPL is pretty much the same as my understanding. However, another option exists. You can always contact the author of the LGPL or GPL code and request a license agreement that allows you to use their code in a closed product. Some are quite amenable to

Re: Resource Fork - is this a good use/the right thing to do?

2008-04-23 Thread Jason Stephenson
Chris Suter wrote: Furthermore, it doesn't follow the file which was the original design goal. Going back to the original question, I personally think that the best thing to do is to just create another file and educate the user. Extended attributes and resource forks are all very nice but