[iPhone] Application running for the very first time...

2009-10-01 Thread James Lin
Hi all, I am wondering if there is a simple way to find out when my application is running for the VERY FIRST TIME on an iPhone? So that I can set an integer variable once only at this moment... What's the best way to do this? Thank you in advance... James

Re: [iPhone] Application running for the very first time...

2009-10-01 Thread Todd Heberlein
I am wondering if there is a simple way to find out when my application is running for the VERY FIRST TIME on an iPhone? So that I can set an integer variable once only at this moment... What's the best way to do this? One approach is to test if a file exists on the file system, and if it

Cannot get pixel color from NSBitmapImageRep

2009-10-01 Thread David Hirsch
In the code below, the TIFF gets saved correctly (transparent but for the red square), but when I query the pixel at (40,40) which should be in the middle of the red square, I get a black pixel (r==g==b==a==0.0): offscreenRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:nil

Re: NSApplication's behavior

2009-10-01 Thread Jonathan Hess
On Sep 30, 2009, at 7:50 PM, Mark Hurley wrote: Still learning the Cocoa Window Architecture... Goal: I want to separate my MainWindow out of MainMenu.xib into its own .xib: MainView.xib. 1) I create a new Cocoa Application (not document-based) 2) I create a MainWindow.xib and

Re: Cannot get pixel color from NSBitmapImageRep

2009-10-01 Thread Jonathan Hess
On Oct 1, 2009, at 1:22 AM, David Hirsch wrote: In the code below, the TIFF gets saved correctly (transparent but for the red square), but when I query the pixel at (40,40) which should be in the middle of the red square, I get a black pixel (r==g==b==a==0.0): offscreenRep =

Re: [iPhone] Application running for the very first time...

2009-10-01 Thread Todd Heberlein
I am wondering if there is a simple way to find out when my application is running for the VERY FIRST TIME on an iPhone? So that I can set an integer variable once only at this moment... What's the best way to do this? Also, NSUserDefaults supports this basic capability. I'm just wondering

Re: Cannot get pixel color from NSBitmapImageRep

2009-10-01 Thread Dave Keck
       float r,g,b,a;        [pixelColor getRed:r green:g blue:b alpha:a]; -getRed:... accepts CGFloats as arguments, not floats. Depending on your architecture, you're supplying a pointer to an incorrectly-sized variable, and the bug you're seeing is the result of this error. If you

Re: [iPhone] Application running for the very first time...

2009-10-01 Thread Mark Woollard
No they aren't - NSUserDefaults is the approach I use for this kind of thing Sent from my iPhone On 1 Oct 2009, at 09:32, Todd Heberlein todd_heberl...@mac.com wrote: I am wondering if there is a simple way to find out when my application is running for the VERY FIRST TIME on an iPhone?

UIGraphicsBeginImageContext thread safety

2009-10-01 Thread Andrew
Hi All, So clearly the UIGraphicsBeginImageContext() set of calls are not thread safe, I was attempting to use them in an NSOperation and they are causing a crash, further research has shown me that I need to drop down into the CG calls to do what I want to do. .and presumably I

Re: Deleting CalTasks through an Array.

2009-10-01 Thread Stamenkovic Florijan
Hi Joshua, You're welcome, but you need to also learn some stuff on your own. 1. Browse the docs: NSArray does not have a contains: method, it has a containsObject: method. My mistake, but one that's easy to spot. 2. Check the method signatures for CalCalendar store. I believe I gave you

Re: 10.6 specific crash

2009-10-01 Thread Gregory Weston
Duncan Champney wrote: An app our company is developing is showing odd behavior and crashes under 10.6, but not under 10.5. I've done some digging and figured out that a major contributor to the crash is the following routine: (I've changed it slightly to get rid of unimportant details and

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread Paul Bruneau
Hi again- I got no responses to my query, which probably means I asked something poorly, but I needed to write another NSValueTransformer for my project (to convert dollars into pennies and back) and I saw the same behavior so I thought I'd ask again. To summarize: When I use my

Re: Mixed Core Data and static nodes in outline view

