Re: properties attributes misunderstanding

2009-09-30 Thread Sherm Pendley
On Wed, Sep 30, 2009 at 9:02 AM, Colin Howarth wrote: > > I thought the (copy) attribute would mean that > temporaryPathPointerWhichIsSupposedToBeDifferent would be, well, a copy of > the original path instance (which conforms to the NSCopying protocol). That's not what (copy) does. The copy is m

Re: whether to use core data...

2009-10-03 Thread Sherm Pendley
On Sat, Oct 3, 2009 at 11:14 AM, Colin Howarth wrote: > > But the Core Data documentation starts like this: > > ... > Core Data is not an entry-level technology. > ... > You should not simply try to read [The Core Data Programming Guide] straight > through to understand Core Data. > ... > Do not a

Re: Keeping NSWindow below all other windows

2009-10-03 Thread Sherm Pendley
On Sat, Oct 3, 2009 at 1:32 PM, PCWiz wrote: > > On 2009-10-03, at 10:44 AM, Ron Fleckner wrote: > >> >> [myWindow setLevel:]; >> >> check the docs. > > Thanks, setting the window level to -1 worked :) Don't do that. Magic numbers are considered very poor programming:

Re: Checking whether a file is a genuine PDF file

2009-10-04 Thread Sherm Pendley
On Sun, Oct 4, 2009 at 8:07 AM, Squ Aire wrote: > > I know that, in an open dialog for example, I can view all PDF files by just > filtering using the "pdf" file extension. But that isn't good enough really, > because a file can have the pdf extension without being a true PDF file. >From /usr/s

Re: releasing an object

2009-10-10 Thread Sherm Pendley
On Sat, Oct 10, 2009 at 12:21 PM, Shawn Erickson wrote: > > Anyway the amount of code you have posted leave to much out to understand > all that may be wrong with your memory management. The code does show one common anti-pattern - calls to -retain and -release that should be hidden in an accesso

Re: real verses Virtual memory

2009-10-10 Thread Sherm Pendley
On Sat, Oct 10, 2009 at 12:53 PM, jon wrote: > > there are no files being accessed,  only the webView WebView can access files on its own. Have you disabled cacheing? sherm-- -- Cocoa programming in Perl: http://camelbones.sourceforge.net ___ Co

Re: NSDate timeIntervalSinceNow problem

2009-10-22 Thread Sherm Pendley
On Thu, Oct 22, 2009 at 11:06 PM, PCWiz wrote: > > NSDate *time = [myDict objectForKey:@"time"]; > NSLog(@"%d", [time timeIntervalSinceNow]); > > And the result is this: > > 2009-10-22 21:01:18.949 TestApplication[8263:a0f] -2097072 > > Not sure what's wrong here, I've taken a look at some example

Re: Double-clicking a screensaver

2009-10-31 Thread Sherm Pendley
On Sat, Oct 31, 2009 at 10:19 AM, Gabriel Zachmann wrote: > I think I've seen screen savers that copy themselves to > ~/Library/Screensavers by double-clicking on the .saver file (that is still > in the DMG). > > Could someone tell me how I can make my screensaver have this capability as > well?

Re: Double-clicking a screensaver

2009-10-31 Thread Sherm Pendley
On Sat, Oct 31, 2009 at 11:21 AM, Gabriel Zachmann wrote: >> The system's screen saver app registered .saver as a document type, so >> that behavior happens automagically. You don't need to do anything >> besides create a normal .saver plugin from the standard template. > > I think, I'm doing that

Re: objectAtIndex

2009-11-01 Thread Sherm Pendley
On Sun, Nov 1, 2009 at 2:44 PM, Nava Carmon wrote: > > NSObject *anObject = [anArray objectAtIndex:i]; ... > Should I release it? No. You didn't create anObject with +alloc or a method beginning with -copy, nor did you send it a -retain message. Therefore you do not own it and must not release it

Re: why use pow(x, 2)?

2009-11-02 Thread Sherm Pendley
On Mon, Nov 2, 2009 at 2:25 PM, Ed Wynne wrote: > > That said, the original question is a good one. Using x*x instead of > pow(x,2) would be quite a bit faster Are you certain of that? With loop unrolling and inlined functions, it should result in identical code being produced by the compiler. >

Re: [Q] copy operation and authorization

2009-11-12 Thread Sherm Pendley
On Thu, Nov 12, 2009 at 12:44 PM, JongAm Park wrote: > >     NSString *sourceFile = [NSString > stringWithFormat:@"%@/Desktop/test3.valm", NSHomeDirectory()]; Have you tried this? [[NSWorkspace sharedWorkspace] openFile:sourceFile]; Many apps register their plugin extensions as document typ

Re: NIB/XIB created objects, should they be released in -[dealloc]?

