Re: User interface validation doesn't work, right?

2009-07-03 Thread Bill Cheeseman
On Jul 2, 2009, at 8:38 PM, Quincey Morris wrote: It remains totally mysterious what's going to cause individual validatable interface items to trigger their own validation. Perhaps there's no automatic general mechanism at all, and each interface item class has to solve the problem for its

Re: screen lock events?

2009-07-03 Thread Carl Harris
Are there events that I can observe that indicate when the screen lock has activated/deactivated? I have a background agent that should really be disabled when the screen is locked... Responding to my own post, in hopes that it may help others who find themselves hunting for how to do det

Re: User interface validation doesn't work, right?

2009-07-03 Thread Quincey Morris
On Jul 3, 2009, at 01:20, Bill Cheeseman wrote: In the case of buttons, you likewise have to implement - validateUserInterfaceItem: yourself. But that isn't enough, because Cocoa does not call it automatically just because you implemented it. A generic solution is to implement the -windowDid

Re: Replace -[NSKeyedUnarchiver unarchiveObjectWithData:] so it doesn't crash on corrupt archive

2009-07-03 Thread Michael Ash
On Fri, Jul 3, 2009 at 1:42 AM, Jerry Krinock wrote: > > On 2009 Jul 02, at 21:11, Michael Ash wrote: > >> Is there a reason you can't just implement a new method in a category >> and not replace the existing one? It will be just as safe in your >> code, just as easy to use, > > I'd considered doin

Re: Determining OS at Runtime

2009-07-03 Thread Steve Christensen
On Jul 2, 2009, at 9:56 PM, Andrew Farmer wrote: On 2 Jul 2009, at 16:29, Steve Christensen wrote: If you want to make sure that you don't include any "old" code in your executable when you decide to make 10.5 (for example) your base OS version, you could arrange your code like this: #if M

Re: User interface validation doesn't work, right?

2009-07-03 Thread Keary Suska
On Jul 2, 2009, at 11:52 AM, Bill Cheeseman wrote: On Jul 2, 2009, at 12:24 PM, Keary Suska wrote: Because the two protocols in question are formal protocols, the @interface declaration must specify conformance. If it doesn't, then no assumption of conformance should be made. Pure and simpl

Re: User interface validation doesn't work, right?

2009-07-03 Thread John C. Randolph
On Jul 2, 2009, at 10:52 AM, Bill Cheeseman wrote: Apple will probably say I should move on to Cocoa Bindings and get over it. I certainly would. -jcr ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or m

Re: Private copy not working correctly

2009-07-03 Thread Joe Turner
Thanks, this seems to work perfectly! I recently read about shallow and deep copies, but didn't see the initWithDictionary:copyItems: method. Thanks, Joe On Jul 2, 2009, at 6:51 PM, Adam R. Maxwell wrote: On Jul 2, 2009, at 12:05 PM, Joe Turner wrote: I'm trying to create a private copy

Re: Replace -[NSKeyedUnarchiver unarchiveObjectWithData:] so it doesn't crash on corrupt archive

2009-07-03 Thread Jerry Krinock
On 2009 Jul 03, at 05:50, Michael Ash wrote: It is entirely possible that Apple's code relies on this method throwing an exception on error. Ah, you're correct. So I've changed it to be a regular category method, +unarchiveObjectSafelyWithData:, instead of replacing the method. ___

Re: Determining OS at Runtime

2009-07-03 Thread Mark Munz
You might also just use Gestalt: BOOL IsLeopardOrLater(void) { SInt32 vers; Gestalt(gestaltSystemVersion,&vers); return (vers >= 0x1050); } On Fri, Jul 3, 2009 at 6:59 AM, Steve Christensen wrote: > On Jul 2, 2009, at 9:56 PM, Andrew Farmer wrote: > >> On 2 Jul 2009, at 1

Re: Determining OS at Runtime