2009-10-01 Thread Stamenkovic Florijan
On Sep 30, 2009, at 20:58, Rick Mann wrote: On Sep 30, 2009, at 16:22:45, Rick Mann wrote: I'm looking at ways of grouping some Core Data objects in a outline view. What I have are 3 or 4 different entities, and I want each of the objects of each type to appear under a parent item in the

Re: Accessor works intermittently

2009-10-01 Thread Colin Howarth
Sorry, I accidentally posted my initial question (Doesn't one get a compiler warning about several methods being possible?) only to Stephen, not the list. On 1 Oct, 2009, at 07:10, Stephen J. Butler wrote: On Wed, Sep 30, 2009 at 10:16 PM, Colin Howarth co...@howarth.de wrote: Doesn't

Re: UIGraphicsBeginImageContext thread safety

2009-10-01 Thread glenn andreas
On Oct 1, 2009, at 6:41 AM, Andrew wrote: Hi All, So clearly the UIGraphicsBeginImageContext() set of calls are not thread safe, I was attempting to use them in an NSOperation and they are causing a crash, further research has shown me that I need to drop down into the CG calls to do

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread Graham Cox
On 01/10/2009, at 10:49 PM, Paul Bruneau wrote: But when I use the transformer on a regular NSTextField, I don't get that benefit. It properly transforms the value and the correct value gets stored in my model, but the reverse transformation doesn't fire like it does when used in the

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread Paul Bruneau
On Oct 1, 2009, at 9:47 AM, Graham Cox wrote: I don't have a definitive answer for you, but I've observed similar behaviour in some of my text fields. As long as you're typing, what you type is what the field will display. On enter/return, the value is sent to the data model, through the

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread I. Savant
Paul: On Oct 1, 2009, at 8:49 AM, Paul Bruneau wrote: But when I use the transformer on a regular NSTextField, I don't get that benefit. It properly transforms the value and the correct value gets stored in my model, but the reverse transformation doesn't fire like it does when used in

Re: NSDocumentController didCloseAllSelector

2009-10-01 Thread Adam R. Maxwell
On Sep 30, 2009, at 9:47 PM, Michael Ash wrote: On Wed, Sep 30, 2009 at 9:39 PM, Adam R. Maxwell amaxw...@mac.com wrote: On Sep 30, 2009, at 7:15 PM, Graham Cox wrote: On 01/10/2009, at 12:06 PM, Adam R. Maxwell wrote: That should bring you to a helpful discussion titled Advice for

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread Paul Bruneau
On Oct 1, 2009, at 10:45 AM, I. Savant wrote: Have you tried turning on the text field's value binding's continuously updates value option? Maybe even the validates immediately option? I imagine the wrong combination of these (including off) could have something to do with it. Thanks for

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread I. Savant
On Oct 1, 2009, at 10:58 AM, Paul Bruneau wrote: Thanks for the suggestion, IS. I had in fact tried those and I tried them again just now (in all combinations), no change. Hmmm ... This (figure 2):

Re: Cannot get pixel color from NSBitmapImageRep

2009-10-01 Thread David Hirsch
Jonathan, Dave- Nothing works yet. Dave's NSLog statement prints NSCalibratedRGBColorSpace 0 0 0 0, and restoring the graphics context does not help the problem. Still stumped. -Dave This is just as guess, but perhaps there's an issue with the drawing not being completed and flushed

Re: Deleting CalTasks through an Array.

2009-10-01 Thread Joshua Garnham
Hi, Thanks, It works now I've fixed the warnings. Cheers. From: Stamenkovic Florijan flor...@mac.com To: Joshua Garnham joshua.garn...@yahoo.co.uk Cc: cocoa-dev cocoa-dev@lists.apple.com Sent: Thursday, 1 October, 2009 13:32:20 Subject: Re: Deleting CalTasks

Re: Releasing NSSearchPathForDirectoriesInDomain causes crash

2009-10-01 Thread Jens Alfke
On Sep 30, 2009, at 7:37 PM, Adam R. Maxwell wrote: Does the Cocoa memory management documentation cover functions? It specifically refers to ...a method whose name begins with I wonder if something like the CF Create rule applies to Foundation? No — Foundation functions almost

[Enigmatic semi-solution] Re: Cannot get pixel color from NSBitmapImageRep

2009-10-01 Thread David Hirsch
Well, I can work around it but I don't understand this at all. Apparently the context is flipped, or getPixelAtX:y: is flipped, or something. In this code, the first NSLog statement gives all zeros, and the second gives the intended red color. However flipped returns NO. Any ideas as

Re: How to tell if NSArrayController has a selected CoreData instance?

2009-10-01 Thread Timothy Reaves
On Sep 30, 2009, at 7:53 AM, Mike Abdullah wrote: -[NSArrayController selectedObjects] does not return proxies, it returns the real thing. On the other hand: -[NSArrayController selection] returns a proxy that represents the overall selection NSTreeController uses proxies to represent

Re: [iPhone] Application running for the very first time...

2009-10-01 Thread James Lin
Can you please elaborate on this a bit more? I am already using NSUserDefaults for my preferences values. But I fail to see how this apply to determining if an Application is launched for the very first time... What do I do? Check to see if an NSUserDefault item exists? Thanks for the

Re: [iPhone] Application running for the very first time...

2009-10-01 Thread Alan Duncan
Just use a BOOL in your NSUserDefaults On Thu, Oct 1, 2009 at 11:24 AM, James Lin jamesclin...@gmail.com wrote: Can you please elaborate on this a bit more? I am already using NSUserDefaults for my preferences values. But I fail to see how this apply to determining if an Application is

Re: [iPhone] Application running for the very first time...

2009-10-01 Thread Alex Kac
You set the default of a NSUserDefault. Set that default to FALSE. Then on startup, check the value. If its FALSE - set it to TRUE and you know its the first time. Here is some from-memory typed code: NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] initWithCapacity: 10];

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread Quincey Morris
On Oct 1, 2009, at 05:49, Paul Bruneau wrote: I got no responses to my query, which probably means I asked something poorly, but I needed to write another NSValueTransformer for my project (to convert dollars into pennies and back) and I saw the same behavior so I thought I'd ask again.

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread Paul Bruneau
On Oct 1, 2009, at 11:10 AM, I. Savant wrote: On Oct 1, 2009, at 10:58 AM, Paul Bruneau wrote: Thanks for the suggestion, IS. I had in fact tried those and I tried them again just now (in all combinations), no change. Hmmm ... This (figure 2):