2009-11-23 Thread Sherm Pendley
On Mon, Nov 23, 2009 at 11:13 AM, Michael A. Crawford wrote: > I wouldn't have though so.  I would assume that since I did not allocate them > directly, I don't need to clean them up. I've just inspected some code that > declares properties that are marked as outlets and whose member variables a

ANN: CamelBones 1.1.0

2009-11-23 Thread Sherm Pendley
Now supporting Leopard and Snow Leopard, and more. Read the full announcement at: sherm-- -- Cocoa programming in Perl: http://camelbones.org ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not

Re: NSImage and NSBitmapImageRep

2010-03-16 Thread Sherm Pendley
On Wed, Mar 17, 2010 at 2:39 AM, Martin Beroiz wrote: > > So how would you guys do this? Initialize an empty NSImage using -initWithSize:, which according to its description "does not add any image representations to the image object." Then add your NSImageRep to it with -addRepresentation:. she

Re: Threads Question

2010-03-17 Thread Sherm Pendley
On Wed, Mar 17, 2010 at 10:36 AM, Philippe Sismondi wrote: > So, I want to launch the secondary task in a separate thread to keep the main > runloop responsive. NSTask only blocks the runloop if you call -waitUntilExit. So - don't do that. :-) sherm-- -- Cocoa programming in Perl: http://www

Re: NSTask dilema...

2010-03-31 Thread Sherm Pendley
On Wed, Mar 31, 2010 at 2:21 PM, Jean-Nicolas Jolivet wrote: > I have to run a bunch of NSTasks and I'm not sure to proceed considering I > want to be able to update the UI when a task is completed, and I want the > process to be as fast as possible (obviously)... > > So far I tried a couple of

Re: Introspecting the current method

2010-04-18 Thread Sherm Pendley
On Sun, Apr 18, 2010 at 8:21 PM, Graham Cox wrote: > > On 19/04/2010, at 10:14 AM, Dave DeLong wrote: > >> If I'm inside a method, is there a way to know at runtime whether that >> method is a class or an instance method?  Currently the only way I though of >> to do this is to see if "self" is a

Re: Seeking a graceful way to end a program

2010-04-29 Thread Sherm Pendley
On Thu, Apr 29, 2010 at 2:46 PM, Markus Spoettl wrote: > On Apr 29, 2010, at 2:31 PM, Paul Johnson wrote: >> I would like to have some guidance on the proper way to 'gracefully' >> terminate a program that cannot proceed, for example, when some >> critical resource can't be created or doesn't exis

Re: Synthesized ivar for std::tr1::shared_ptr?

2010-05-06 Thread Sherm Pendley
On Thu, May 6, 2010 at 2:19 AM, Barry Wark wrote: > I'm no C++ guru, so I'm hoping someone can help me by explaining why > the following gives a compiler error: I'm no guru either, but my guess would be that the interaction between synthesized ivars and C++ templates is rocky territory. I avoid g

Re: isKindOfClass:

2010-05-08 Thread Sherm Pendley
On Sat, May 8, 2010 at 3:51 PM, Kevin Callahan wrote: > isKindOfClass: is an instance method and doesn't work on a class you get from > NSClassFromString(). Because NSObject is a root class (i.e. it has no superclass), you *can* send its -isKindOfClass: message to a Class object. Instance method

Re: Regarding MVC design pattern

2010-05-19 Thread Sherm Pendley
On Wed, May 19, 2010 at 6:31 AM, Joanna Carter wrote: > Any outlets for controls (top level objects) in the Nib should be released in > the dealloc method only for OS X apps but not for iPhone apps. Setting the > properties to nil will ensure that the synthesized setter will be called, > which

Re: Crash trying to unarchive webview from IB document

2010-05-25 Thread Sherm Pendley
On Tue, May 25, 2010 at 3:10 PM, Laurent Daudelin wrote: > I was doing a little demo to a colleague this morning and built a simple app > consisting of a text field and a web view in IB. I was able to run the thing > from IB but when I tried to compile it as release and launch it, it would > cr

Re: subclass overwriting superclass ivar

2010-05-26 Thread Sherm Pendley
On Wed, May 26, 2010 at 8:13 AM, vincent habchi wrote: > Le 26 mai 2010 à 13:40, jonat...@mugginsoft.com a écrit : > >> A subclass ivar is apparently overwriting a super class ivar. >> When an instance of MGS_B sets stderrData the super class ivar tempFilePath >> gets overwritten. > > If I am not

Re: isKindofClass with NSData and NSKeyUnarchiver

2010-05-28 Thread Sherm Pendley
On Thu, May 27, 2010 at 8:25 PM, Philip Vallone wrote: > > This is a relative question, which depends on how the data is coming and > going. My question comes from the following situation. Suppose I have a > GKSession that is passing information via Bluetooth. The sender can send any > type of

Re: eval?

