Re: NSTableView and OutineView resizing bugs

2009-08-23 Thread Ernesto Giannotta
On 23/ago/09, at 04:33, Adam R. Maxwell wrote: On Aug 21, 2009, at 1:45 PM, Ernesto Giannotta wrote: After a lot of tests I've noticed that this bug is greatly reduced if drawsBackground is set to false, but I still can see a white line and a ghost right image while enlarging. Have you

Problem with unbind:

2009-08-23 Thread Martin Hewitson
Dear list, I've been trying to do some programmatic bindings because I want to change a binding depending on the state of a check box. In more detail, I have an NSArrayController whose contents I want to bind to either all entities of a particular type in the MOC, or to a subset of those.

Re: Problem with unbind:

2009-08-23 Thread Martin Hewitson
I've found what may be considered a workaround. I can unbind the Content Set then use a fetch request and setContent: to get back the full list. The code looks like: NSManagedObjectContext *moc = [self managedObjectContext]; NSFetchRequest *request = [[NSFetchR

NSAttributedString and Scripting Bridge

2009-08-23 Thread Graham Cox
I've successfully used Scripting Bridge to pass plain text and attachments to Mail for sending, as part of an internal (non public) app. I'd like if possible to send mail as rich text. I have the message as an NSAttributedString, and can easily get this as all sorts of formats, such as RT

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

2009-08-23 Thread Houdah - ML Pierre Bernard
Just ran into the same problem and came up with HHValidatedButton: http://www.bernard-web.com/pierre/blog/index.php?id=6542976061063123843 Pierre Bernard On Jul 1, 2009, at 11:24 PM, Bill Cheeseman wrote: For years, the "Implementing Validation" section of Apple's "User Interface Validation"

Making an NSTableView Display Articles From An RSS Feed.