Address Book-style editing

2009-10-01 Thread Brad Gibbs
Hi, I'm trying to re-create Address Book's editing style - if a user pushes a button labeled Edit, subsequent clicks on a label bring up what looks like a separate view for the new information. Clicking return after editing commits the edit and moves on to the next field. I'd also like

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread I. Savant
On Oct 1, 2009, at 1:02 PM, Paul Bruneau wrote: Well if you look at Figure 2, step #23, it says Updated value now stored in model object. Key-value observing notifications are sent to observers of this model property. So due to the binding, the text field would get updated by this

Order of CALayer's

2009-10-01 Thread Gabriel Zachmann
Dear list, I think I'm going crazy! I've got one root layer and two sublayers. The content of one of them is an image, the other's content is drawn by a delegate's drawLayer:inContext:. I want the image layer *always* be rendered *behind* the other's content. But no matter what I do,

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread Paul Bruneau
On Oct 1, 2009, at 1:23 PM, I. Savant wrote: As Quincey mentioned, it's probably because the data cell for that column (the prototype that's reused to draw that column's value for each row) is being updated per row, which involves reading that value and setting it as the cell's object

Re: Order of CALayer's

2009-10-01 Thread Kyle Sluder
Nobody can make an educated attempt to help you without seeing your code. So, er, please post your code. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread Quincey Morris
On Oct 1, 2009, at 10:45, Paul Bruneau wrote: // this method will cause the field to get updated upon pressing Return -(BOOL)validateTopClearance:(id *)ioValue error:(NSError **)outError { if (*ioValue == nil) { return YES; }

Re: [Enigmatic semi-solution] Re: Cannot get pixel color from NSBitmapImageRep

