Re: NSImage and NSBitmapImageRep

2010-03-16 Thread Ken Ferry
You'd add an NSBitmapImageRep to an NSImage with -[NSImage addRepresentation:]. However, an NSImage is not going to be any easier to draw rotated than an NSBitmapImageRep. You can draw rotated by changing the coordinate system right before you draw your image, drawing, and putting it back. See

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

NSImage and NSBitmapImageRep

2010-03-16 Thread Martin Beroiz
Hello everybody, I have a question relating NSImage and NSBitmapImageRep. I have a stream of data that I want to display in a view and it's not in any standard image format. So I created an NSBitmapImageRep, then I filled the bitmapdata with the data and drew it in the view with drawInRect: met

Re: Blocked Reads

2010-03-16 Thread Don Quixote de la Mancha
On Tue, Mar 16, 2010 at 9:26 PM, colors wrote: > I have also considered making SCSI Read calls or USB Read calls, but it looks > like I will only be allowed to do this if I make my own kext. If you are able to interpret the CD's filesystem on your own, would it work to read the CD's sectors from

Re: Creating a console view

2010-03-16 Thread Rick Mann
Thanks, Martin. I ended up doing this: NSAttributedString* as = [[NSAttributedString alloc] initWithString: s attributes: attrs]; NSTextStorage* text = self.output.textStorage; [text beginEditing]; [text appendAttributedString: as]; [text endEditing];

Re: Creating a console view

2010-03-16 Thread Martin Hewitson
Hi Rick, I assume 'output' is your NSTextView. Right? Firstly, you can append text more easily by doing: 1) [output insertText:mystring]; or 2) [[output textStorage] appendAttributedString:myAttributedString]; To get changes to show up, try [output didChangeText]; You might not need that

Blocked Reads

2010-03-16 Thread colors
I am running into a problem with anti-virus software. I need to be able to read a file from a USB CD and I need the read to actually go over the USB bus. I have been just doing fopen, fread, fclose, etc. and that all works; although, I do set the file to F_NOCACHE with fcntl to make sure that I

Re: Creating a console view

2010-03-16 Thread Rick Mann
On Mar 16, 2010, at 19:24:17, Jens Alfke wrote: > > On Mar 16, 2010, at 7:13 PM, Rick Mann wrote: > >> There's no warning because there's no difference between >> NSString* existingText = self.output.string; >> and >> NSString* existingText = [self.output string]; > > Actually I misr

Re: Creating a console view

2010-03-16 Thread Jens Alfke
On Mar 16, 2010, at 7:13 PM, Rick Mann wrote: > There's no warning because there's no difference between > NSString* existingText = self.output.string; > and > NSString* existingText = [self.output string]; Actually I misread your code and thought you were calling -replaceCharacters

Re: Creating a console view

2010-03-16 Thread Rick Mann
On Mar 16, 2010, at 18:55:02, Jens Alfke wrote: > > On Mar 16, 2010, at 6:19 PM, Rick Mann wrote: > >> I'm currently using an NSTextView, and calling the following to append text: >> >> NSString* existingText = self.output.string; >> NSRange r = NSMakeRange(existingText.length, 0); >> [se

Re: Creating a console view

2010-03-16 Thread Jens Alfke
On Mar 16, 2010, at 6:19 PM, Rick Mann wrote: > I'm currently using an NSTextView, and calling the following to append text: > >NSString* existingText = self.output.string; >NSRange r = NSMakeRange(existingText.length, 0); >[self.output replaceCharactersInRange: r withString: s]; Th

Creating a console view

2010-03-16 Thread Rick Mann
Some time ago, I created a little console in my app, displaying characters received on a serial port. For the life of me, I can't find that app to see how I did it. I'm currently using an NSTextView, and calling the following to append text: NSString* existingText = self.output.string;

One NSTextView, several model objects - how to synchronise undo manager

2010-03-16 Thread Rui Pacheco
Hi all, I've a window with a fairly complex layout - one NSTextView and several tables, all displaying different types of data. To keep things in order, I've created a model object that holds the data for all these interface elements. The window may also hold several instances of the model object

Re: Nil items in NSMutableSet

