Re: Referencing NSData's length in a predicate?

2009-11-27 Thread Jerry Krinock
On 2009 Nov 27, at 22:03, Dave DeLong wrote: > I have a Core Data object called "Item". One of its attributes is a binary > attribute called "data". I've constructed a fetch request to retrieve all > Items based on the length of the data (ex: "data.length <= 1024"). I *know* > that I have I

Re: Global Object

2009-11-27 Thread Jens Alfke
On Nov 26, 2009, at 9:18 AM, Tom Jones wrote: > I thought I could just create a Global variable but that does not work. Did you make it a pointer? You can't directly declare instances of any Cocoa classes, only pointers to them. So MyCocoaClass gFoo; is a syntax error, while My

Re: Getting the path to an application with a launchDaemon

2009-11-27 Thread Jens Alfke
On Nov 27, 2009, at 12:08 AM, Zephyroth Akash wrote: > I'm actually creating a daemon which then runs in root context and I can't > get the path to an application. > The command: [[NSWorkspace sharedWorkspace] > absolutePathForAppBundleIdentifier:@"com.myCompany.myApp"]; returns NULL but > ret

Re: An Array of structs

2009-11-27 Thread Jens Alfke
On Nov 27, 2009, at 7:48 AM, Alastair Houghton wrote: > You *can* have non-constant elements in struct initialisers in C, *but* only > in a context where there is code that will execute at runtime. C++ eliminates most of these restrictions, btw. And you can make your code C++ simply by changin

Re: Apache Module

2009-11-27 Thread Jens Alfke
On Nov 27, 2009, at 10:34 PM, Mr. Gecko wrote: > The reason I'm posting in this list is because I'm trying to write a module > in objective-c that will work with apache and this is a list on objective-c > and I know I wouldn't get much of a reply on the apache lists. The issues involved in thi

Re: Inconsistent results from iconForFile

2009-11-27 Thread Jens Alfke
On Nov 27, 2009, at 10:31 PM, Sandy McGuffog wrote: > For some files, I get a thumbnail of the file, so e.g., for a JPEG, I get a > miniature of the actual image in the JPEG. But for other files, even in the > same directory, I get the file type icon, so e.g., for a JPEG, the OS X JPEG > icon.

Re: Apache Module

2009-11-27 Thread Mr. Gecko
The reason I'm posting in this list is because I'm trying to write a module in objective-c that will work with apache and this is a list on objective-c and I know I wouldn't get much of a reply on the apache lists. And I'm not writing a apache module just for a web application, I'm writing it so

Inconsistent results from iconForFile

2009-11-27 Thread Sandy McGuffog
Part of my code uses: [[NSWorkspace sharedWorkspace] iconForFile:path]; For some files, I get a thumbnail of the file, so e.g., for a JPEG, I get a miniature of the actual image in the JPEG. But for other files, even in the same directory, I get the file type icon, so e.g., for a JPEG, the OS X

Re: Apache Module

2009-11-27 Thread Jens Alfke
On Nov 27, 2009, at 10:11 PM, Chris Hanson wrote: > I believe Mac OS X 10.5+ includes the FastCGI Apache module and C library, > which are for just this kind of use: Maintaining a pool of CGI-style servers > that use Apache to provide an HTTP front-end without the overhead of one > fork/exec p

Re: Apache Module

2009-11-27 Thread Jens Alfke
You absolutely do not want to write an Apache module to implement a web-app! That's massive overkill, like building a machine shop in your garage instead of just going to Home Depot. If you need more performance than the basic CGI interface provides, good ways to go are either SCGI (which will

Re: Apache Module

2009-11-27 Thread Chris Hanson
On Nov 27, 2009, at 4:52 PM, Bill Bumgarner wrote: Then again, HTTP server <-> backend server is a very well explored area of technology that may offer a pre-rolled solution for you. I believe Mac OS X 10.5+ includes the FastCGI Apache module and C library, which are for just this kind of

Referencing NSData's length in a predicate?

2009-11-27 Thread Dave DeLong
Hi everyone, I have a Core Data object called "Item". One of its attributes is a binary attribute called "data". I've constructed a fetch request to retrieve all Items based on the length of the data (ex: "data.length <= 1024"). I *know* that I have Items with data less than 1KB, yet when I

How can I choose font depending upon Locale.

2009-11-27 Thread Symadept
Hi, My client has given me a custom TTF font only for English. So my intention is to load that TTF only for English and for other languages it should fallback to the available System font. I am doing the following steps: 1. Registering fonts with my app. Copying into Resources folder and add

Re: UIImageView Animation Question