2010-05-31 Thread Sherm Pendley
On Mon, May 31, 2010 at 1:11 PM, Louis-Philippe wrote: > Correct me if I am wrong, but there is no way in objective-c to do a runtime > string execution for which the responding object is not an Objective-C > class? > > like, if I have a c++ lib I would like to call from within an Objective-c > cl

Re: Sanity Check

2010-07-08 Thread Sherm Pendley
On Thu, Jul 8, 2010 at 10:19 AM, wrote: >> his seems weird. Why assign the panel/window to your own ivar when this is >> exactly -[NSWindowController window] is designed to do for you? > > I was thinking I might need to reference it and rather than call for it just > have it hanging around. Yes,

Re: modal loops & memory

2010-07-16 Thread Sherm Pendley
On Fri, Jul 16, 2010 at 1:10 PM, Scott Ribe wrote: > Does [NSApp runModalForWindow: ...] wrap an autorelease pool around its event > handling? Yes, autorelease pools work normally during a modal session. sherm-- -- Cocoa programming in Perl: http://www.camelbones.org _

Re: Link Error: following -F not found

2010-07-17 Thread Sherm Pendley
On Sat, Jul 17, 2010 at 1:45 PM, Joseph Ayers wrote: > > ld: warning: directory > '/Users/lobster/Programming/Roboplasm/../../../core-plot/framework/build/Debug' > following -F not found > > I can't find a reference to core-plot anywhere in the code. It's not coming from your code, it's a linke

Re: NSInteger compare - Help Needed

2010-07-18 Thread Sherm Pendley
On Sun, Jul 18, 2010 at 1:21 PM, Steve Wetzel wrote: > Thanks guys, that was the problem,  There are so many little things to learn > with Objective C. Out of curiosity, what programming language are you comparing it to? I've used *many* of them over the past twenty years, and I can't think of a

Re: NSDocument Question

2011-02-07 Thread Sherm Pendley
On Mon, Feb 7, 2011 at 2:54 PM, Bruce Cresanta wrote: > Ii have two subclasses of NSDocument. One of the subclasses only ever needs > one instance window. How do I query NSWindowController for the open window, > and if that fails, create it. Sorry for the confusion. Override -makeWindowCo

Re: NSDocument without Save

2011-02-08 Thread Sherm Pendley
On Tue, Feb 8, 2011 at 9:29 PM, Graham Cox wrote: > I'm trying to prevent NSDocument from doing any saving at all, for a demo > version of my app. I need to suppress the menu commands (done) and all the > automated UI such as the 'save changes' dialog and 'Save As' dialog even > though the doc

Re: Two Newbie Questions

2011-02-16 Thread Sherm Pendley
On Wed, Feb 16, 2011 at 5:56 PM, Bruce Cresanta wrote: > > I have an NSTableView set up to a datasource of a single array.   When I run > my code, I get two columns (the default in IB) instead of just one with the > data duplicated in each column.    I only want one column, how best to > achiev

Re: NSDocument Problems