2010-03-16 Thread Alejandro Rodriguez
I agree with the arguments against swizzling. While I'm not yet convinced that the isEqual: problem is what really is causing my crash I do feel that the way I'm using the NSSet and the objects is too hackish for the stability and quality I want to achive in my app (as the docs say: don't f

Re: app window that doesn't deactive the current app

2010-03-16 Thread Steven Degutis
Please refer to this article: http://stackoverflow.com/questions/1657659/cocoa-nsstatusbar-global-hotkey =Steven On Tue, Mar 16, 2010 at 3:16 PM, Martin Batholdy wrote: > Hi, > > I would like to have a window that pops up via a shortcut. > This window should be in background and the active app

Re: Nil items in NSMutableSet

2010-03-16 Thread Steven Degutis
Daniel, Method swizzling is fine for debugging purposes, but should not be used in production code. This has already been said by some people who really, really know what they're talking about. And it's *very* dangerous to swizzle something on NSString. The first reason (of many) that comes to mi

Re: Cut and paste out of/ into text fields in a separate window doesn't work

2010-03-16 Thread Steven Degutis
When I say it "isn't a native Cocoa app", I mean to say it doesn't use standard widgets. Anyone who is experienced with Safari and Finder and other native Mac apps, and tries out Firefox for Mac for the first time, will notice almost instantly that Firefox is implementing things on their own. Yes,

Re: Nil items in NSMutableSet

2010-03-16 Thread Clark Cox
Doing this with a class cluster like NSString would be difficult and especially fragile, as you'd have to make sure to do the appropriate swizzling for every hidden subclass of NSString that might have its own implementation of -isEqual:; including those that may be introduced (or removed) in updat

Re: Cocoa Newbie Thread/Memory Problems

2010-03-16 Thread Quincey Morris
On Mar 16, 2010, at 14:38, Dave wrote: > myURLString = [self myURLString:kBaseURL > ForDate:myCurrentDate UsingDatabase:@"rs_main"]; Do you mean 'self makeURLString:', the method whose implementation you showed? > [mParserBase myURLString ForStructure

Re: Nil items in NSMutableSet

2010-03-16 Thread Daniel DeCovnick
There was a thread on this list a few days ago about effective method swizzling into Apple classes. Despite being replete with warnings about "Don't use it in production code," it IS doable, and very, very cool, IMHO. -Dan On Mar 16, 2010, at 2:18 PM, Alejandro Rodriguez wrote: You were

Anyone using IKImageView?

2010-03-16 Thread Brian Postow
I have an IKImageView inside a Scrollview (actually a bit of a scrollview work-around, in order to get the scrollbars to actually appear and disappear correctly) and I'm trying to use the select tool. However, the select box isn't appearing in the correct place when the imageView isn't exactly

Re: Nil items in NSMutableSet

2010-03-16 Thread Alejandro Rodriguez
Yeah I could experiment with Method Swizzling but that is just playing dirty. I will follow your advice and just move away from this implementation into something nicer like a dictionary. After all I can always do [dict valueForKey:[ob objectId]]; to get the same result as [set member:ob] Tha

Re: Nil items in NSMutableSet

2010-03-16 Thread Clark Cox
On Tue, Mar 16, 2010 at 2:18 PM, Alejandro Rodriguez wrote: > You were right, my equality is not transitive. > > id ob = [[objectClass alloc] initWithId:@"hello"]; > [ob isEqual:@"hello"]; //returns YES > [@"hello" isEqual:ob]; //returns NO > > That may very well be the problem... now... I have no

Re: NSTrackingArea Problem

2010-03-16 Thread Gustavo Pizano
Now that you mention this I have a similar problem in a view. in my loadDidMoveToWindow I create the tracking areas referring the frame of some labels in the view, but the mouseEntered is not trigger unless I click one of the labels. I tried making the view the first responder, and overriding

Re: Cocoa Newbie Thread/Memory Problems

2010-03-16 Thread Dave
Hi Quincey, I added a call is NSLog() after each of the string assignment and it seems to work! At least I get sensible values for the fields. However, there still seems to be a problem. I need to make several URL calls when the button is clicked, so I changed the top-level button handler

Re: Nil items in NSMutableSet

2010-03-16 Thread Jens Alfke
On Mar 16, 2010, at 2:18 PM, Alejandro Rodriguez wrote: [ob isEqual:@"hello"]; //returns YES [@"hello" isEqual:ob]; //returns NO That may very well be the problem... now... I have no idea on how I will make the second test return YES. You can't do that in Objective-C, unfortunately. It wou

Re: Nil items in NSMutableSet

2010-03-16 Thread Alejandro Rodriguez
You were right, my equality is not transitive. id ob = [[objectClass alloc] initWithId:@"hello"]; [ob isEqual:@"hello"]; //returns YES [@"hello" isEqual:ob]; //returns NO That may very well be the problem... now... I have no idea on how I will make the second test return YES. doesn't that dep

Re: Nil items in NSMutableSet

2010-03-16 Thread Alejandro Rodriguez
Thats a very interesting take on the problem. I'm going to look into that. Make sure that isEqual: returns the same both ways. Thanks and I'll let you know how it goes. I can't really reproduce the issue so I won't know if it's fixe but at least I'll test the commutativity of the comparison. C

Re: setting NSScrollView content width to NSText width

2010-03-16 Thread Martin Hewitson
Hi Dave, I'm not sure I've understood exactly, but perhaps the following get's you going in the right direction: [textView setHorizontallyResizable:YES]; [[textView textContainer] setWidthTracksTextView:NO]; [textView setMaxSize:NSMakeSize(1, FLT_MAX)]; Best wishes,

setting NSScrollView content width to NSText width

2010-03-16 Thread David Alter
I dynamically create a NSScrollView and place and NSTextView inside of it. I want the width of the content view to expand with the text. Basically the same way the xCode editor works. The horizontal scroll bar adjusts as texts is added. The width of the content view is the width of the longest line

Re: NSTrackingArea Problem

2010-03-16 Thread Quincey Morris
On Mar 16, 2010, at 11:34, Richard Somers wrote: > Consider a view with a mouse moved tracking area. When the view is created > and placed on screen, if the mouse is already inside the view, tracking does > not begin until the mouse exits and re-enters the view. Does anyone know how > to get tr

app window that doesn't deactive the current app

2010-03-16 Thread Martin Batholdy
Hi, I would like to have a window that pops up via a shortcut. This window should be in background and the active app shouldn't get inactive. How is that possible? I have seen that in the Clips app (http://conceitedsoftware.com/products/clips ). thanks!

Re: File Backup Date

2010-03-16 Thread gMail.com
Yes, but I need just the last backup date to understand whether the file has been modified after the last backup. If both the source and destination files have been modified after the last backup date, I ask the user for what to do (replace src or dst). Da: "Eric E. Dolecki" Data: Tue, 16 Mar

Re: Nil items in NSMutableSet

2010-03-16 Thread Clark Cox
On Tue, Mar 16, 2010 at 11:35 AM, Thomas Davie wrote: >> Your code doesn't account for the possibility that the order of >> comparison might happen in the other order (i.e. [@"123" isEqual: >> object]). I wouldn't be surprised if NSSet is assuming that equality >> is transitive (i.e. [a isEqual: b

Improving moving view animation

2010-03-16 Thread Gustavo Pizano
Hello all. I have 2 views (one is hidden, or out of the super view frame) and when I click on button that hidden view shows up and the other one resizes, if I clcik the button again, it happens the opposite one hides and the other resizes So all it s working, and its ok, but somehow I see t

Re: Nil items in NSMutableSet

2010-03-16 Thread Thomas Davie
> Your code doesn't account for the possibility that the order of > comparison might happen in the other order (i.e. [@"123" isEqual: > object]). I wouldn't be surprised if NSSet is assuming that equality > is transitive (i.e. [a isEqual: b] == [b isEqual: a]). For reference, this property is not

Re: NSTrackingArea Problem

2010-03-16 Thread Richard Somers
On Mar 15, 2010, at 5:53 PM, Quincey Morris wrote: tracking isn't going to start reliably until you exit and re-enter the area. Consider a view with a mouse moved tracking area. When the view is created and placed on screen, if the mouse is already inside the view, tracking does not begin

Re: Little HELP with a fetch Request in Core Data

2010-03-16 Thread Alexander Spohr
Try toInvoices.toStatus.statusID = 1001 in your NSPredicate. atze Am 16.03.2010 um 14:02 schrieb Gustavo Pizano: > Hello. > > Well this may be the simplest question ever, but somehow I can't find the > answer. > > I have an entity User, which has a relationShip to-many Invoices, and

Re: Nil items in NSMutableSet

2010-03-16 Thread Clark Cox
On Tue, Mar 16, 2010 at 11:06 AM, Alejandro Rodriguez wrote: > Hello Clark, > > The objects in the set are NSObject subclasses that have a NSString readonly > property (messageId) and are always initialized through initWithMessageId: > where that value is set and never changed. > > The hash and

Re: Nil items in NSMutableSet

2010-03-16 Thread Alejandro Rodriguez
Hello Clark, The objects in the set are NSObject subclasses that have a NSString readonly property (messageId) and are always initialized through initWithMessageId: where that value is set and never changed. The hash and isEqual methods are as follows: - (NSUInteger)hash{ return (mes

Re: Cocoa Newbie Thread/Memory Problems

2010-03-16 Thread Quincey Morris
On Mar 16, 2010, at 09:57, Dave wrote: > At present I am not doing anything with the result, except assigning the > values so I can look at them in the debugger. The problem is that when I look > at the items in the array passed to the view controller the data retrieved is > not as it should be

Re: Nil items in NSMutableSet

2010-03-16 Thread Clark Cox
On Tue, Mar 16, 2010 at 10:28 AM, Alejandro Rodriguez wrote: > Hello All, > >        I am using NSMutableSet quite extensively in my app mostly just adding > items to it and reading them (almost never removing). However sometimes it > crashes under very interesting conditions. I can't reliable r

Re: Changing appearance of NSDatePicker?

2010-03-16 Thread Jeffrey Oleander
> On Tue, 2010/03/16, Ben Golding wrote: > From: Ben Golding > Subject: Changing appearance of NSDatePicker? > To: "Cocoa-Dev List" > Date: Tuesday, 2010 March 16, 2:10 AM > Is it possible to change the way the dates are > presented in NSDatePicker in graphical mode?  > In my app I have a calend

Re: File Backup Date

2010-03-16 Thread Jim Correia
On Mar 16, 2010, at 12:09 PM, gMail.com wrote: > Anyway, I have noticed that if in the Finder (MacOS X 10.6.2) I open a file > which contains a backup date, then I modify the content and I save it, the > backup date disappears. What are you using to modify the content of the file? Consider the po

Nil items in NSMutableSet

2010-03-16 Thread Alejandro Rodriguez
Hello All, I am using NSMutableSet quite extensively in my app mostly just adding items to it and reading them (almost never removing). However sometimes it crashes under very interesting conditions. I can't reliable recreate the issue but sometimes I get a 'attempted to insert nil' exc

Re: Core Animation and interaction

2010-03-16 Thread Kyle Sluder
On Tue, Mar 16, 2010 at 5:16 AM, john fogg wrote: > Photos need to be in layers as well so I can change the stacking > order. Do I use CoreAnimation for this? There's a CoreAnimation sample project that does just this, called LightBoard. --Kyle Sluder

Soap Response Delay

2010-03-16 Thread Mustafa Tuğrul Özşahin
Hi, I am trying to get some information from a web service using soap request. When it returns a small amount of data (like a few lines of XML), it works fine but when it returns a large data (like an image coded as a byte array), the second request responses after a 25-30 second delay. If i wait

Cocoa Newbie Thread/Memory Problems

2010-03-16 Thread Dave
Hi All, I adapted the sample code of "XMLPerformance" as a basis to start my own app. This is for the iPhone but I think it's a general problem with my understanding of Cocoa Memory Management and/or Threading. Basically I have a VewController with a button on it and when the user clicks

Re: File Backup Date

2010-03-16 Thread Eric E. Dolecki
I have no experience here, but if you are resaving the file, won't the next time it's backed up add a new backup date to the file? On Tue, Mar 16, 2010 at 12:09 PM, gMail.com wrote: > Hi, > as you know fileAttributesAtPath contains the creation date and the > modification date, but it doesn't con

File Backup Date

2010-03-16 Thread gMail.com
Hi, as you know fileAttributesAtPath contains the creation date and the modification date, but it doesn't contain the backup date (and even the lastAccessDate). So, I use FSGetCatalogInfo with kFSCatInfoBackupDate. It works well. Anyway, I have noticed that if in the Finder (MacOS X 10.6.2) I open

Re: Button width should accomodate localized string

2010-03-16 Thread Oftenwrong Soong
On Mon, November 30, 2009 2:53:08 PM, Ricky Sharp wrote: > On Nov 29, 2009, at 9:52 AM, glenn andreas wrote: >> On Nov 29, 2009, at 9:38 AM, Symadept wrote: >>> How can I scale my button or Label to be able to accomodate the localized >>> string? >>> >> That's the whole purpose of being able to

Re: first time launch message

2010-03-16 Thread Jens Alfke
On Mar 16, 2010, at 6:16 AM, Rick C. wrote: > normally after downloading an app via safari upon first launch it will give > the message to the effect of "this is the first launch of something > downloaded from the internet do you really want to open etc." i think you > know what i'm referring

Re: first time launch message

2010-03-16 Thread Sean McBride
On Tue, 16 Mar 2010 06:16:03 -0700, Rick C. said: >normally after downloading an app via safari upon first launch it will >give the message to the effect of "this is the first launch of something >downloaded from the internet do you really want to open etc." i think >you know what i'm referring to

Re: mount dmg disk

2010-03-16 Thread Aaron Burghardt
On Mar 14, 2010, at 3:42 PM, Don Quixote de la Mancha wrote: > On Sun, Mar 14, 2010 at 12:22 PM, gMail.com wrote: >> I can't find a way in Cocoa to mount a dmg disk. >> So I would try to call the shell through a NSTask. > > I think you really want to do that via the APIs in the Disk > Arbitratio

Re: Use of KVC Array operators

2010-03-16 Thread Aaron Burghardt
On Mar 12, 2010, at 6:13 PM, Eli Bach wrote: > It's not a problem. In retrospect, doing this would mean that KVO would need > to automagically observe two 'levels' for changes, which seems to me to be > unlikely for KVO to do. > > I've decided to short-circuit the problem by adding a direct r

Re: UIApplication terminate?

2010-03-16 Thread Luke the Hiesterman
On Mar 16, 2010, at 1:41 AM, Steve Cronin wrote: > Folks; > > I have an iPhone application that is used for a very specific purpose. > > After perusing and modifying data the user is given the option to effectively > [Cancel] or [Save] > > After they have made their decision the app's purpo

first time launch message

2010-03-16 Thread Rick C.
hello, normally after downloading an app via safari upon first launch it will give the message to the effect of "this is the first launch of something downloaded from the internet do you really want to open etc." i think you know what i'm referring to. my question is a project i'm working on s

Little HELP with a fetch Request in Core Data

2010-03-16 Thread Gustavo Pizano
Hello. Well this may be the simplest question ever, but somehow I can't find the answer. I have an entity User, which has a relationShip to-many Invoices, and Invoices have a relation to-Status, So I have a ManagedObject Im getting for the selection of the NSArrayController, and I want to chec

Re: Core Animation and interaction

2010-03-16 Thread Tom
> > So every photo needs to respond to mouse events. Do I make every photo > into its own view? Or are views too expensive to create? I want to > easily support 100+ photos or more. (I will downsample the images for > performance.) > In my experience using many views for similar functionality dras

Core Animation and interaction

2010-03-16 Thread john fogg
Hi there, in my app I want to have a light table to sort photos. Basically it's just a huge view with lots of photos in it and you can drag the photos around. Photos can overlap, they don't fall into a grid like in iPhoto. So every photo needs to respond to mouse events. Do I make every photo int

Re: NSManagedObject awakeFromFetch not sent on secondary thread?

2010-03-16 Thread Tom
Hi Sorry, I wasn't explicit enough in my mail - my operation does have it's own context, and when I fetch against it, awakeFromFetch is not sent, so my initialization code doesn't get executed. The operation is added to a custom (i.e. not main one) NSOperationQueue, which does have max concurrency

Re: UIApplication terminate?

2010-03-16 Thread Peter Blazejewicz
Hello Steve, On Tue, Mar 16, 2010 at 9:41 AM, Steve Cronin wrote: > Folks; > > I have an iPhone application that is used for a very specific purpose. > > After perusing and modifying data the user is given the option to effectively > [Cancel]  or  [Save] > > After they have made their decision t

Re: UIApplication terminate?

2010-03-16 Thread Roland King
I think to follow the HIG you need to have the application quit with the home screen button. So that rather means after you have saved or cancelled, the app should show a simple screen which is clearly 'the end' perhaps with text telling them to press the home button. I've seen comments that e

Re: UIApplication terminate?

2010-03-16 Thread Joanna Carter
Hi Steve > After they have made their decision the app's purpose has been served for > this instance. > What I would like to do is exit gracefully. > > Back in the day you could [NSApp terminate] and all notifications etc were > broadcast and an orderly end was accomplished. > > I don't want t

UIApplication terminate?

2010-03-16 Thread Steve Cronin
Folks; I have an iPhone application that is used for a very specific purpose. After perusing and modifying data the user is given the option to effectively [Cancel] or [Save] After they have made their decision the app's purpose has been served for this instance. What I would like to do is e

Changing appearance of NSDatePicker?

2010-03-16 Thread Ben Golding
Is it possible to change the way the dates are presented in NSDatePicker in graphical mode? In my app I have a calendar with a list of events in it, when the user selects a date in the date picker it shows which events occur on that day. I'd like to offer a visual clue about which dates have