2009-07-03 Thread Steve Christensen
For the case of a function, if you're deploying on 10.4 but using a 10.5 function, that function will be weak-linked so doing a runtime check is both faster and more accurate in determining whether a function exists or not. For a Cocoa class method, you could replace the test with a call to

Re: Determining OS at Runtime

2009-07-03 Thread Adam R. Maxwell
On Jul 3, 2009, at 10:06 AM, Steve Christensen wrote: For the case of a function, if you're deploying on 10.4 but using a 10.5 function, that function will be weak-linked so doing a runtime check is both faster and more accurate in determining whether a function exists or not. For a Cocoa

Re: Determining OS at Runtime

2009-07-03 Thread Jim Correia
On Jul 3, 2009, at 1:06 PM, Steve Christensen wrote: For the case of a function, if you're deploying on 10.4 but using a 10.5 function, that function will be weak-linked so doing a runtime check is both faster and more accurate in determining whether a function exists or not. Beware that

Movable Document Modal Dialogs

2009-07-03 Thread Development
This is more for the user interface experts, than the cocoa programming experts... What is the suggested user interface when creating modal dialogs for documents that have be movable? For our application (think of it as a drawing program), the user sometimes NEEDS to be able to view the d

Re: Movable Document Modal Dialogs

2009-07-03 Thread Fritz Anderson
On 3 Jul 2009, at 1:23 PM, Development wrote: What is the suggested user interface when creating modal dialogs for documents that have be movable? For our application (think of it as a drawing program), the user sometimes NEEDS to be able to view the document under the modal dialog. We can

Re: Movable Document Modal Dialogs

2009-07-03 Thread WT
On Jul 3, 2009, at 8:23 PM, Development wrote: This is more for the user interface experts, than the cocoa programming experts... What is the suggested user interface when creating modal dialogs for documents that have be movable? For our application (think of it as a drawing program), th

Re: Design for custom tableviewcell button action

2009-07-03 Thread Brian Slick
Well, at first I really liked this technique, and it seems simple enough. I restructured my program to use it, and in the simulator all went well. Then I uploaded to the phone (1st-gen) and saw absolutely horrid scrolling performance. I fired up the CA tool, and saw numbers that were wel

Re: Movable Document Modal Dialogs

2009-07-03 Thread Development
You know, that is not a half bad idea. It won't work for all the situations (some of the dialog boxes are to big to fit in a drawer), but it would for several of the smaller ones. Also, if the document is full screen, drawers would be an issue. I will still look for a better solution for l

Re: Movable Document Modal Dialogs

2009-07-03 Thread Benjamin Dobson
On 3 Jul 2009, at 19:23:04, Development wrote: This is more for the user interface experts, than the cocoa programming experts... What is the suggested user interface when creating modal dialogs for documents that have be movable? For our application (think of it as a drawing program), t

Re: Movable Document Modal Dialogs

2009-07-03 Thread WT
On Jul 3, 2009, at 9:01 PM, Development wrote: You know, that is not a half bad idea. It won't work for all the situations (some of the dialog boxes are to big to fit in a drawer), but it would for several of the smaller ones. Also, if the document is full screen, drawers would be an issue

Re: Movable Document Modal Dialogs

2009-07-03 Thread Quincey Morris
On Jul 3, 2009, at 11:23, Development wrote: What is the suggested user interface when creating modal dialogs for documents that have be movable? For our application (think of it as a drawing program), the user sometimes NEEDS to be able to view the document under the modal dialog. We can

Optimizing writes of big files for specific hardware?

2009-07-03 Thread Jay Reynolds Freeman
I am not sure whether this is a Cocoa question or a Darwin one. I will take the discussion elsewhere if need be. Please advise. I have an app whose initialization includes writing a huge file to disk -- think GigaBytes, or even tens of GigaBytes. I am doing this in the context of setting up a l

Securely limit the running an application by serial number