2009-08-23 Thread Joshua Garnham
How would I make an NSTableView display an RSS Feed (just one)? I think it would have something to do with NSURL and Setting the Table Views Data Source. But how exactly would I do this? Cheers, Josh. ___ Cocoa-dev mailing list (Cocoa-dev@lists.a

How to interact with Web pages using Cocoa?

2009-08-23 Thread albert jordan Mobility
folks, I am trying to write a test program that will be entering configuration data on a web page and press a button in the web page continuously. Is there a proven method to do this with Objective C? Thanks in advance. Regards, Albert ___ Co

leak in a sound function

2009-08-23 Thread Agha Khan
Hi: I have a function where I am calling Apple provided sound function. I have only 2 sounds in my IPhone project. This function play the sounds correctly. When I call this function 2nd time I get a leak. I am unable to figure out what I am doing wrong. Please note if I call this function

Re: Making an NSTableView Display Articles From An RSS Feed.

2009-08-23 Thread Kyle Sluder
On Aug 23, 2009, at 8:04 AM, Joshua Garnham wrote: But how exactly would I do this? It's easy! You just write the code to do it. Simple as that. Seriously, you need to break down your problem. It involves getting the contents of an RSS feed and displaying these contents in an NSTableVi

Re: leak in a sound function

2009-08-23 Thread Kyle Sluder
On Aug 23, 2009, at 9:53 AM, Agha Khan wrote: + (void) PlaySound:(int) Index Method names should begin with lowercase letters. Classes really are the only things in ObjC that are typically capitalized. Also you should be using the NSUInteger typedef here. NSBundle* bundle = [NSBundle

Re: How to interact with Web pages using Cocoa?

2009-08-23 Thread Kyle Sluder
On Aug 23, 2009, at 8:04 AM, albert jordan Mobility wrote: I am trying to write a test program that will be entering configuration data on a web page and press a button in the web page continuously. Is there a proven method to do this with Objective C? WebKit. --Kyle Sluder

Running shell scripts as root.

2009-08-23 Thread PCWiz
I know this is a bad idea, but I'm not sure how else to do this. I have an app that needs to set permissions on a lot of files on a USB stick. The obvious way to do this is to write a shell script and then execute it with elevated privileges. This is clearly not a safe way to do it as it co

Re: leak in a sound function

2009-08-23 Thread Agha Khan
Thank you All. I came from Windows and this is my first project with Objective-C. I am looking Mac provided file SoundEngine.cpp about line 770 OSStatus LoadTrack(const char* inFilePath, Boolean inAddToQueue, Boolean inLoadAtOnce) I realized we are creating pointer to BG_FileInfo pointer and

Re: Making an NSTableView Display Articles From An RSS Feed.

2009-08-23 Thread PCWiz
Saw this same question on stackoverflow.com, not sure if that's a coincidence. But yeah, you would have to set up a data source for your table view and then parse the XML (Look up NSXMLDocument and NSXMLParser). This might help: http://weblog.bignerdranch.com/?p=48 On 2009-08-23, at 9:04 AM

Re: leak in a sound function

2009-08-23 Thread Agha Khan
Now there was no need to create static either. if (fileInfo) delete fileInfo; Just add before returning that function. That is a bug in Mac files. Best regards Agha On Aug 23, 2009, at 11:37 AM, Agha Khan wrote: Thank you All. I came from Windows and this is my first project with Objective-C

Re: Running shell scripts as root.

2009-08-23 Thread I. Savant
On Aug 23, 2009, at 2:31 PM, PCWiz wrote: Basically I need to run the chown/chmod utilities and probably cp/mv/ mkdir as well using root privileges. What would be the best way to do this? http://developer.apple.com/referencelibrary/GettingStarted/GS_Security/ Pay particular attention to

Re: Making an NSTableView Display Articles From An RSS Feed.

2009-08-23 Thread Nathan Kinsinger
On Aug 23, 2009, at 12:48 PM, PCWiz wrote: Saw this same question on stackoverflow.com, not sure if that's a coincidence. But yeah, you would have to set up a data source for your table view and then parse the XML (Look up NSXMLDocument and NSXMLParser). This might help: http://weblog.bigne

Re: leak in a sound function

2009-08-23 Thread Mohsan Khan
On 2009-08-23, at 20:37, Agha Khan wrote: I also tried NSBundle* bundle = [[NSBundle mainBundle] retain]; Why are you trying to retain? The documentation says "+ (NSBundle *)mainBundle" - its static and you didn't create (alloc, new) the *bundle instance, therefor you don't own it, and th

Re: Core Animation + Garbage Collection

2009-08-23 Thread Kevin Cathey
Have you enabled "wants layer" for the view? Kevin -- Kevin Cathey On 22 Aug 2009, at 22:21, Evan M wrote: So, it isn't Garbage Collection + Core Animation that is breaking the transition, I just refactored my entire project to remove GC support (big pain) and the

Re: Core Animation + Garbage Collection

2009-08-23 Thread Kyle Sluder
On Aug 23, 2009, at 1:00 PM, Kevin Cathey wrote: Have you enabled "wants layer" for the view? And if you have, have you made sure to provide a custom layer *before* calling -setWantsLayer:? The default AppKit provided layer is Not Yours to touch. --Kyle Sluder ___

Re: Making an NSTableView Display Articles From An RSS Feed.

2009-08-23 Thread I. Savant
On 2009-08-23, at 9:04 AM, Joshua Garnham wrote: How would I make an NSTableView display an RSS Feed (just one)? I think it would have something to do with NSURL and Setting the Table Views Data Source. But how exactly would I do this? Cheers, Josh. Start here: http://developer.apple.c

Confusion over erratic behavior in Xcode debugging

2009-08-23 Thread Chase Meadors
This issue has been bothering me. I'm experience some weird behavior when debugging with Xcode with breakpoints. Basically, the highlighted current code line seems to jump around erratically. It's almost like it has to go through a declaration/initialization twice to actually register it.

Re: Confusion over erratic behavior in Xcode debugging

2009-08-23 Thread I. Savant
On Aug 23, 2009, at 4:45 PM, Chase Meadors wrote: This issue has been bothering me. I'm experience some weird behavior when debugging with Xcode with breakpoints. This is not Cocoa-related. It belongs on the xcode-users list, not cocoa-dev. -- I.S. __

Re: Running shell scripts as root.

2009-08-23 Thread Jerry Krinock
On 2009 Aug 23, at 11:57, I. Savant wrote: On Aug 23, 2009, at 2:31 PM, PCWiz wrote: Basically I need to run the chown/chmod utilities and probably cp/ mv/mkdir as well using root privileges. What would be the best way to do this? http://developer.apple.com/referencelibrary/GettingStarte

Re: Running shell scripts as root.

2009-08-23 Thread I. Savant
On Aug 23, 2009, at 5:33 PM, Jerry Krinock wrote: Anyhow, I added two new tools, HelperToolTaskDoSetPermissions and HelperToolTaskDoCopyFiles, to my BetterAuthorizationSample wrapper. Awesome, Jerry, thanks for that! Looks to be quite useful. I admit I have limited experience with this, s

Solution: Dynamically creating an image with transparent portions.

2009-08-23 Thread Jay Reynolds Freeman
About a month ago I asked a question here that had to do with dynamically creating -- at run time -- new instances of NSImage with portions that were partially or wholly transparent. Thanks to the help received, I solved my problem by another means, but I eventually did find out that there

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

2009-08-23 Thread Bill Cheeseman
On Aug 23, 2009, at 9:39 AM, Houdah - ML Pierre Bernard wrote: Just ran into the same problem and came up with HHValidatedButton: http://www.bernard-web.com/pierre/blog/index.php? id=6542976061063123843 I actually came up with the answer after this thread died

Re: Core Animation + Garbage Collection

2009-08-23 Thread Rob Keniger
On 24/08/2009, at 6:24 AM, Kyle Sluder wrote: Have you enabled "wants layer" for the view? And if you have, have you made sure to provide a custom layer *before* calling -setWantsLayer:? The default AppKit provided layer is Not Yours to touch. Why's that? It seems to work fine in all m

Sound files needed

2009-08-23 Thread DKJ
I just need one more thing to finish my application: five .aiff sound files. Each of them needs to have three properties: (1) Be one second in duration. (2) Play a 3-pulse Morse code sequence (DAH-dit-DAH etc.). And here's the tricky bit: (3) Play at a frequency of 19,000 Hertz. I've managed

[OT] Re: Sound files needed

2009-08-23 Thread I. Savant
On Aug 23, 2009, at 7:53 PM, DKJ wrote: I've downloaded the Audacity application, but the best I can get from it seems to be 12,000 Hertz. Other programmes I've tried (demo versions mostly) won't let me set an absolute frequency. Your question has nothing at all to do with Cocoa developm

Confusion about custom UITableViewCell

2009-08-23 Thread Chris Idou
I'm trying to make a custom UITableViewCell, but the way I'm doing it, all the drawing of the table seems to be screwed up. The view seems to be working in some sense, because I can see the data, but only one row at the bottom can be seen and things are generally screwed up when scrolling. This

Re: Syntax Coloring?

2009-08-23 Thread BareFeet
Hi Keita, Hello, I'm writing a code editor and so far, i've been using Flex for regex-matching the whole document every time the text is changed and coloring appropriately... How are you doing this? How did you incorporate Flex or regex-matching? I approached it using regex to parse the quote

Re: Core Animation + Garbage Collection

2009-08-23 Thread Kyle Sluder
On Aug 23, 2009, at 4:34 PM, Rob Keniger wrote: Why's that? It seems to work fine in all my testing. There are cases where it breaks. Providing your own layer is the defining difference between a layer- backed and a layer-hosting view. AppKit makes certain assumptions about the underlying

Re: Bindings & Reverting Properties

2009-08-23 Thread Dave Keck
For the archives... The cleanest way I've found to get around my problem is best illustrated with some example code: = - (void)setHappy: (BOOL)newHappy { BOOL oldHappy = happy; happy = newHappy; if (![self save]) { // Do the revert now happy = o

Re: Core Animation + Garbage Collection

2009-08-23 Thread Evan M
Kevin, Yes, wantsLayer is enabled. -- Evan On Aug 23, 2009, at 4:00 PM, Kevin Cathey wrote: Have you enabled "wants layer" for the view? Kevin -- Kevin Cathey On 22 Aug 2009, at 22:21, Evan M wrote: So, it isn't Garbage Collection + Core Animation that is breakin

Re: Core Animation + Garbage Collection

2009-08-23 Thread Evan M
Kyle, I don't have a custom layer, I'm animating the transition between two NSViews. -- Evan On Aug 23, 2009, at 4:24 PM, Kyle Sluder wrote: On Aug 23, 2009, at 1:00 PM, Kevin Cathey wrote: Have you enabled "wants layer" for the view? And if you have, have you made sure to provide a c

I am not sure which message I have to trust?

2009-08-23 Thread Agha Khan
Hi: When I am using emulator there is no leak, but when I run on device, it looks like there is a leak. I am unable to figure out why it so nor I was able to find the source. Thanks in advance. Agha ___ Cocoa-dev mailing list (Cocoa-dev@lists.ap

readInBackgroundAndNotify not working?

2009-08-23 Thread PCWiz
Hi, I'm using this code to get a notification when a file has been updated: - (void)startReading { NSString *logPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Logs/MyTestApp.log"]; NSFileHandle *fh = [NSFileHandle fileHandleForReadingAtPath:logPath]; NSNotificati

Re: readInBackgroundAndNotify not working?

2009-08-23 Thread Kyle Sluder
On Aug 23, 2009, at 7:42 PM, PCWiz wrote: name:@"NSFileHandleReadCompletionNotification" NSFileHandleReadCompletionNotification is the name of a constant, not necessarily its value. In general, there are very few cases where notification names, dictionary keys, and other known

Re: readInBackgroundAndNotify not working?

2009-08-23 Thread Kyle Sluder
On Aug 23, 2009, at 7:42 PM, PCWiz wrote: NSString *logPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Logs/MyTestApp.log"]; Also don't do this. Use NSSearchPathForDirectoriesInDomains. Hardcoding paths is bad form. --Kyle Sluder

Re: DOMNode problems getting info out...

2009-08-23 Thread jon
ok, this seems mighty round about, but this works let me know if you think there is a simpler way... i found atleast two sets of documentation on this from "developer/Apple" on DomNodes or DOMObjects neither had the same info... but combining the two, i think i figured it out...

Drawing over a transparent background

2009-08-23 Thread Ron Fleckner
Hi, I asked about this on quartz-dev but go no reply after a few days so I'm asking here. My borderless window has a semi-transparent background. When the drawing in a subview changes, the background retains a ghost of the original drawing in the subview. I don't want that ghost image!

Using Core Data NSManagedObject subclasses outside of a managed object context

2009-08-23 Thread Dieterich Lawson
Hey all, I have objects that I use with core data that were automatically generated for me by xcode and represent entities in my data store. They all subclass NSManagedObject, and do not have instance variables, but instead use the @dynamic setting for their properties, pretty standard. My underst

Simple array controller master-detail binding problem

2009-08-23 Thread Leon Starr
Well, simple for you guys I hope! I apologize in advance for this monstrosity of a question, but I've had a tough time narrowing this thing down so I'm laying out all the details to keep the thread short in hopes that someone will spot an obvious mistake right away. Any help greatly apprec

Re: readInBackgroundAndNotify not working?

2009-08-23 Thread Adam R. Maxwell
On Aug 23, 2009, at 8:01 PM, Kyle Sluder wrote: On Aug 23, 2009, at 7:42 PM, PCWiz wrote: name:@"NSFileHandleReadCompletionNotification" NSFileHandleReadCompletionNotification is the name of a constant, not necessarily its value. Right, and that was my first thought, too! I've

DOMNode problems getting info out...

2009-08-23 Thread jon
I have found that there is extremely limited documentation dealing with DOMNodeLists and DOMNode... for instance i found by pure accident that textContent works on a node, and found no documentation on it... and lots references to getAttribute or getElementID but can not get them to wor

Re: Syntax Coloring?

2009-08-23 Thread Rob Keniger
On 24/08/2009, at 10:32 AM, BareFeet wrote: I approached it using regex to parse the quoted and commented strings into single objects, then parse using regex for the language, then reinsert the quoted and commented strings. But this was using perl and scripting, whereas I now need to port t

Re: Drawing over a transparent background

2009-08-23 Thread Rob Keniger
On 24/08/2009, at 9:33 AM, Ron Fleckner wrote: My borderless window has a semi-transparent background. When the drawing in a subview changes, the background retains a ghost of the original drawing in the subview. I don't want that ghost image! What are you returning for the -isOpaque met

Re: Simple array controller master-detail binding problem

2009-08-23 Thread Quincey Morris
On Aug 23, 2009, at 19:58, Leon Starr wrote: I can't make a lot of sense out of the stack trace, but it does end with: 0 objc_msgSend 1 objc_getProperty 2 -[Combatant weapons] 3 -[NSObject(NSKeyValueCoding) valueForKey:] 4- [NSObject(NSKeyValueCoding) valueForKeyPath:] You left out the vital

Re: Using Core Data NSManagedObject subclasses outside of a managed object context

2009-08-23 Thread Jerry Krinock
On 2009 Aug 23, at 17:32, Dieterich Lawson wrote: Does anyone know of a way to modify the objects so that I can use them wherever I want without having to insert them into a managed object context? No, you can't to that. But you're asking the wrong question. The problem is not the manag

Re: Drawing over a transparent background

2009-08-23 Thread Kyle Sluder
On Aug 23, 2009, at 4:33 PM, Ron Fleckner wrote: My borderless window has a semi-transparent background. When the drawing in a subview changes, the background retains a ghost of the original drawing in the subview. I don't want that ghost image! Have you remembered to override -isOpaque

Re: Using Core Data NSManagedObject subclasses outside of a managed object context

2009-08-23 Thread Quincey Morris
On Aug 23, 2009, at 17:32, Dieterich Lawson wrote: I have objects that I use with core data that were automatically generated for me by xcode and represent entities in my data store. They all subclass NSManagedObject, and do not have instance variables, but instead use the @dynamic setting

authorization services

2009-08-23 Thread Rick C.
hello, what i need for my project is a simple authorization from time to time if for example a file is being moved and i don't have access. i'm just starting to learn about authorization services and maybe this is what i need to do although it looks a bit complex for my needs. what i have fou

Re: authorization services

2009-08-23 Thread Kyle Sluder
Avoid using NSTask with Authorization Services in any pattern other than that illustrated in the documentation. Using AppleScript for this sounds like severe overkill. And shelling out to a script is not a good idea when filenames or special characters are involved. Learn and use Authoriz