2009-10-01 Thread Ken Ferry
Hi David, Oh, yes, you're right. In the bitmapData, the first row is the top row. -getPixelAtX:y:, -setPixelAtX:y:, -getColorAtX:y: and setColorAtX:y: are the same. The first row is the top. Sorry that's confusing. -isFlipped: is not a property of NSBitmapImageRep, that's on NSImage. The

Re: 10.6 specific crash

2009-10-01 Thread Ken Ferry
On Thu, Oct 1, 2009 at 5:47 AM, Gregory Weston gwes...@mac.com wrote: Duncan Champney wrote: An app our company is developing is showing odd behavior and crashes under 10.6, but not under 10.5. I've done some digging and figured out that a major contributor to the crash is the following

Changing an NSToolbar Identifier

2009-10-01 Thread Markus Spoettl
Hello, is it save to change the identifier of an NSToolbar in the .xib file to something else, or does IB/AppKit expect it to be a specific GUID? The background for this is as follows: I have a new version of an application that shares its app ID with the previous version. The

Re: Why is scrollbar enabled? - SOLVED

2009-10-01 Thread Eric Gorr
If anyone is interested, I finally found what the problem was...first, it goes back to this old message in the archives: Re: setEnabled on a NSView http://lists.apple.com/archives/cocoa-dev/2002/Feb/msg01312.html I needed to do this exactly thing. I have a custom view and I wanted an

Re: Accessor works intermittently

2009-10-01 Thread Greg Parker
On Sep 30, 2009, at 7:56 PM, Stephen J. Butler wrote: On Wed, Sep 30, 2009 at 6:41 PM, David Hirsch dhir...@mac.com wrote: I cannot figure out why this does not work: Phase *thisPhase = [phases objectAtIndex:i]; float testmode = [thisPhase mode];

Re: [iPhone] Application running for the very first time...

2009-10-01 Thread Sidney San Martín
I think some of those values may be flipped: NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] initWithCapacity:10]; [dictionary setObject: [NSNumber numberWithBool:YES] forKey:PIFirstRun]; [[NSUserDefaults standardUserDefaults] registerDefaults:dictionary]; [dictionary release];

Re: [iPhone] Application running for the very first time...

2009-10-01 Thread Alex Kac
As I said - I wrote it into the email by memory typed code so... :) But the idea was still there. On Oct 1, 2009, at 2:17 PM, Sidney San Martín wrote: I think some of those values may be flipped: NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] initWithCapacity:10];

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread Paul Bruneau
On Oct 1, 2009, at 2:16 PM, Quincey Morris wrote: What was the number you tried this with? Some NSNumber values are singleton objects, so returning a new NSNumber with the same value might really return the original object. :) Or maybe just equality of value matters. It occurs to me that

Bad stardardUserDeafaults

2009-10-01 Thread Jacob Schwartz
Hello all, So I have a code segment that turns an NSString that is a file path on my computer into an NSURL, archives the NSURL into NSData, and then puts that into a NSMutableDictionary to be saved in the standardUserDefaults. I can archive and unarchive the NSData with no problem, but

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread I. Savant
On Oct 1, 2009, at 3:26 PM, Paul Bruneau wrote: I just thought of something IS said earlier: Thing is, aside from transformed values, the value that makes it to the model layer is usually a direct reflection of what was just set in the view. :-) In 99% of cases, this would seem a waste of

Re: Bad stardardUserDeafaults

2009-10-01 Thread Kyle Sluder
You need to post your archiving and unarchiving code. --Kyle Sluder ___ 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

Re: Bad stardardUserDeafaults

2009-10-01 Thread I. Savant
On Oct 1, 2009, at 3:32 PM, Jacob Schwartz wrote: So I have a code segment that turns an NSString that is a file path on my computer into an NSURL, archives the NSURL into NSData, and then puts that into a NSMutableDictionary to be saved in the standardUserDefaults. I can archive and

Provisioning Question

2009-10-01 Thread Bob Barnes
I've generated the appropriate certificates and created a provisioning profile (development) that is generic, i.e., uses the wild-card character. The provisioning profile does NOT include either APNS or In App Purchase, but when I load the app onto the iPod Touch an entry is added under