2009-07-03 Thread Ammar Ibrahim
I want my application to run on specific computers that are licensed to use the software. This is for limited use, and isn't a product for the masses. I've realized that you can limit the software to run on specific computers by limiting using the serial number of the machine. how secure is it? can

Re: Securely limit the running an application by serial number

2009-07-03 Thread Ammar Ibrahim
I meant "Securely limit the running *of* an application by serial number" On Fri, Jul 3, 2009 at 10:49 PM, Ammar Ibrahim wrote: > I want my application to run on specific computers that are licensed to use > the software. This is for limited use, and isn't a product for the masses. > I've realize

Re: Optimizing writes of big files for specific hardware?

2009-07-03 Thread Igor Mozolevsky
2009/7/3 Jay Reynolds Freeman : > At the moment I am actually just using the C++ library "write" > to do the writes, in a tight loop with a large buffer (50 MByte) > full of zeros. > > Is there a way to optimize? I'd memory-map the file and bzero() the space. -- Igor ___

Re: Securely limit the running an application by serial number

2009-07-03 Thread Nick Zitzmann
On Jul 3, 2009, at 1:49 PM, Ammar Ibrahim wrote: can someone crack the software by avoiding the "if statement" that does the check? Yes. How can I secure my checks. Obfuscate them and hope nobody finds out. It's the only way. 32-bit apps can be easily hacked through input managers,

Re: Securely limit the running an application by serial number

2009-07-03 Thread Ammar Ibrahim
On Fri, Jul 3, 2009 at 11:09 PM, Nick Zitzmann wrote: > > On Jul 3, 2009, at 1:49 PM, Ammar Ibrahim wrote: > > can >> someone crack the software by avoiding the "if statement" that does the >> check? >> > > Yes. > > How can I secure my checks. >> > > > Obfuscate them and hope nobody finds out.

Re: Securely limit the running an application by serial number

2009-07-03 Thread Nick Zitzmann
On Jul 3, 2009, at 2:11 PM, Ammar Ibrahim wrote: I'm writing a 64-bit only app. Any pointers on where I can find info on obfuscation? Nick Zitzmann ___ Cocoa-dev mailing lis

Re: Optimizing writes of big files for specific hardware?

2009-07-03 Thread Greg Guerin
Jay Reynolds Freeman wrote: I have an app whose initialization includes writing a huge file to disk -- think GigaBytes, or even tens of GigaBytes. I am doing this in the context of setting up a large area of shared memory with mmap, so the big write has to happen at initialization, and it is ag

Re: Securely limit the running an application by serial number

2009-07-03 Thread Quincey Morris
On Jul 3, 2009, at 12:49, Ammar Ibrahim wrote: I want my application to run on specific computers that are licensed to use the software. This is for limited use, and isn't a product for the masses. I've realized that you can limit the software to run on specific computers by limiting using

Re: Securely limit the running an application by serial number

2009-07-03 Thread Jim Thomason
>> I'm writing a 64-bit only app. Any pointers on where I can find info on >> obfuscation? > > > In addition to that, don't even think about doing your checks in objective-C. It's just too easy to hack around, and if somebody's dedicated to cracking you, i

Re: Securely limit the running an application by serial number

2009-07-03 Thread Michael Ash
On Fri, Jul 3, 2009 at 4:11 PM, Ammar Ibrahim wrote: > I'm writing a 64-bit only app. Any pointers on where I can find info on > obfuscation? In addition to what the others have said, you should think seriously about how useful obfuscation will be. First, realize that you have a virtually insurmo

Re: Securely limit the running an application by serial number

2009-07-03 Thread Todd Heberlein
This is for limited use, and isn't a product for the masses. There has already been some pretty good stuff posted, but just keep in mind that once you've released your code, if someone is really interested in modifying your code, they probably will. I doubt there will ever be a 100% guaran

Re: Optimizing writes of big files for specific hardware?