2009-11-27 Thread Matt Neuburg
On Fri, 27 Nov 2009 15:53:30 -0800, David Duncan said: >On Nov 27, 2009, at 2:02 PM, Matt Neuburg wrote: > >> It's really another case of a poor choice of terminology, isn't it? (By >> "another" I am referring to my recent critique on this list of the confusing >> over-use of the term "key" throug

Re: Apache Module

2009-11-27 Thread Greg Guerin
Mr. Gecko wrote: ... and that does not solve my make my server speak things. CGI that runs /usr/bin/say? You'll want to rate-limit it, or exclusive-lock it, otherwise it can speak many things in parallel. You can try polyphony/cacaphony now with 'say ... &' in Terminal.app. -- GG _

Re: Apache Module

2009-11-27 Thread Mr. Gecko
The image is different for each and every person and I can't cache it. The disk will already be used to get the php to run which generates the page the image is on. I know this may sound like a Captcha, but it's not. I will continue to try and write this module and if it works out, then I'll be

Re: Apache Module

2009-11-27 Thread Bill Bumgarner
On Nov 27, 2009, at 5:08 PM, Mr. Gecko wrote: > My idea was to basically write a module that runs NSTask to start the cocoa > binary and just have a framework to like manage the server information and > talk to the module, by printf I guess, saying like which headers to return > and the data s

Re: Core Data and +[NSExpression expressionForFunction:...]

2009-11-27 Thread Jerry Krinock
On 2009 Nov 27, at 12:23, Ron Aldrich wrote: > but I'd very much like to understand why this isn't working. > > On Nov 25, 2009, at 11:34 PM, Alexander Spohr wrote: > >> I am not sure if that works at all. I never fetched using methods that are >> not part of the database as a qualifier. The

Re: Apache Module

2009-11-27 Thread Mr. Gecko
I know about that but for what I need it's extremely hard to do what I need and that does not solve my make my server speak things. On Nov 27, 2009, at 7:37 PM, Alexander Hartner wrote: > http://www.php.net/manual/en/image.examples-png.php > > Google is your friend. No need to reinvent the whee

Re: Apache Module

2009-11-27 Thread Alexander Hartner
http://www.php.net/manual/en/image.examples-png.php Google is your friend. No need to reinvent the wheel. Sent from my iPhone On 28 Nov 2009, at 01:08, "Mr. Gecko" wrote: My idea was to basically write a module that runs NSTask to start the cocoa binary and just have a framework to like man

Re: Apache Module

2009-11-27 Thread Mr. Gecko
My idea was to basically write a module that runs NSTask to start the cocoa binary and just have a framework to like manage the server information and talk to the module, by printf I guess, saying like which headers to return and the data so I can set the content-type to image/png if I wanted to

Re: Apache Module

2009-11-27 Thread Alexander Hartner
http://httpd.apache.org/docs/1.3/howto/cgi.html This tutorials covers creating dynamic content in c. Can't be all that different fir objective c. Sent from my iPhone On 28 Nov 2009, at 00:50, "Mr. Gecko" wrote: As I said, I couldn't find any other way to do this advanced stuff which I ha

Re: Apache Module

2009-11-27 Thread Bill Bumgarner
On Nov 27, 2009, at 4:30 PM, Mr. Gecko wrote: > Well I'm wanting to be able to write image generators and other things that > is near impossible to do in php or any other web scripting language, also > running compiled source is faster then a script. My idea is to write a module > so I can jus

Re: Apache Module

2009-11-27 Thread Mr. Gecko
As I said, I couldn't find any other way to do this advanced stuff which I have in mind, like I have an idea of a notification system that will use NSSpeechSynthesizer on my server. On Nov 27, 2009, at 6:46 PM, Alexander Hartner wrote: > Why not use standard plain old cgi to do that? > > Sent

Re: Apache Module

2009-11-27 Thread Mr. Gecko
Well I'm wanting to be able to write image generators and other things that is near impossible to do in php or any other web scripting language, also running compiled source is faster then a script. My idea is to write a module so I can just use a SDK that I will write to make different things i

Fwd: Apache Module

2009-11-27 Thread Alexander Hartner
Hi there, Why would you want such a thing. Objective C compiles to a binary which you could integrate with apache using common cgi. However these days there are much more mature frameworks available geared for the delivery of HTML and other web content. Maybe I don't understand what you a

Re: UIImageView Animation Question

2009-11-27 Thread David Duncan
On Nov 27, 2009, at 2:02 PM, Matt Neuburg wrote: > It's really another case of a poor choice of terminology, isn't it? (By > "another" I am referring to my recent critique on this list of the confusing > over-use of the term "key" throughout the animation stuff.) Here we are in a > graphics world,

Re: dynamic NSPointArray allocation

2009-11-27 Thread Graham Cox
On 28/11/2009, at 10:37 AM, Shane wrote: >> Why not just accumulate the points directly into NSBezierPath? It can be >> thought of as an array of points in a sense. Unless there's a compelling >> need to have the points themselves available in addition to the bezier path, >> just cut out the m

Apache Module

2009-11-27 Thread Mr. Gecko
Hello, I'm working to write an Apache Module that allows you to make websites in Objective-C (Foundation/Cocoa) and I need to know how I should setup my xcode project. I got the basic idea, make a custom target that builds a .so file that has apache libraries but is that it? I'm going to try and

Re: dynamic NSPointArray allocation

2009-11-27 Thread Shane
> Why not just accumulate the points directly into NSBezierPath? It can be > thought of as an array of points in a sense. Unless there's a compelling need > to have the points themselves available in addition to the bezier path, just > cut out the middle man (and it's not difficult to retrieve t

Re: dynamic NSPointArray allocation

2009-11-27 Thread Graham Cox
On 28/11/2009, at 7:46 AM, Shane wrote: > I don't know how large my NSPointArray size needs to be so I'd like to > know how I would dynamically allocate NSPoints to populate an > NSPointArray? I think I can do it with NSMutableArray, but > NSBezierPath takes an NSPointArray (which is what my end

Re: dynamic NSPointArray allocation

2009-11-27 Thread Shane
> > The easiest way (and Objective-C-ish way) is to use a NSMutableData object > with the NSPointArray as its data. Whenever you want to add points, just > resize the NSMutableData object to 'sizeof (NSPoint)' * total number of > points, and use '(NSPointArray) [data mutableBytes]' as a pointer

Re: UIImageView Animation Question

2009-11-27 Thread Matt Neuburg
On Thu, 26 Nov 2009 22:27:39 -0800, David Duncan said: >The context parameter for beginAnimations:context: is just meant as a token for you to use should you use the callbacks that let you know about the progress of the animation. The value is completely arbitrary It's really another case of a po

Re: dynamic NSPointArray allocation

2009-11-27 Thread Quincey Morris
On Nov 27, 2009, at 12:46, Shane wrote: > I don't know how large my NSPointArray size needs to be so I'd like to > know how I would dynamically allocate NSPoints to populate an > NSPointArray? I think I can do it with NSMutableArray, but > NSBezierPath takes an NSPointArray (which is what my end r

dynamic NSPointArray allocation

2009-11-27 Thread Shane
I don't know how large my NSPointArray size needs to be so I'd like to know how I would dynamically allocate NSPoints to populate an NSPointArray? I think I can do it with NSMutableArray, but NSBezierPath takes an NSPointArray (which is what my end result is for the points) and it just seems cleane

Re: My try/catch block isn't catching exceptions on 10.6

2009-11-27 Thread Scott Ribe
If one thread reads imminentList while another is modifying it, you can crash. There are instants during the modification where it will be in an internally inconsistent state. -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice _

Re: My try/catch block isn't catching exceptions on 10.6

2009-11-27 Thread Andrew Farmer
On 27 Nov 2009, at 11:40, Mark Allan wrote: > Isn't it the case that you only need locks around something if you plan that > it will be modified by more than one thread at a time, or if you write to it > in another thread and care that any read operation will be predictable? No, that is not the

Re: Core Data and +[NSExpression expressionForFunction:...]

2009-11-27 Thread Ron Aldrich
Atze, The documentation for expressionForFunction: makes a point of stating: > This expression effectively allows your application to invoke any method on > any object it can navigate to at runtime. You must consider the security > implications of this type of evaluation. Which would indicate

Re: NSOutlineView - how to have a default item selected

2009-11-27 Thread Boyd Collier
Dave, Itai Ferber also suggested this fix, and previously I had tried it to no avail. However, the problem turned out to be where I put these lines (and a couple of others) in my code. After much fiddling, I finally got things right! Thanks for taking time to post the suggestion. Boy

Re: My try/catch block isn't catching exceptions on 10.6

2009-11-27 Thread Mark Allan
On 27 Nov 2009, at 1:10 am, Dave Keck wrote: Exception Type: EXC_BAD_ACCESS (SIGBUS) After a cursory reading of your code it looks like you're dealing with a threading issue involving myItemList or imminentList. Your comment mentions "We don't really care if imminentList changes because the d

Re: Conversion of CFSocketCreateWithNative -> NSSocketPort

2009-11-27 Thread Andrew Farmer
On 27 Nov 2009, at 06:48, Michael Ash wrote: > There's no Cocoa version of this, as far as I know. However, > CFSocketCopyPeerAddress is just a wrapper around the POSIX function > getpeername(), so you can just get the native socket from your > NSSocketPort and then call that. Or just keep using C

Re: Custom Controls Where to start

2009-11-27 Thread Henry McGilton (Boulevardier)
On Nov 26, 2009, at 4:01 PM, Sandro Noël wrote: > Thank you Alastair. > > Well it's pretty complicated, This is my third application, the first being > Bonjour Mounter, the Second RDP Launcher. > Others were created but never released. I've always used the OS's controls > but now I find myself

Re: An Array of structs

2009-11-27 Thread Alastair Houghton
On 27 Nov 2009, at 13:30, Jeremy Pereira wrote: > You can't have non constant elements in struct initialisers, testy is not a > constant. The error message spells out exactly what the issue is. You *can* have non-constant elements in struct initialisers in C, *but* only in a context where ther

Re: Conversion of CFSocketCreateWithNative -> NSSocketPort

2009-11-27 Thread Michael Ash
On Fri, Nov 27, 2009 at 6:46 AM, René v Amerongen wrote: > Hello, > > I' am busy to make an old app up to date and want to use 100% 10.6 cocoa. > I have +75% percent done, but there is something what I can't figure out. > > Network calls are now using NSSocketPort, except a few that uses a fileHan

Re: An Array of structs

2009-11-27 Thread Jeremy Pereira
On 27 Nov 2009, at 11:35, John Love wrote: > > I get "Initializer element is not constant. This pertains to the NSString* > because if I directly substitute the following, no compile error happens: > YearAmt gTest[] = {{@"testy", 10} > > What fundamental pertaining to C or C++ am I not getting?

Re: An Array of structs

2009-11-27 Thread Graham Cox
On 27/11/2009, at 10:35 PM, John Love wrote: > NSString *testy = @"testy"; > YearAmt gTest[] = {{testy, 10} /*, + others */}; > > I get "Initializer element is not constant. This pertains to the NSString* > because if I directly substitute the following, no compile error happens: > YearAmt gTe

Mount afp volume

2009-11-27 Thread gMail.com
Hi, I use to mount a volume with the old API FSMountServerVolumeSync and it works well. My question is, should I use a Cocoa version of this API? If so, which one? Also, in my "very old" code, before I call this API, I use to Ping the host. I can't recall why I Ping the host before this callin

Re: My try/catch block isn't catching exceptions on 10.6

2009-11-27 Thread Jeremy Pereira
On 26 Nov 2009, at 23:51, Mark Allan wrote: > > > Exception Type: EXC_BAD_ACCESS (SIGBUS) > Exception Codes: KERN_PROTECTION_FAILURE at 0x0010 > Crashed Thread: 3 You can't catch that with an Objective C exception handler. It's a Unix bus error. Probably some pointer has chang

Conversion of CFSocketCreateWithNative -> NSSocketPort

2009-11-27 Thread René v Amerongen
Hello, I' am busy to make an old app up to date and want to use 100% 10.6 cocoa. I have +75% percent done, but there is something what I can't figure out. Network calls are now using NSSocketPort, except a few that uses a fileHandle or fileDescriptor to get an IP address, like: (NSFileHandle *)

An Array of structs

2009-11-27 Thread John Love
In my .h file, I have: typedef struct YearAmt { NSString *year; int amount; } YearAmt; extern NSString *testy; extern YearAmt gTest[]; In the corresponding .m file: NSString *testy = @"testy"; YearAmt gTest[] = {{testy, 10} /*, + others */}; I get "Initializer element i

Invoking ImageKit effects panel

2009-11-27 Thread Florian Soenens
Hi list, i googled this but found nothing relevant. Is it possible to invoke or access the effects view of the [IKImageEditPanel sharedImageEditPanel]? What i would like to do is add this effcets view to my own custom view, in other words i don't want it to be in its own HUD panel. Is this

Re: My try/catch block isn't catching exceptions on 10.6

2009-11-27 Thread Matt Gough
On 27 Nov 2009, at 01:08:28, Graham Cox wrote: > Does Objective C support multiple catch blocks, like C++? In other words you > could do: > > @try > { > ... > } > @catch( NSException* e) > { > // deal with NSException > } > @catch(...) > { > // deal with any other sort of exception > } The e

Getting the path to an application with a launchDaemon

2009-11-27 Thread Zephyroth Akash
Hi, I'm actually creating a daemon which then runs in root context and I can't get the path to an application. The command: [[NSWorkspace sharedWorkspace] absolutePathForAppBundleIdentifier:@"com.myCompany.myApp"]; returns NULL but returns the path to my application bundle correctly if us