Re: Weird NSToolbar glitch

2009-10-01 Thread Bryan Matteson
OK, it's solved now. Turns out NSToolbar does not like being on two windows at the same, in any way, and setting one window's toolbar to nil and adding the toolbar to a new window still causes those weird drawing errors as well. The solution, if anyone finds themselves grappling with this,

Re: Provisioning Question

2009-10-01 Thread I. Savant
On Oct 1, 2009, at 3:38 PM, Bob Barnes wrote: I've generated the appropriate certificates and created a provisioning profile (development) that is generic, i.e., uses the wild-card character This has nothing to do with Cocoa, specifically. I think you might have better luck using the

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread Quincey Morris
On Oct 1, 2009, at 12:26, Paul Bruneau wrote: The other way to approach this is to add a second set of properties -- the formatted string values of your numeric properties -- that are dependent on the numeric ones, and bind to the string properties instead. It's a PITA to code it all, but

Re: Bad stardardUserDeafaults

2009-10-01 Thread Jacob Schwartz
Alright I'll have to do it after I get out of class. I didn't post it right away in case this was a common mistake, simple use of a wrong method. Thanks -Jake On Oct 1, 2009, at 3:38 PM, I. Savant idiotsavant2...@gmail.com wrote: On Oct 1, 2009, at 3:32 PM, Jacob Schwartz wrote: So I

Re: Bad stardardUserDeafaults

2009-10-01 Thread I. Savant
On Oct 1, 2009, at 3:49 PM, Jacob Schwartz wrote: I didn't post it right away in case this was a common mistake That's the problem. If you think about it, how can we know what kind of mistake it was without seeing what you actually did? :-) -- I.S.

Re: Weird NSToolbar glitch

2009-10-01 Thread I. Savant
On Oct 1, 2009, at 3:40 PM, Bryan Matteson wrote: OK, it's solved now. Turns out NSToolbar does not like being on two windows at the same, Hah. No, definitely not. :-D Window - Toolbar ... always. You'll never have Window - Toolbar or Window - Toolbar. I thought

Re: Provisioning Question

2009-10-01 Thread Bob Barnes
Yes, I realize it's off-topic and I did try to post on the iPhone development forum, but I keep getting an error trying to create an account. On Oct 1, 2009, at 12:45 PM, I. Savant wrote: On Oct 1, 2009, at 3:38 PM, Bob Barnes wrote: I've generated the appropriate certificates and

Re: Weird NSToolbar glitch

2009-10-01 Thread Bryan Matteson
Window - Toolbar ... always. You'll never have Window - Toolbar or Window - Toolbar. I thought this was stated in the documentation but I can't find it in the API reference or the guide at a quick glance. I couldn't find it anywhere in the documentation. But the thing

Re: Provisioning Question

2009-10-01 Thread I. Savant
On Oct 1, 2009, at 3:59 PM, Bob Barnes wrote: Yes, I realize it's off-topic and I did try to post on the iPhone development forum, but I keep getting an error trying to create an account. I mean no disrespect, but if you know it's off-topic, why post? In any case, if you're having

I upgraded to 10.6 and all I got was this lousy bug

2009-10-01 Thread Rui Pacheco
Hi, I upgraded to 10.6 midway through a project and a bug came up where there was none previously. I am now seeing the error Failed to call designated initialiser on NSManagedObject class 'CHMySQLSettingsModel' when I created an object on the MOC or when I fetch an object for editing. Step by

Re: Weird NSToolbar glitch

2009-10-01 Thread I. Savant
On Oct 1, 2009, at 4:01 PM, Bryan Matteson wrote: I couldn't find it anywhere in the documentation. But the thing is, it doesn't seem like you can even move a toolbar from one window to another, even properly making sure that it never belongs to more than one at a time, without getting

NSImageCell Disabled Look

