Re: What causes NSFileManager's stringWithFileSystemRepresentation to return nil?

2010-10-27 Thread G S
Thanks for the replies, guys. The origin of the string was an std::string, so the length calculation should be accurate. And yes, it originally comes from a query to determine the cache directory for my iPhone app. I'm trying to keep as much of the app cross-platform as possible, so I'm using a

Re: What causes NSFileManager's stringWithFileSystemRepresentation to return nil?

2010-10-27 Thread Graham Cox
On 27/10/2010, at 6:06 PM, G S wrote: > NSString* test = [[theApp fileManager] What is [theApp fileManager]? The usual idiom is [NSFileManager defaultManager] Try breaking the line apart and see what this part returns. If it's nil, then the result will be nil, and the conclusion will be that

Writing an Uninstaller

2010-10-27 Thread eveningnick eveningnick
Hello I have an application that creats, when installed, a bundle in "Applications" and registers a .plist file for launchd in ~/Library/LaunchAgents (the agent is located in that bundle, and its process is launched everytime the OS starts). Thus, i can't let a user just to move bundle to the Trash

Re: WebView in NSTabView

2010-10-27 Thread Mike Abdullah
It looks to me like the WebView isn't overlaid on your other views. However, the video is. This is probably because videos are displayed using Core Animation, pushing it above all other views. Things to try: - Hide the webview when tab changes - Make your tabview layer-backed too - WebView has

custom outline view

2010-10-27 Thread Rajendran P
HI i need to implement an outline view similar to the one below * first row should consist of Text followed by image and button * on expansion child rows should have Multi Line text | l> TEXT HERE Imagehere ButtonHere

Re: Writing an Uninstaller

2010-10-27 Thread Angus Hardie
On 27 Oct 2010, at 13:16, eveningnick eveningnick wrote: > Hello > I have an application that creats, when installed, a bundle in > "Applications" and registers a .plist file for launchd in > ~/Library/LaunchAgents (the agent is located in that bundle, and its > process is launched everytime the

Re: NSFileManager and Resource Forks

2010-10-27 Thread koko
Here is my code to write a resource fork for a given file. NSString *dataPath = [[NSBundle mainBundle] pathForResource:@"RSRC" ofType:@"PCSMAC"]; NSString *rsrcPath = [dataPath stringByAppendingString:@"/..namedfork/rsrc"]; NSData *data = [fm contentsA

Re: NSFileManager and Resource Forks

2010-10-27 Thread Chris Parker
What are you really trying to do? In general, resource forks on Mac OS X aren't used anymore. NSFileManager preserves them on file moves and copies for legac. And while the "..namedfork" bits work now, they're unlikely to continue working in the future. .chris On 27 Oct 2010, at 10:52 AM, k...

Re: NSFileManager and Resource Forks

2010-10-27 Thread koko
My program creates files, some of which are used by a particular OS9 app. The OS9 app requires a resource fork for the file. -koko On Oct 27, 2010, at 12:04 PM, Chris Parker wrote: What are you really trying to do? In general, resource forks on Mac OS X aren't used anymore. NSFileManager

Re: NSFileManager and Resource Forks

2010-10-27 Thread Jean-Daniel Dupas
Le 27 oct. 2010 à 19:52, k...@highrolls.net a écrit : > Here is my code to write a resource fork for a given file. > > NSString *dataPath = [[NSBundle mainBundle] > pathForResource:@"RSRC" ofType:@"PCSMAC"]; > NSString *rsrcPath = [dat

Re: NSFileManager and Resource Forks

2010-10-27 Thread koko
FYI ... this works just fine: NSString *dataPath = [[NSBundle mainBundle] pathForResource:@"RSRC" ofType:@"PCSMAC"]; NSString *rsrcPath = [dataPath stringByAppendingString:@"/..namedfork/rsrc"]; NSData *data = [fm contentsAtPath:rsrcPath];

Re: Thread not registered mystery under GC

2010-10-27 Thread Andy O'Meara
> > > Andy, also beware that those two functions are not properly marked as > weak, and so if your deployment target is < 10.6 and even if you test > them against NULL, you will crash. :( Yikes, many thanks for the catch there -- this stuff always keep me guessing, sigh. Thanks Sean for b

Non-data backed UITableView?

2010-10-27 Thread Abhi Beckert
Hi, All the examples I can find for UITableView use an array or core data to populate their contents. What about a table view like in the settings app, where you have a random assortment of cells, with odd grouping, and often varying cell types (eg, images and toggle switches)? I have a few of

CoreDataGeneratedAccessors

2010-10-27 Thread Ayers, Joseph
When I try to use the method addTapesObject defined as @interface TapeList (CoreDataGeneratedAccessors) - (void)addTapesObject:(tapes *)value; - (void)removeTapesObject:(tapes *)value; - (void)addTapes:(NSSet *)value; - (void)removeTapes:(NSSet *)value; @end I get the error: 2010-10-27 12:09:04

Why would [NSArrayController setSelectionIndex] fail?

2010-10-27 Thread vincent habchi
Hi there, sorry for being rather terse these days, I am conscious I tend to tap too much and help too few. Small question: I have a NSArrayController managing a Core data entity array. I want to alter the selection via -setSelectionIndex, and it fails (the index won't change). The documentation

Re: NSFileManager and Resource Forks

2010-10-27 Thread Greg Guerin
koko wrote: NSString *outPath = [nspath stringByAppendingString:@"/..namedfork/ rsrc"]; ok = [fm createFileAtPath:outPath contents:data attributes:nil]; This won't work. You must first create the file (i.e. create the data fork). Only after the file exists can you open and write to its

Re: Drag and drop between two table views.

2010-10-27 Thread Paul Johnson
I think I've made some progress. I've rewritten tableView:writeRowsWithIndexes:toPasteboard: for the source table view: - (BOOL) tableView:(NSTableView *)tv writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard { NSArray *rows = [self arrangedObjects

Re: NSFileManager and Resource Forks

2010-10-27 Thread koko
although I have implemented a different solution, just to note the data fork (the file) does exist, it is nspath in the first line. -koko On Oct 27, 2010, at 3:40 PM, Greg Guerin wrote: koko wrote: NSString *outPath = [nspath stringByAppendingString:@"/..namedfork/ rsrc"]; ok = [fm creat

NSApplication nil?

2010-10-27 Thread koko
I do not grok this crash. I do an action ion my program which I have stepped through with no errors, then when I continue I get this crash which looks to me like NSApplication is invalid! Can that be? - koko Thread 0 Crashed: 0 libobjc.A.dylib 0x937fe688 objc_msgSen

Re: Why would [NSArrayController setSelectionIndex] fail?

2010-10-27 Thread Keary Suska
On Oct 27, 2010, at 3:30 PM, vincent habchi wrote: > Small question: I have a NSArrayController managing a Core data entity array. > I want to alter the selection via -setSelectionIndex, and it fails (the index > won't change). The documentation is (also) rather terse on the possible > causes f

Re: NSApplication nil?

2010-10-27 Thread Scott Ribe
On Oct 27, 2010, at 3:51 PM, k...@highrolls.net wrote: > then when I continue I get this crash which looks to me like NSApplication is > invalid! Can that be? NSApp has a pointer to an invalid object and tries to send it a message. Classic symptom of an over-release. -- Scott Ribe scott_r...@

Re: [NSImage] Bug in System Preferences? [solved]

2010-10-27 Thread Iceberg-Dev
Le 27 oct. 10 à 02:09, Gregory Weston a écrit : On Oct 26, 2010, at 16:29, Stephane Sudre wrote: On Tue, Oct 26, 2010 at 4:14 AM, Gregory Weston wrote: Iceberg-Dev wrote: When working with NSBitmapImageRep, calling -bitmapData is a signal that you may be editing the data. It is not repa

Re: NSFileManager and Resource Forks

2010-10-27 Thread Greg Guerin
koko wrote: although I have implemented a different solution, just to note the data fork (the file) does exist, it is nspath in the first line. I don't see nspath being used to create a data-fork file in any code you posted. It may be in the code you didn't post, or if I've missed it, pl

Re: NSFileManager and Resource Forks

2010-10-27 Thread koko
Thanks Greg. Leaks filled! -koko On Oct 27, 2010, at 4:35 PM, Greg Guerin wrote: koko wrote: although I have implemented a different solution, just to note the data fork (the file) does exist, it is nspath in the first line. I don't see nspath being used to create a data-fork file in a

Re: NSFileManager and Resource Forks

2010-10-27 Thread Sean McBride
On Wed, 27 Oct 2010 20:08:04 +0200, Jean-Daniel Dupas said: >No, you don't need the Carbon rsrc manager, you need the CoreServices >File Manager, which is available to 64 bits app and AFAIK, the only >supported way to save resource forks. >Apple even recommends against using ..namedfork. If you wa

Re: NSApplication nil?

2010-10-27 Thread koko
Thanks ... found the over-release! -koko On Oct 27, 2010, at 4:15 PM, Scott Ribe wrote: On Oct 27, 2010, at 3:51 PM, k...@highrolls.net wrote: then when I continue I get this crash which looks to me like NSApplication is invalid! Can that be? NSApp has a pointer to an invalid object and

Handle drop to WebView: WebDragDestinationActionDHTML

2010-10-27 Thread Wayne Shao
I would like to handle drop to WebView to not load the dropped object, but to perform some customized action. However, I ran into similar issues as described here: http://lists.apple.com/archives/webkitsdk-dev/2005/May/msg00046.html Basically, for these two callbacks in WebUIDelegate, - A. –

Re: Drag and drop between two table views.

2010-10-27 Thread Graham Cox
On 28/10/2010, at 8:45 AM, Paul Johnson wrote: > I think I've made some progress. I've rewritten > tableView:writeRowsWithIndexes:toPasteboard: for the source table view: > > NSArray *rows = [self arrangedObjects]; > NSMutableArray *selectedItems = [NSMutableArray > arrayWithCapaci

Re: NSFileManager and Resource Forks

2010-10-27 Thread Charles Srstka
On Oct 27, 2010, at 1:03 PM, Chris Parker wrote: > And while the "..namedfork" bits work now, they're unlikely to continue > working in the future. Has ..namedfork been deprecated? This is news to me. I know that /rsrc was deprecated years ago in favor of /..namedfork/rsrc, but I hadn’t seen an

Re: NSFileManager and Resource Forks

2010-10-27 Thread Charles Srstka
On Oct 27, 2010, at 1:08 PM, Jean-Daniel Dupas wrote: > No, you don't need the Carbon rsrc manager, you need the CoreServices File > Manager, which is available to 64 bits app and AFAIK, the only supported way > to save resource forks. At the time, it wasn’t clear whether he wanted to write th

Re: Drag and drop between two table views.

2010-10-27 Thread Graham Cox
Another thing. You should also implement: - (NSDragOperation)tableView:(NSTableView *)aTableView validateDrop:(id )info proposedRow:(NSInteger)rowproposedDropOperation:(NSTableViewDropOperation)operation This should check whether 'BFDragPasteboardType' is actually present on the pasteboard, u

Re: Handle drop to WebView: WebDragDestinationActionDHTML

2010-10-27 Thread Mike Abdullah
Subclass WebView and override the standard NSDraggingDestination methods. On 28 Oct 2010, at 00:19, Wayne Shao wrote: > I would like to handle drop to WebView to not load the dropped object, but > to perform some customized action. > However, I ran into similar issues as described here: > > htt

NSMomentaryLightButton vs. NSMomentaryPushInButton and NSPushOnPushOffButton vs. NSOnOffButton

2010-10-27 Thread Jeff Johnson
Is there a difference between NSMomentaryLightButton and NSMomentaryPushInButton? What about between NSPushOnPushOffButton and NSOnOffButton? I've created buttons of all different bezel styles, and I can't see any difference in appearance or behavior between the above mentioned button types. G

Re: NSMomentaryLightButton vs. NSMomentaryPushInButton and NSPushOnPushOffButton vs. NSOnOffButton

2010-10-27 Thread Quincey Morris
On Oct 27, 2010, at 18:15, Jeff Johnson wrote: > Is there a difference between NSMomentaryLightButton and > NSMomentaryPushInButton? What about between NSPushOnPushOffButton and > NSOnOffButton? I've created buttons of all different bezel styles, and I > can't see any difference in appearance o

Re: NSMomentaryLightButton vs. NSMomentaryPushInButton and NSPushOnPushOffButton vs. NSOnOffButton

2010-10-27 Thread Jeff Johnson
On Oct 27, 2010, at 8:28 PM, Quincey Morris wrote: > On Oct 27, 2010, at 18:15, Jeff Johnson wrote: > >> Is there a difference between NSMomentaryLightButton and >> NSMomentaryPushInButton? What about between NSPushOnPushOffButton and >> NSOnOffButton? I've created buttons of all different beze

Re: Drag and drop between two table views.

2010-10-27 Thread Paul Johnson
Thanks, Graham. I've almost got it working. I did implement the drop validation method and in my initWithNib method I did set up the destination to receive the drag type. That's all working fine. I took your suggestion to archive the array to a NSData object. I needed to implement encodeWithCoder

Re: Audio Streaming with Cocoa

2010-10-27 Thread Bilel Mhedhbi
Le 25 oct. 2010 à 23:48, Jean-Daniel Dupas a écrit : > > Le 26 oct. 2010 à 00:36, Uli Kusterer a écrit : > >> On 25.10.2010, at 16:10, Bilel Mhedhbi wrote: >>> I want to practice and make my own radio player with Cocoa. I just want to >>> know what are your ideas about how to get an audio stre

Re: Writing an Uninstaller

2010-10-27 Thread Rajendran P
HI , launch an applescript / shell script when uninstall button is clicked . This should first quit the App and wait for it to terminate and then delete the bundle and plist Thanks Rajendran P On 10/27/10 5:46 PM, "eveningnick eveningnick" wrote: Hello I have an application that creats,

Re: Writing an Uninstaller

2010-10-27 Thread Rajendran P
There is possibility that user might restore the app from trash to /Application :) just ensure that launchd is added after the App launch Thanks Rajendran P On 10/27/10 7:22 PM, "Angus Hardie" wrote: On 27 Oct 2010, at 13:16, eveningnick eveningnick wrote: > Hello > I have an application

Adding and removing menu items causes memory usage to grow

2010-10-27 Thread George Nachman
Hi cocoa-dev, I was tracking down memory growth in my application and isolated it to the repeated adding and removing of menu items. Doing this causes a growth of about 1MB: for (int i = 0; i < 1000; ++i) { NSMenu *aMenu = [[NSMenu alloc] init]; NSMenuItem* i = [[NSMenuItem al

Re: Drag and drop between two table views.

2010-10-27 Thread Graham Cox
On 28/10/2010, at 2:38 PM, Paul Johnson wrote: > Thanks, Graham. I've almost got it working. I did implement the drop > validation method and in my initWithNib method I did set up the destination > to receive the drag type. That's all working fine. > > I took your suggestion to archive the arr

Re: Adding and removing menu items causes memory usage to grow

2010-10-27 Thread Sherm Pendley
On Wed, Oct 27, 2010 at 12:45 PM, George Nachman wrote: > > I was tracking down memory growth in my application and isolated it to > the repeated adding and removing of menu items. Doing this causes a > growth of about 1MB: > >    for (int i = 0; i < 1000; ++i) { NSAutoreleasePool *myPool

Re: NSMomentaryLightButton vs. NSMomentaryPushInButton and NSPushOnPushOffButton vs. NSOnOffButton

2010-10-27 Thread Quincey Morris
On Oct 27, 2010, at 20:04, Jeff Johnson wrote: > I was aware of the documentation, and you appear to have it backwards: > > NSMomentaryLightButton > While the button is held down it’s shown as “lit,” and also “pushed in” to > the screen if the button is bordered. > > NSMomentaryPushInButton > W

Re: NSMomentaryLightButton vs. NSMomentaryPushInButton and NSPushOnPushOffButton vs. NSOnOffButton

2010-10-27 Thread Ken Ferry
Hi Quincey, Jeff, -[NSButtonCell setButtonType:] is (mostly) a cover for certain combinations of -[NSButtonCell setHighlightsBy:] and -[NSButtonCell setShowsStateBy:]. For a button, highlighted is synonymous with "pressed". setHighlightsBy: controls how a button draws to communicate that it is p

Re: Why would [NSArrayController setSelectionIndex] fail?

2010-10-27 Thread vincent habchi
Le 28 oct. 2010 à 00:02, Keary Suska a écrit : > On Oct 27, 2010, at 3:30 PM, vincent habchi wrote: > >> Small question: I have a NSArrayController managing a Core data entity >> array. I want to alter the selection via -setSelectionIndex, and it fails >> (the index won't change). The documenta

Re: Why would [NSArrayController setSelectionIndex] fail?

2010-10-27 Thread vincent habchi
Le 28 oct. 2010 à 00:02, Keary Suska a écrit : Forget it: I am a moron. I had an old KVO method, that I thought had gone, which was forcing the selection to a specified index upon change. Conclusion: never post a message at 11pm without a prior deep slumber pause. Sorry for the noise and thank