2011-02-21 Thread Sherm Pendley
On Mon, Feb 21, 2011 at 2:12 PM, Bruce Cresanta wrote: > Hello Volker, > > I have the following two methods implemented in AnalyzerDocument, but I still > get greyed menu items. > > - (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError > > - (BOOL)readFromData:(NSData *)data ofTy

Re: Problem opening file

2011-02-22 Thread Sherm Pendley
On Tue, Feb 22, 2011 at 10:47 AM, Carlos Eduardo Mello wrote: > > I have a configuration file which is used by an internal library in my app's > data model engine. The engine was written in c++ and needs this file for > loading the app's documents correctly. Theis file never changes and > shouldn'

Re: Mutable and immutable class cluster implementation / "method swizzling" question

2011-03-25 Thread Sherm Pendley
On Fri, Mar 25, 2011 at 1:30 AM, Louis Gerbarg wrote: > The corner case you mention below ( [myMutableArrayInstance > isKindOfClass:[NSMutableArray class]] ) is a nonissue for a somewhat > surprising reason. All instances of NSArray are actually implemented via the > concrete class NSCFArray, w

Re: doesNotRecognizeSelector exception

2011-03-26 Thread Sherm Pendley
On Sat, Mar 26, 2011 at 9:39 PM, Jeffrey Walton wrote: > > I have a protocol and declarations as follows. respondsToSeletor > returns NO. If I ignore respondsToSeletor (and send the message), I > get an expeption. > > // FilePicker.m - try both > BOOL responds = [delegate respondsToSelector:@selec

Re: doesNotRecognizeSelector exception

2011-03-26 Thread Sherm Pendley
On Sat, Mar 26, 2011 at 10:21 PM, Jeffrey Walton wrote: > > 2011-03-26 22:12:50.029 CryptoSandbox[123:707] -[UIView > userSelectedFile:fileSystemObject:suppliedContext:]: unrecognized > selector sent to instance 0x1dbd00 The delegate message is being sent to an instance of UIView - not to your co

Re: Can't keep untitled windows from opening!

2011-03-31 Thread Sherm Pendley
On Thu, Mar 31, 2011 at 12:49 PM, Carlos Eduardo Mello wrote: > Isn't the document subclass the app's delegate by default in the document > architecture? No, it isn't. The document's job is to handle per-document responsibilities; the app delegate's job is to handle tasks that are relevant for th

Re: Simulate touch event with cordinate?

2011-04-02 Thread Sherm Pendley
On Sat, Apr 2, 2011 at 7:29 AM, Jesse Armand wrote: > > But, my word of advice: > People don't read PDFs with the gestures of their face or head. It's just > silly. Tell that to Stephen Hawking. There are cases where what seems "silly" to most of us are the only options one has left. sherm-- -

Re: Book for expert programmer about cocoa and Objective-C

2011-04-02 Thread Sherm Pendley
On Fri, Apr 1, 2011 at 3:40 PM, Rodrigo Zanatta Silva wrote: > Hi. I need to have a good book in my side to program with Objective-C using > the cocoa. I read the beginner books like "... for absolute beginner", > "starting to program with...". > > But now, I need a book for professional. Book tha

Re: special characters are destroyed when copying a string character by character

2011-04-05 Thread Sherm Pendley
On Tue, Apr 5, 2011 at 11:55 AM, Horst Jäger wrote: > >                [dst appendFormat:@"%c", chr]; %c is the format specifier for 8-bit chars - use %C for 16-bit unichars. sherm-- -- Cocoa programming in Perl: http://camelbones.sourceforge.net ___

Re: Framework Installation Directory

2011-04-08 Thread Sherm Pendley
On Fri, Apr 8, 2011 at 8:53 AM, Mr. Gecko wrote: > I need help with the Installation Directory for a framework that will be > shared between a application and 2 daemons within side it. I think I may be > able to do it if I were to have the 2 daemons executables in the MacOS path > or another fo

Re: Framework Installation Directory

2011-04-08 Thread Sherm Pendley
instead of 1 if I was to place > it in Contents/Daemon/Daemon.app/Contents/MacOS/Daemon? > > Thanks for the response, > Mr. Gecko > > On Apr 8, 2011, at 8:48 AM, Sherm Pendley wrote: > >> The details will vary according to how you've structured your bundles, >>

Re: Framework Installation Directory

2011-04-08 Thread Sherm Pendley
gt; On Fri, Apr 8, 2011 at 9:57 AM, Mr. Gecko wrote: >>> So basically once I've compiled the daemon, have it run a post script that >>> will change the path to go back 4 directories instead of 1 if I was to >>> place it in Contents/Daemon/Daemon.app/Contents/MacOS/

Re: Compiling screensaver for 10.5

2011-04-08 Thread Sherm Pendley
On Fri, Apr 8, 2011 at 2:48 PM, Nick Zitzmann wrote: > > > ppc. The linker may change this to ppc7400 under certain circumstances. This > is normal, and only means that your screen saver will not load on G3 Macs. This has to do with the deployment target, right? That is, it will be changed to pp

Re: Test for TCP port

2011-04-08 Thread Sherm Pendley
On Fri, Apr 8, 2011 at 6:26 PM, Heizer, Charles wrote: > > What is the best way to test to see if a TCP port is reachable and will > answer connections? I was trying to use NSSocketPort and NSConnection but I'm > not getting a valid connection. > > NSSocketPort *sendPort = [[NSSocketPort alloc]

Re: I'm given a project.pbxproj file....

2011-05-18 Thread Sherm Pendley
Have you tried simply checking out the source tree directly from Subversion? Google Code usually allows anonymous check outs. sherm-- On Wed, May 18, 2011 at 5:45 PM, R4EE wrote: > Howard, > > That was my original approach but the .xcodeproj file wants to save as > html.  I then, wrongly, extrac

Re: Using WebKit for UI instead of Cocoa in cross-platform app

2011-05-23 Thread Sherm Pendley
On Mon, May 23, 2011 at 9:52 AM, John Joyce wrote: > > Apps that try to be somehow universal without trying to behave naturally on a > given OS usually suffer for it. Even Microsoft had to learn that lesson the hard way - google for "Word 6 fiasco." sherm-- -- Cocoa programming in Perl: http:

Re: What is the point of a host-reachability test that doesn't test the reachability of the host?

2011-06-02 Thread Sherm Pendley
On Thu, Jun 2, 2011 at 11:16 AM, Kyle Sluder wrote: > > Why does everyone insist on using roundabout ways to detect if maybe a host > will accept connections on a completely unrelated port ... when it may not even accept *those* on the next attempt. Can you say "race condition?" I knew you could

Re: tools for writing help books

2011-06-08 Thread Sherm Pendley
On Wed, Jun 8, 2011 at 3:33 AM, Michael Thon wrote: > What tools to y'all recommend for writing content for the help viewer on Mac > OS? Do you write them directly in html/xhtml? I just use BBEdit and write the markup by hand - HTML ain't exactly rocket surgery to begin with, and every tool I've

Re: ObjC stdin equivalent? and other questions

2011-06-10 Thread Sherm Pendley
On Fri, Jun 10, 2011 at 10:56 PM, William Squires wrote: > Hi! > 1st question: >  In regular C, you have the functions for reading/writing to stdio; > printf(), scanf(), etc... >  In C++, you have cin/cout and the overridden '>>' and '<<' operators. >  What does ObjC have (besides NSLog() anyway

Re: Re-using the same NIB on two owners

2011-06-26 Thread Sherm Pendley
On Sun, Jun 26, 2011 at 11:16 AM, Daniel Luis dos Santos wrote: > > My problem is that I need to load the same NIB from two different classes, so > the owner is different according to which class I load it from. > Is there another way to do it without the file's owner ? Subclassing the > control

Re: finder eject images

2011-07-05 Thread Sherm Pendley
On Tue, Jul 5, 2011 at 6:53 AM, Ulf Dunkel wrote: > Hi Lee Ann. > >> Also I think Apple frowns on copying their icons into your apps. Only the >> ones you can get through imageNamed: or iconForFileType: are fair game. > > Wasn't it Steve Jobs who invited us to pick all their nice icons, somewhen >

Re: Apache Module

2009-11-28 Thread Sherm Pendley
On Fri, Nov 27, 2009 at 6:45 PM, Mr. Gecko wrote: > Hello, I'm working to write an Apache Module that allows you to make websites > in Objective-C Been there, done that. :-) Have a look at the list archives: sherm-- -- Cocoa

Re: Apache Module

2009-11-28 Thread Sherm Pendley
On Sat, Nov 28, 2009 at 7:54 AM, Sherm Pendley wrote: > On Fri, Nov 27, 2009 at 6:45 PM, Mr. Gecko wrote: >> Hello, I'm working to write an Apache Module that allows you to make >> websites in Objective-C > > Been there, done that. :-) > > Have a lo

Re: Apache Module

2009-11-30 Thread Sherm Pendley
On Sat, Nov 28, 2009 at 1:19 PM, Mr. Gecko wrote: > Ok, I know your idea of a CGI Proxy like PHP CGI That's not what I said. Did you read the link I gave you? > On Nov 28, 2009, at 9:32 AM, Sherm Pendley wrote: > >> Keep in mind though, that I posted that nearly five years a

Re: iterating and removing objects from a collection

2009-11-30 Thread Sherm Pendley
On Mon, Nov 30, 2009 at 4:21 PM, Ken Thomases wrote: > On Nov 30, 2009, at 2:45 PM, Dennis Munsie wrote: > > Some alternatives: > > * Iterate over the array just using an index, rather than fast enumeration > (or NSEnumerator). A safe way to do that is to iterate backwards, starting at the max i

Re: problem encoding large float* matrix

2009-12-01 Thread Sherm Pendley
On Tue, Dec 1, 2009 at 1:47 PM, James Maxwell wrote: > I'm trying to save the state of my app. It chews up a lot of memory, most of > which is in large float* matrices. I'm getting an EXC_BAD_ACCESS error in > -encodeBytes:length:forKey: and I'm just wondering what might be happening. > The flo

Re: Remember Window and Inspector Positions

2009-12-21 Thread Sherm Pendley
On Mon, Dec 21, 2009 at 2:38 PM, Alexander Spohr wrote: > > Am 21.12.2009 um 20:22 schrieb David Blanton: > >> I have a main window and a few floating inspectors. I would like to come >> back to the position the user left these upon relaunch. Do I have to program >> this or is there some Cocoa o

Re: Simple question on Menus and Document-based apps

2009-12-21 Thread Sherm Pendley
2009/12/21 Henri Häkkinen : > > So I have a simple document-based application which has MyDocument with some > other classes. The application has the default MainMenu.xib and > MyDocument.xib interface files. I would like to add a menu item to the > MainMenu, which would call an IBAction method

Re: Releasing Objects

2009-12-24 Thread Sherm Pendley
On Thu, Dec 24, 2009 at 5:13 PM, Greg Parker wrote: > > More precisely, there's exactly one short-circuit check and thus only one > selector value. Under GC, @selector(retain) == @selector(release) == > @selector(autorelease) == @selector(dealloc) == @selector(retainCount). > Happily, `return s

Re: Releasing Objects

2009-12-24 Thread Sherm Pendley
On Thu, Dec 24, 2009 at 7:36 PM, Joar Wingfors wrote: > > On 24 dec 2009, at 15.16, Sherm Pendley wrote: > >> Just out of curiosity, is that really a short-circuit in the >> message-passing machinery, or are all those selectors simply >> registered to point to the same

Re: Dynamically update drawRect

2009-12-27 Thread Sherm Pendley
On Sun, Dec 27, 2009 at 4:51 AM, proger proger wrote: > So now i don't see how to solve this problem. I thought it's not very hard > problem - get data and paint it. Maybe i need to use other tools ? I think > with libSDL framework it's very simple to solve such thing. I'm wanted to > learn more a

Re: Retain Count of NSConnection object

2010-01-04 Thread Sherm Pendley
On Mon, Jan 4, 2010 at 10:34 AM, Alexander Reichstadt wrote: > I can hardly expect for this to be a Cocoa-bug but imagine I am > misunderstanding something. Can anyone help and please tell me where I am > erring here? You're expecting -retainCount to return a useful number. It doesn't. Have a l

Re: Looking up a NSString constant at runtime

2010-01-04 Thread Sherm Pendley
On Mon, Jan 4, 2010 at 4:56 PM, David Alter wrote: > Is there a way to lookup what and NString constant is at runtime? Just log it, same as any other string: NSLog(@"%@", NSDeviceResolution); sherm-- -- Cocoa programming in Perl: http://www.camelbones.org _

Re: iPhone: validate a NSString for US zipcode

2010-01-07 Thread Sherm Pendley
On Thu, Jan 7, 2010 at 11:53 AM, Eric E. Dolecki wrote: > I don't care about the city, just that the zip code will work. On an iPhone > testing against an array of 42,305 values... could that be pretty quick? > Seems like a large set to go through looking. I'm sending the value to a > webservice t

Re: ConvertCocoa64: spaces in filename problem

2010-01-11 Thread Sherm Pendley
Completely agree with the problem and your suggested alternative, but this ain't the place to file bug reports. You should file this at: sherm-- On Mon, Jan 11, 2010 at 10:56 AM, A.M. wrote: > On this page: > > http://developer.apple.com/mac/library/documentat

Re: (void *)contextInfo

2010-01-12 Thread Sherm Pendley
On Tue, Jan 12, 2010 at 2:51 PM, Rainer Standke wrote: > > Here is the code that displays the sheet: > > NSArray *theContextInfo = [[NSArray alloc] init]; This creates a new array that you are responsible for releasing when you're finished with it. >        theContextInfo = [NSArray arrayWithObj

Re: Getting filesize when downloading file with NSURLDownload?

2010-01-19 Thread Sherm Pendley
On Tue, Jan 19, 2010 at 2:13 PM, Laurent Daudelin wrote: > I'm using an NSURLDownload to download a file from a server. Is there any way > I could find what the size of the file will be so that I could put up a nice > progress indicator? Implement the -download:didReceiveResponse: method in the

Re: Allow only root/admin users to execute the cocoa app

2010-01-24 Thread Sherm Pendley
On Sun, Jan 24, 2010 at 4:19 AM, Arun wrote: > > I want to allow my cocoa app to be only launched by root/admin users. > How can i achieve this? Use Authorization Services to check for admin authority, and exit if your app doesn't have it.

Re: dynamic typing in a text field

2010-01-25 Thread Sherm Pendley
On Mon, Jan 25, 2010 at 11:16 AM, Ronald Hofmann wrote: > I want a textfield in my project which triggers a method while I´m writing in > it. > I saw this option 'continous' in the interface builder which works fine with > sliders. > While I move the slider the method executes. > > How can I do

Re: NSString category name collision?

2010-01-26 Thread Sherm Pendley
On Tue, Jan 26, 2010 at 12:28 PM, Jens Alfke wrote: > > Yes. To avoid these kinds of collisions, if you add a category method to an > external class you should add some sort of hopefully-unique prefix to its > name. CocoaDev has a list of prefixes many people are using. Since it's a wiki, you can

Re: Odd NSString behavior

2010-02-24 Thread Sherm Pendley
On Wed, Feb 24, 2010 at 2:30 PM, McLaughlin, Michael P. wrote: > This is just a minor glitch but I hate loose ends. > > I have a Cocoa app as a resource in my MainBundle.  If I try to get its > executable via the obvious > > NSString * linrgPath = [myBundle pathForResource: > @"linrg2.app/Contents

Re: Looking for info on anti-piracy and trial-mode techniques for my app . . .

2010-02-24 Thread Sherm Pendley
On Wed, Feb 24, 2010 at 4:54 PM, Michael A. Crawford wrote: > I've purchased apps from other developers on this forum, which have > mechanisms for limiting functionality until a valid registration code has > been provided.  I'd like to include this functionality in my own app but > don't want t

Re: Embedded frameworks and hard links

2010-02-24 Thread Sherm Pendley
On Wed, Feb 24, 2010 at 11:58 PM, Ashley Clark wrote: > I've been using an embedded framework in a couple of my apps for database > access. I've recently created an Automator action which also embeds this > framework, built from within the same project. This Automator action is, in > turn, then

Re: Carbon is C++?

2010-02-25 Thread Sherm Pendley
On Thu, Feb 25, 2010 at 6:42 PM, Dave Carrigan wrote: > > On Feb 25, 2010, at 3:40 PM, Chunk 1978 wrote: > >> is Apple's Carbon basically code written in C++, while Cocoa is >> written in Objective-C?  should developers avoid using frameworks >> written in C++ (like some sound frameworks)? > > > W

Re: Carbon is C++?

2010-02-25 Thread Sherm Pendley
On Thu, Feb 25, 2010 at 7:02 PM, Stephen J. Butler wrote: > > Apple has deprecated libraries/frameworks. They haven't stopped > supporting any languages though. I'm pretty sure they no longer support Pascal. ;-) sherm-- -- Cocoa programming in Perl: http://www.camelbones.org __

Re: How a window was closed?

2010-03-05 Thread Sherm Pendley
On Fri, Mar 5, 2010 at 1:44 PM, Eric Gorr wrote: > My point is not that I don't know how to fix it or cannot (as an absolute) > fix it, but that it is not practical to fix it at this time, so I need a way > to determine how the window was closed. Given that there's no reliable way to determine

Re: short question but I don't know how to describe it

2010-03-07 Thread Sherm Pendley
On Sun, Mar 7, 2010 at 7:07 PM, Marx Bievor wrote: > Hi, > I can substitute a String with %@ and an int with %d... like in return @"Hi > I am %@ and %d years old", name, age; > what is the right command to substitute a bool and a float? I cannot find > any reference at apple's docs. > does anyone

Re: Determining OS at Runtime

2009-07-01 Thread Sherm Pendley
On Wed, Jul 1, 2009 at 7:24 PM, iseecolors wrote: > I need to support 10.4 in my application, but it uses some Carbon APIs that > are deprecated in 10.5 and I am using some new 10.5 APIs that require the > 10.5 SDK. > > I am sure I have seen this before, but I have been unable to find it in the > A

Re: Cocoa Frontend to SDL App

2009-07-10 Thread Sherm Pendley
On Fri, Jul 10, 2009 at 9:58 AM, Anthony Smith wrote: > I'm wanting to integrate an already made SDL app executed through the > command line into a Cocoa app within a custom view. Does anybody have any > insight on where to start something like this? The most obvious starting point would be the Xc

Re: Initialising NSMutableArray

2009-07-13 Thread Sherm Pendley
On Mon, Jul 13, 2009 at 12:53 PM, I. Savant wrote: > On Jul 13, 2009, at 12:41 PM, Quincey Morris wrote: > >> What you *don't* get for free from subclassing is an internal storage >> mechanism -- you have to invent that for yourself (usually by putting a real >> NSArray instance variable in your su

Re: I need a milder application badge (solution)

2009-07-25 Thread Sherm Pendley
On Sat, Jul 25, 2009 at 1:54 PM, Jay Reynolds Freeman wrote: > What I want to do is modify the dock icon while the application running. >  The only interface I can find to do this is > NSApp.setApplicationIconImage: , which requires an NSImage.  I have no way > to get at the actual view being used

Re: Trouble with NSColor

2009-08-13 Thread Sherm Pendley
On Thu, Aug 13, 2009 at 1:29 PM, Daniel Furrer wrote: > On Thu, Aug 13, 2009 at 6:51 PM, Sean McBride wrote: > >> Did you read the docs for 'redComponent'? >> >> "This method works only with objects representing colors in the >> NSCalibratedRGBColorSpace or NSDeviceRGBColorSpace color space" >> >>

Re: Cleaning "garbage" in Core Data

2009-08-16 Thread Sherm Pendley
On Sun, Aug 16, 2009 at 11:22 AM, Squ Aire wrote: > > Just to make it clear: The whole userInfo dictionary will tend to NOT be > "garbage". Only a subset of key-value pairs within the userInfo dictionaries > for the employees will be "garbage". I want to get rid of this subset without > botherin

Re: Two controllers in a window, how do I get one to run a function in another?

2009-08-27 Thread Sherm Pendley
On Thu, Aug 27, 2009 at 10:04 AM, Graham Cox wrote: > > On 27/08/2009, at 11:55 PM, Support wrote: > >> I want to have two NSObjects (controllers) - one for the tableview and all >> the actions that it needs to perform, and one for the web view.  I am having >> difficulty getting the tableview cont

Re: Best way to determine what ip address are assigned to a given network interface.

2009-08-27 Thread Sherm Pendley
On Thu, Aug 27, 2009 at 10:09 AM, Mark McCray wrote: > I've seen a bunch of methods for getting a list of ip addresses that a > machine may have. But i haven't seen a Cocoa way of figuring out what > ip address is attached to a given interface.  NSHost give's you IPs > but which network interfaces

Re: Elapsed time vs sleep

2010-07-26 Thread Sherm Pendley
That depends on what you mean when you say "animation." NSTimer works fine for triggering screen updates. But if your animation is physics-based - a 3d "shooter" game, for instance - you'll want something like the aforementioned mach_absolute_time to keep the animation smooth. sherm-- On Mon, Jul

Re: NSTask

2010-07-26 Thread Sherm Pendley
On Mon, Jul 26, 2010 at 4:39 PM, wrote: > > where is rm? Ironically, that's almost exactly the shell command you'd use to find it: "whereis rm". :-) Bill's right though - NSFileManager seems like a much better way to do this. sherm-- -- Cocoa programming in Perl: http://www.camelbones.org __

Re: Screen pixels changed notification?

2010-07-26 Thread Sherm Pendley
On Mon, Jul 26, 2010 at 8:37 PM, Ryan Joseph wrote: > > Are there any notifications I could get that would tell me if screen pixels > changed I don't know of any Objective-C methods - you might have a look at the Core Graphics function CGRegisterScreenRefreshCallback(). sherm-- -- Cocoa progr

Re: Calling Matlab from Cocoa

2010-07-30 Thread Sherm Pendley
On Fri, Jul 30, 2010 at 1:00 PM, Chris Goedde wrote: > > Anyone here have any experience calling Matlab from a Cocoa program? > > I have a rather complex calculation that I've implemented in Matlab that I > would like to call from a Cocoa program. (I could re-implement it in > Objective C if abs

Re: Wow! Just installed OPENSTEP ENTERPRISE 4.2

2010-08-06 Thread Sherm Pendley
On Fri, Aug 6, 2010 at 6:21 PM, Todd Heberlein wrote: > > It took a lot longer to bring out Mac OS X than I expected after the > acquisition. We never got our "yellow box" for windows (with the promised > free runtime libraries). Have you seen Cocotron? Not from A

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Sherm Pendley
On Wed, Aug 18, 2010 at 2:52 PM, Murat Konar wrote: > > On Aug 18, 2010, at 11:06 AM, John C. Randolph wrote: > >> -stringByReplacingCharactersInString: creates and returns a new string, >> which is autoreleased. > > Always? Yes, always. > I recall running into a problem that was caused by > -st

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Sherm Pendley
On Wed, Aug 18, 2010 at 3:33 PM, Kyle Sluder wrote: > On Wed, Aug 18, 2010 at 12:16 PM, Sherm Pendley > wrote: >> Possibly, but even in that case it would still have to "return [[self >> retain] autorelease];" in order to fulfill its end of the memory >>

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Sherm Pendley
On Wed, Aug 18, 2010 at 4:22 PM, Kyle Sluder wrote: > On Wed, Aug 18, 2010 at 12:49 PM, Sherm Pendley > wrote: >> The "[foo release]" is perfectly correct, but if >> -stringByReplacingOccurrencesOfString:withString: is implemented with >> a simple "return

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Sherm Pendley
On Wed, Aug 18, 2010 at 5:23 PM, Kyle Sluder wrote: > On Wed, Aug 18, 2010 at 2:08 PM, Sherm Pendley > wrote: > >> Indeed, on that very page, at >> <http://developer.apple.com/mac/library/documentation/cocoa/conceptual/MemoryMgmt/Articles/mmAccessorMethods.html#//appl

Re: stringByReplacingCharactersInRange leading to bus error

2010-08-18 Thread Sherm Pendley
On Wed, Aug 18, 2010 at 5:25 PM, Martin Wierschin wrote: > On 2010.08.18, at 2:08 PM, Sherm Pendley wrote: > >> Implementing -stringByReplacing... as "return [[self retain] >> autorelease];" makes the same guarantee, that the object returned by >> -stringByRep

Re: Trying to capture XML data and convert to a String...

2010-08-19 Thread Sherm Pendley
On Wed, Aug 18, 2010 at 3:11 PM, R wrote: > I'm new and in the process of learning Objective-C and Cocoa. > > I want to take some raw XML data, isolate, and convert to a string.  I seem > to be able to capture the data I want, but cannot seem to get into a string > format.  Actually, I will want

Re: Set the Cursor Position

2010-08-19 Thread Sherm Pendley
On Thu, Aug 19, 2010 at 9:32 PM, Murat Konar wrote: > CGDisplayMoveCursorToPoint(CGDirectDisplayID display, CGPoint point); > > But heed the other's hints that, except for special classes of software > (like a VNC app), software that warps the pointer's location independent of > the mouse is much

  1   2   3   4   >