2009-10-01 Thread Karl Moskowski
I'm displaying a list of files with their icons in a table view. The icons are created using a NSValueTransformer that uses NSWorkspace iconForFile:, and bound to an NSImageCell in a table column. According to the AppKit release notes for Snow Leopard, borderless NSImageCells draw images

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread Paul Bruneau
On Oct 1, 2009, at 3:34 PM, I. Savant wrote: The problem is, I think, that most developers aren't overloading the input as you are. :-) I knew this would come up! :) But in actuality, this same problem would occur regardless of whether I was overloading the input. Even in the very

Making a opaque copy of an NSImage

2009-10-01 Thread David Alter
*I have an NSImage that I would like to make a transparent version for dragging. I have used - (void)dissolveToPoint:(NSPoint)aPoint fraction:(CGFloat)delta to do this in the past. That appears to be getting deprecated and I would like to update my code. What is the suggested way of doing things.

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread I. Savant
On Oct 1, 2009, at 4:38 PM, Paul Bruneau wrote: I do have 20ish edit fields to contend with on my main window. I could set up a preference to let the user select his preferred entry method (there are just 2), but I still think I would still have the trouble with the inconsistent updating

Re: Making a opaque copy of an NSImage

2009-10-01 Thread Kyle Sluder
This is covered in the AppKit release notes. http://developer.apple.com/mac/library/releasenotes/Cocoa/AppKit.html --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the

CoreAnimation: image is too large

2009-10-01 Thread Gabriel Zachmann
I am using Core Animation to display some images. Is there an easy way to find out the following information? 1. Query the properties GL_MAX_TEXTURE_SIZE and GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB from the current OpenGL context that Core Animation must have acquired somewhere. Well, it would

IB webview oddity/question...

2009-10-01 Thread jon
if you make a new IB project, create two new windows, with a new webview located into each window, if you go to one of the webviews, and get the inspector up and go into the attributes, and turn off everything, like java, plugins, animate images, etc... the second webview also

Re: Sleep, NSWorkspaceWillSleepNotification, 30 seconds and the run loop

2009-10-01 Thread Jens Alfke
On Sep 30, 2009, at 1:32 PM, jonat...@mugginsoft.com wrote: I intend to send off my bit of data, hang around ( = 30 secs) to get notification and then close everything. Why do you need to wait at all? —Jens___ Cocoa-dev mailing list

Re: Bad stardardUserDeafaults

2009-10-01 Thread Jacob Schwartz
I meant like if it was a common case. Nevermind though, here is the code: Archiving: NSMutableDictionary *defaultValues = [NSMutableDictionary dictionary]; NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@/ Users/jacobschwartz/Pictures/wallpapers]]; NSData *pathAsData =

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread Quincey Morris
On Oct 1, 2009, at 13:38, Paul Bruneau wrote: That scenario does sound very similar to mine. I'd forgotten, in my application I simplified the user interface because of various validation difficulties (maybe including bindings issues, I don't remember), so all I've got left is a sheet

CAKeyframeAnimation for 'position' not working

2009-10-01 Thread Christopher J Kemsley
(Note: I apologize for not having this nicely formatted. My previous message - 8kB over the size limit - was rejected because it was too large, so I had to remove the extra HTML) I have a CAKeyframeAnimation that simply will not work. I have a layer. When I apply a CABasicAnimation to it,

Re: CAKeyframeAnimation for 'position' not working

2009-10-01 Thread David Duncan
On Oct 1, 2009, at 2:45 PM, Christopher J Kemsley wrote: The output, from the print statements, to show that it has VALID values, is: 2009-10-01 13:11:00.887 Whose Line[56132:207] CAKeyframeAnimation: 0x3921510 2009-10-01 13:11:00.888 Whose Line[56132:207] -- 11, 11 2009-10-01

Re: Bad stardardUserDeafaults