2009-07-03 Thread Jay Reynolds Freeman
On Jul 3, 2009, at 1:20 PM, Greg Guerin wrote: > [useful comments excised, thank you very much] I will try lseek and write at the end. > Exactly what problem is solved by initially writing multiple > gigabytes of zeros to disk? As for what I am doing, I have a parallel Scheme system (Wraith Sc

Re: Design for custom tableviewcell button action

2009-07-03 Thread mmalc Crawford
On Jul 3, 2009, at 11:54 AM, Brian Slick wrote: So, if TaggedLocations was flying while mine was sucking, I'd probably concede that what I was doing was wrong (and would probably need more custom cells). But since neither one is performing very well, and I can't find any significant diffe

in search of a starter iphone painting tutorial or sample code

2009-07-03 Thread colo
I am seeking a bare bones beginner source or tutorial for building painting apps on the iphone. Of all the apps I tested. None have a paint bucket tool that only fills in a section of color. They all fill the screen. So, I must make my own. :D ___ Cocoa-

Re: in search of a starter iphone painting tutorial or sample code

2009-07-03 Thread WT
On Jul 3, 2009, at 11:15 PM, colo wrote: I am seeking a bare bones beginner source or tutorial for building painting apps on the iphone. Of all the apps I tested. None have a paint bucket tool that only fills in a section of color. They all fill the screen. So, I must make my own. :D Having t

Re: in search of a starter iphone painting tutorial or sample code

2009-07-03 Thread I. Savant
On Jul 3, 2009, at 5:15 PM, colo wrote: I am seeking a bare bones beginner source or tutorial for building painting apps on the iphone. A "bare bones beginner" source or tutorial is simply not possible for an application of this nature. I'm unfamiliar with the iPhone example code offerin

Re: Design for custom tableviewcell button action

2009-07-03 Thread Brian Slick
On Jul 3, 2009, at 4:39 PM, mmalc Crawford wrote: On Jul 3, 2009, at 11:54 AM, Brian Slick wrote: I did make a slight adjustment to the technique - most significantly the omitting of the identifier in the XIB file, This is actually a very significant factor. If you haven't set an identifie

Re: Securely limit the running an application by serial number

2009-07-03 Thread Kyle Sluder
On Fri, Jul 3, 2009 at 1:33 PM, Michael Ash wrote: > In addition to what the others have said, you should think seriously > about how useful obfuscation will be. There might be an argument here about protecting trade secrets. If you don't defend them, they lose their protected status. The bigges

Negative values in KVC's @sum?

2009-07-03 Thread marc hoffman
Hi, i'm wondering if i am missing something, but is KVC's @sum operator supposed to handle negative values? i'm using it to calculate the sum (duh) of NSDecimalNumber in a custom class. all is going fine, but as soon as i have a negative value, i get a huge negative number as result. for

Re: in search of a starter iphone painting tutorial or sample code

2009-07-03 Thread colo
Thank you all. I however am not a beginner at the programing side of things now. I was more looking for some type of possible common article or reading material that is on the web from others that have tinkered with painting apps for iphone in particular. Since there seem to be so many in the stor

Re: Design for custom tableviewcell button action

2009-07-03 Thread mmalc Crawford
On Jul 3, 2009, at 2:45 PM, Brian Slick wrote: So now I either need to figure out how to make my scenarios all work with a single identifier, or I may just go ahead with the code-only cell I just built in response to the performance issue. If would be nice if there was some kind of queueW

Re: in search of a starter iphone painting tutorial or sample code

2009-07-03 Thread mmalc Crawford
On Jul 3, 2009, at 2:15 PM, colo wrote: I am seeking a bare bones beginner source or tutorial for building painting apps on the iphone. This one uses OpenGL: You could use a similar technique to create CGPaths to re

Sorting an editable tableView of managed object

2009-07-03 Thread Steve Cronin
Folks; I have a simple one column tableView of a managed object. The text field in the table view is editable. I want to keep the table sorted when the user manually changes a value, I have registered for the notification: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selec

Re: in search of a starter iphone painting tutorial or sample code

2009-07-03 Thread colo
> This one uses OpenGL: > > > You could use a similar technique to create CGPaths to represent the > strokes, but performance with OpenGL is considerably better. > > mmalc Oh awesome! Thank you. This is a perfect start that

Long term performance of NSConnection

2009-07-03 Thread Kevin Brock
We've got an application that uses some NSConnection objects to call between binaries. An application calls interfaces of an object which is vended by a daemon. The calls between modules are made frequently, and during some testing I noticed a steady drop in perfomance of the application. I

How do I get the version of AppKit.framework available in Cocoa Application Framework 10.5? Probably a dumb question I know..

2009-07-03 Thread maxwellmac99
Hi Folks, sorry I know this is probably a dumb question. I'm new to Mac OS X development being a jaded Java bod coming over to the light. Very nice it is too. My problem is I need to call this method that seems to be in a later version of the AppKit.framework than is on my machine. The method is

Animation Did Stop - Works For OS3 but not OS2.2

2009-07-03 Thread Chunk 1978
this works fine in OS 3, but it doesn't call fade out in OS2.2? what is the problem? - (void)animationHasFinished:(NSString *)animationID finished:(BOOL)finished { if ((animationID == @"FadeIn") && finished) { [self fadeOut]; }

Core Data, migrate a model split into two files

2009-07-03 Thread Dan Waltin
Hi, I have a Core Data application, with the model split into two .xcdatamodel files, inspired by Chris Hanson at http://chanson.livejournal.com/187540.html . The application is only supported on 10.5. The application is usd to track patient records and the to xcdatamodel files are called

Re: How do I get the version of AppKit.framework available in Cocoa Application Framework 10.5? Probably a dumb question I know..

2009-07-03 Thread Dave DeLong
Hi Max, First off, AppKit is distributed with the system. It may or may not get updated during an OS update (such as the rumored 10.5.8 update), but that's it. You can't download a different version. As for the initWithCIImage: method, the page you linked to is describing the API change

Re: Animation Did Stop - Works For OS3 but not OS2.2

2009-07-03 Thread Dave DeLong
Hi Chunk, You're missing the third parameter of the selector (the context parameter). Also, I believe that OS 2.2 didn't send parameters along in the animation selectors. The selector you're providing (animationHasFinished:finished:) will need at least two (the docs for 3.0 say you need

Re: Securely limit the running an application by serial number

2009-07-03 Thread Peter Mulholland
Hello Ammar, Friday, July 3, 2009, 8:49:32 PM, you wrote: > I want my application to run on specific computers that are licensed to use > the software. This is for limited use, and isn't a product for the masses. > I've realized that you can limit the software to run on specific computers > by li

Font matching

2009-07-03 Thread Gideon King
Hi, I have an application where I need to be able to find the closest equivalent font should a font be missing. e.g. someone creates a file and sends it to someone else, who doesn't have the font that was used to create the original file installed on their system. I thought that maybe savin

Re: Securely limit the running an application by serial number

2009-07-03 Thread I. Savant
On Jul 3, 2009, at 6:48 PM, Peter Mulholland wrote: First thing - Apple and their devout followers will tell you "don't do that" when it comes to ANY protection. Ironic since as they have DSMOS and PT_DENY_ATTACH on iTunes etc. I call trollshit. There's a whole thread-worth of response

Send files from iphone

2009-07-03 Thread Development
I need to be able to upload the data from a UIImage to a server via http POST however I simply cannot find a good example of how to arrange the headers or how to make this post. The only data I need to send to the server is the file's name, the user's name and the data itself and I simply can

Re: Send files from iphone

2009-07-03 Thread Kyle Sluder
What have you tried? Or at least looked at trying? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscrib

Re: Send files from iphone

2009-07-03 Thread Luke Hiesterman
Check out documentation on NSURLRequest and NSURLConnection. Luke Sent from my iPhone. On Jul 3, 2009, at 7:20 PM, Development wrote: I need to be able to upload the data from a UIImage to a server via http POST however I simply cannot find a good example of how to arrange the headers

Re: Send files from iphone

2009-07-03 Thread Development
I have been trying to write my headers for multipart form data. I'm then sending the data over a NSStream. If it would be easier however to compact this somehow into a url request that would work fine too. I just need to figure out how to get the file to the server. On Jul 3, 2009, at 7:31

NSString stringWithFormat: and strings

2009-07-03 Thread KK
Hello, I have a NSString (from a property list file) that has the %@ formats in it... So.. I do something like this: NSString *stringFromPlistFile; NSString *newString = [NSString stringWithFormat:stringFromPlistFile, @"Hello"]; But that doesn't work... Keita

Re: NSString stringWithFormat: and strings

2009-07-03 Thread Andy Lee
On Jul 3, 2009, at 11:20 PM, KK wrote: Hello, I have a NSString (from a property list file) that has the %@ formats in it... So.. I do something like this: NSString *stringFromPlistFile; NSString *newString = [NSString stringWithFormat:stringFromPlistFile, @"Hello"]; But that doesn't work...

Re: Send files from iphone

2009-07-03 Thread Development
I also tried this and it fails. The form never gets any post variables or files: [self sendText:@"Content-Type: multipart/form-data; boundry=@@##$$- rew-**&&^%^\n"]; [self sendText:boundry]; [self sendText:[NSString stringWithFormat:@"Content-Length: %i\n \n",totalSize]]; [self se

Re: Changing content of object inside NSMutableArray

2009-07-03 Thread Ken Thomases
On Jul 2, 2009, at 5:36 PM, Agha Khan wrote: I have saved some objects inside GameArray (type NSMutableArray) and I would like to change of content of an object inside that array. GameObj is type of UIView so it has a frame. GameObj* p = [GameArray objectAtIndex:0]; p.frame = frame; This wo

[Moderator] Re: Securely limit the running an application by serial number

2009-07-03 Thread Scott Anguish
the discussion of software protection is off-limits for this list. take to to the mac small business list. [moderator] On 2009-07-03, at 6:48 PM, Peter Mulholland wrote: I want my application to run on specific computers that are licensed to use the software. This is for limited use, and is

looks like my syntax is wrong. Does not compile

2009-07-03 Thread Agha Khan
Aobject is type of Myobject* it has an array for 6 intergers Aobject.myArray = [NSArray arrayWithObjects:[NSNumber numberWithInt: 1], [NSNumber numberWithInt: 2],[NSNumber numberWithInt:3], [NSNumber numberWithInt:4], [NSNumber numberWithInt:5],[NSNumber numberWithInt: 6], nil]; Now I woul

Re: Send files from iphone

2009-07-03 Thread Development
Ok I have made a tiny bit of progress. The problem is that the _POST and _FILE arrays are still empty Well... the _POST array on the server is filled with a mix of the data it should have scrambled in with jpeg data. I desperately need help I cannot find the answer for this for some reason.

Re: looks like my syntax is wrong. Does not compile

2009-07-03 Thread Andrew Farmer
On 3 Jul 2009, at 21:29, Agha Khan wrote: Aobject is type of Myobject* it has an array for 6 intergers Aobject.myArray = [NSArray arrayWithObjects:[NSNumber numberWithInt: 1], [NSNumber numberWithInt: 2],[NSNumber numberWithInt:3], [NSNumber numberWithInt:4], [NSNumber numberWithInt:5],[NSNu

Re: Send files from iphone

2009-07-03 Thread Development
It's the smallest errors that create the greatest frustration. I left out a semi colon. and misspelled boundary. Which makes me wonder why the examples I found didnt work. On Jul 3, 2009, at 9:34 PM, Development wrote: Ok I have made a tiny bit of progress. The problem is that the _POST an