2009-10-01 Thread Jens Alfke
On Oct 1, 2009, at 2:19 PM, Jacob Schwartz wrote: NSMutableDictionary *defaultValues = [NSMutableDictionary dictionary]; NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@/ Users/jacobschwartz/Pictures/wallpapers]]; NSData *pathAsData = [NSKeyedArchiver

Re: Making a opaque copy of an NSImage

2009-10-01 Thread Ken Ferry
Well, maybe not completely explicitly in this case. Use -drawInRect:fromRect:operation:fraction:. operation is NSCompositeSourceOver, which is normal. The fraction is an opacity (when used with source-over). 0.75 would be 25% transparent. -Ken On Thu, Oct 1, 2009 at 1:46 PM, Kyle Sluder

Re: CAKeyframeAnimation for 'position' not working

2009-10-01 Thread David Duncan
On Oct 1, 2009, at 3:13 PM, Christopher J Kemsley wrote: Hmmm OK, so I modified it, though it still fails. The values it's now using are: So... It's producing values normalized between 0 and 1, with the first and last object being set as exactly 0 and 1, but still nothing happens...

Re: Bad stardardUserDeafaults

2009-10-01 Thread Jacob Schwartz
I right, I didn't hit reply all. So I did found out how to do the breakpoint thing and I came across this: defaults = (NSUserDefaults *) 0x100425070 pathAsData = (NSData *) 0x0 I've done enough programming to that a memory address of 0x0 is null. This was in the first line

reading (parsing) CSV (or Excel) data

2009-10-01 Thread Colin Howarth
Hi, I'd like my app ('tis progressing steadily :-) to read some simple tabular data. The original file is from Excel, but it's not too much bother to convert it to CSV. Searching the developer docs gets me gestaltGraphicsVersion which is not good, but googling cocoa csv works very well.

possible bug in webView big and small load sizes...

2009-10-01 Thread jon
I did an experiment, where i had a small window with a small webView in it... and then a large window with a large webView in it, in the same XIB file... small was like 200 pxs and the large one was nearly as large as the screen. (actually i had the same window, and ran a loop,

Re: IB webview oddity/question...

2009-10-01 Thread Mike Abdullah
All those sorts of settings are actually recorded in a WebPreferences object. If the two WebViews have the same preferences identifier then they will (by default) end up sharing the same prefs. On 1 Oct 2009, at 22:03, jon wrote: if you make a new IB project, create two new windows,

Re: reading (parsing) CSV (or Excel) data

2009-10-01 Thread Jens Alfke
On Oct 1, 2009, at 4:09 PM, Colin Howarth wrote: Before I go through the 550,000 hits (some of them quite old) dare I ask if there's one Right Way (TM) to parse this sort of data? If the data's not too huge, you can read the file into an NSString, break that into lines (there are some

Re: reading (parsing) CSV (or Excel) data

2009-10-01 Thread BareFeet
On 02/10/2009, at 10:22 AM, Jens Alfke wrote: If the data's not too huge, you can read the file into an NSString, break that into lines (there are some NSString methods for this, but I don't remember their names), and then on each line call [line componentsSeparatedByString: @,] to get the

Re: reading (parsing) CSV (or Excel) data

2009-10-01 Thread Rick Genter
On Oct 1, 2009, at 5:22 PM, Jens Alfke wrote: On Oct 1, 2009, at 4:09 PM, Colin Howarth wrote: Before I go through the 550,000 hits (some of them quite old) dare I ask if there's one Right Way (TM) to parse this sort of data? If the data's not too huge, you can read the file into an

Re: reading (parsing) CSV (or Excel) data

2009-10-01 Thread Greg Guerin
http://www.cocoadev.com/index.pl?ReadWriteCSVAndTSV That site has enough good stuff, often with links to other stuff, that it's worth using a site:cocoadev.com qualifier in your googling. Or just start there. -- GG ___ Cocoa-dev mailing

Re: Weird NSToolbar glitch

2009-10-01 Thread Rob Keniger
On 02/10/2009, at 6:08 AM, I. Savant wrote: I couldn't find it anywhere in the documentation. But the thing is, it doesn't seem like you can even move a toolbar from one window to another, even properly making sure that it never belongs to more than one at a time, without getting weird

Re: reading (parsing) CSV (or Excel) data

2009-10-01 Thread Colin Howarth
Thanks everyone! The idiot savant was first to point out the http://macresearch.org/cocoa-scientists-part-xxvi-parsing-csv-data link. And that one refers also to the cocoadev site. It seems everyone expects there to be a standard Cocoa solution, is surprised that there isn't, and develops

Re: Releasing NSSearchPathForDirectoriesInDomain causes crash

2009-10-01 Thread Adam R. Maxwell
On Oct 1, 2009, at 8:42 AM, Jens Alfke wrote: On Sep 30, 2009, at 7:37 PM, Adam R. Maxwell wrote: Does the Cocoa memory management documentation cover functions? It specifically refers to ...a method whose name begins with I wonder if something like the CF Create rule applies to

Re: [Enigmatic semi-solution] Re: Cannot get pixel color from NSBitmapImageRep

2009-10-01 Thread Adam R. Maxwell
On Oct 1, 2009, at 11:19 AM, Ken Ferry wrote: Hi David, Oh, yes, you're right. In the bitmapData, the first row is the top row. -getPixelAtX:y:, -setPixelAtX:y:, -getColorAtX:y: and setColorAtX:y: are the same. The first row is the top. Sorry that's confusing. It might be nice if

converting a NSView into an NSImage, when scaling via scaleUnitSquareToSize ...

2009-10-01 Thread Martin Redington
In order to work around the some of the issues I've been encountering when scrolling scaled NSTextView's, I've been looking at capturing the NSTextView as an NSImage, and using that instead (which would meet my requirements). I've tried the usual approaches (see below), but none of them are

odd behavior with NSError?

2009-10-01 Thread Colin Howarth
Hi, I'm trying to read a file using this code, which is failing: NSStringEncoding *enc; NSError *error; NSString *file = [NSString stringWithContentsOfFile:@/Users/colin/ developer/Trace/glass.csv usedEncoding:enc error:error]; NSLog(@%i: %@,

Re: odd behavior with NSError?

2009-10-01 Thread Kyle Sluder
Because userInfo is a dictionary and is obviously not what you want. Using `po` winds up calling -description, which for NSError returns a synthesis of its localizedDescription, localizedFailureReason, localizedRecoveryOptions, and localizedRecoverySuggestion. So if you want that info, just log

Re: odd behavior with NSError?

2009-10-01 Thread Quincey Morris
On Oct 1, 2009, at 20:31, Colin Howarth wrote: Why is my NSLog statement being so unhelpful??? Try logging [error localizedDescription] instead. That's what the debugger's showing you. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: UIGraphicsBeginImageContext thread safety

2009-10-01 Thread Andrew
Hi glenn, what is it doing that renders it not thread safe, does anyone know? At the very least, it needs to call UIGraphicsPushContext to set the current ui graphics context, which is documented as needing to be done on the main thread (which implies that there is a single, global ui

Changing an NSToolbar Identifier

2009-10-01 Thread Matthias Arndt
Hi Markus, The background for this is as follows: I have a new version of an application that shares its app ID with the previous version. The toolbar in question is saving its state (using the Autosaves configuration setting in IB). The new version introduces additional items that are

NSArrayController filtering

2009-10-01 Thread Russell Gray
I am implementing filtering in an array of NSDictionaries. I have it connected in bindings, and I can successfully return searches of the keys in the top level NSDictionary. I would like to however return search results from a sub dictionary. does this make sense?, and is it possible?

Re: odd behavior with NSError?

2009-10-01 Thread Stephen J. Butler
On Thu, Oct 1, 2009 at 10:31 PM, Colin Howarth co...@howarth.de wrote:        NSStringEncoding *enc;        NSError *error;        NSString *file = [NSString stringWithContentsOfFile:@/Users/colin/developer/Trace/glass.csv usedEncoding:enc error:error]; The way you pass enc is also wrong.

Re: [iPhone] Application running for the very first time...

2009-10-01 Thread James Lin
Thank you for the code snipet, but I am confused at the logic here... the following code will be executed EVERY time the program runs, right? NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] initWithCapacity:10]; [dictionary setObject: [NSNumber numberWithBool:YES]

Re: [iPhone] Application running for the very first time...

2009-10-01 Thread James Lin
Thank you for the code snipet, but I am confused at the logic here... the following code will be executed EVERY time the program runs, right? NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] initWithCapacity:10]; [dictionary setObject: [NSNumber numberWithBool:YES]