Re: Talking to other apps

2014-08-04 Thread Pax
Why would you not use NSNotificationCenter for this? On 4 Aug 2014, at 15:51, Jerry Krinock je...@ieee.org wrote: On 2014 Aug 03, at 23:54, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: NSPerformService (which also has the feel of not being well-loved), XPC, or what else? Yes.

Opening Documents in iOS

2014-07-26 Thread Pax
I'm writing an iOS program that stores data in a text file (UTF-8) that contains custom tags which are only meaningful to my app. Loading the files, and doing useful work with them is not a problem - but I would like these files to be sharable, so that one user can send his data files to

Re: UUIDs for FAT Drives

2014-07-08 Thread Pax
Why not use the serial number of the USB device and the creation date of the volume? Armed with those two pieces of information, you should be reasonably sure of a good match… On 8 Jul 2014, at 15:01, SevenBits sevenbitst...@gmail.com wrote: On Tuesday, July 8, 2014, Scott Ribe

EXC_BAD_ACCESS in NSData

2014-05-26 Thread Pax
I'm utterly perplexed by this problem because I thought that I'd been so careful in ensuring that my data can be read safely with no problems. This is my snippet of code: [datastream getBytes:bytes range:NSMakeRange(positionCounter, datasize)]; // Length of packet content

EXC_BAD_ACCESS in NSData

2014-05-26 Thread Pax
I'm utterly perplexed by this problem because I thought that I'd been so careful in ensuring that my data can be read safely with no problems. This is my snippet of code: [datastream getBytes:bytes range:NSMakeRange(positionCounter, datasize)]; // Length of packet content

Re: EXC_BAD_ACCESS in NSData

2014-05-26 Thread Pax
and unsigned char* bytes; [datastream getBytes:bytes range:NSMakeRange(positionCounter, datasize)]; // Packet content Either way, I get the same result. On 26 May 2014, at 14:16, Uli Kusterer witness.of.teacht...@gmx.net wrote: On 26 May 2014, at 06:02, Pax 45rpmli...@googlemail.com

Re: EXC_BAD_ACCESS in NSData

2014-05-26 Thread Pax
and unsigned char* bytes; [datastream getBytes:bytes range:NSMakeRange(positionCounter, datasize)]; // Packet content Either way, I get the same result. On 26 May 2014, at 14:16, Uli Kusterer witness.of.teacht...@gmx.net wrote: On 26 May 2014, at 06:02, Pax 45rpmli...@googlemail.com

Re: EXC_BAD_ACCESS in NSData

2014-05-26 Thread Pax
range:NSMakeRange(positionCounter, datasize)]; // Packet content On May 26, 2014, at 3:44 PM, Pax 45rpmli...@googlemail.com wrote: Apologies - the obvious important detail, and I missed it out entirely. I have tried both of the following with the same result: unsigned char* databuffer

Re: EXC_BAD_ACCESS in NSData

2014-05-26 Thread Pax
Shameful. I need more sleep! :-) I also need to reread my code more carefully before asking questions. As I say though, I think that the solution I posted is the better solution anyway - since who wants a copy, with the additional overhead that a copy entails, when you don't need to have

Differences in string handling for NSString and NSAttributedString

2014-05-05 Thread Pax
I have a an NSAttributedString into which I would like to insert images. The images need to be inserted after specific line endings (I know which line endings in advance - they've been previously calculated). I have written a function which returns an array of all line ending locations (or

Re: Differences in string handling for NSString and NSAttributedString

2014-05-05 Thread Pax
Oh bloody hell. I must be tired. That's so obvious - and I'm desperately embarrassed for not taking care of this. Thank you so much. On 5 May 2014, at 17:47, Uli Kusterer witness.of.teacht...@gmx.net wrote: On 05 May 2014, at 18:27, Pax 45rpmli...@googlemail.com wrote: When I use

Converting from RTF to HTML misses out image tags

2014-04-25 Thread Pax
I'm trying to convert from RTF to HTML like so: NSAttributedString* rtfContent = [[NSAttributedString alloc]initWithRTF:rtfData documentAttributes:nil]; NSData* htmlData = [rtfContent dataFromRange:NSMakeRange(0, rtfContent.length)

Getting an index for NSMutableAttributed string using tags in RTF

2014-04-20 Thread Pax
I have an NSTextView which is being populated using RTF: if ([self getContent:@RTF]useformatting) { [attributedContent appendAttributedString:[[NSAttributedString alloc] initWithRTF:[self getContent:@RTF] documentAttributes:NULL]]; } This works beautifully except that the

Re: tableView - message sent to deallocated instance

2014-02-26 Thread Pax
...@manoverboard.org wrote: On 25 Feb 2014, at 2:39 PM, Pax 45rpmli...@googlemail.com wrote: This is a really weird problem (in my view, anyway), because it only occurs in a very particular set of circumstances. My application is NSDocument based (just in case it makes a difference), and my application

Re: tableView - message sent to deallocated instance

2014-02-26 Thread Pax
with it, even if I'm not entirely happy with it. On 26 Feb 2014, at 21:11, Kyle Sluder k...@ksluder.com wrote: On Wed, Feb 26, 2014, at 12:42 PM, Pax wrote: Thanks for your help. The problem is now solved - although I'm still none the wiser as to why the problem only manifested when the file

tableView - message sent to deallocated instance

2014-02-25 Thread Pax
This is a really weird problem (in my view, anyway), because it only occurs in a very particular set of circumstances. My application is NSDocument based (just in case it makes a difference), and my application uses ARC. I have an NSArray of NSDictionary containing file information, and this

Getting QuickLook to work with NSDocument

2014-02-08 Thread Pax
I'm trying to get QuickLook preview to work with NSDocument - much as in the QuickLookDownloader example provided by Apple. I thought I had it all set up correctly - #import Quartz/Quartz.h @interface Document : NSDocument NSToolbarDelegate,QLPreviewPanelDataSource, QLPreviewPanelDelegate {

Quartz problem (glext bug)

2014-02-01 Thread Pax
I've got a problem when I include the Quartz framework. Doing so, without altering a single line of my code, causes the following error to be raised when I attempt to compile:

Re: Quartz problem (glext bug)

2014-02-01 Thread Pax
Damn Google! Always with the wrong answer ;-) Thanks for this. With your sage advice, I've located the problem. On 1 Feb 2014, at 20:30, Greg Parker gpar...@apple.com wrote: On Feb 1, 2014, at 11:56 AM, Pax 45rpmli...@googlemail.com wrote: I've got a problem when I include the Quartz

NSDocument fileURL

2014-01-23 Thread Pax
Hopefully this is a nice, easy, problem for you to ponder on a Thursday evening. I'm opening a document as follows: - (BOOL)readFromData:(NSData *)pData ofType:(NSString *)pTypeName error:(NSError **)pOutError { if ([pTypeName compare:@CPro] ==

NSDistributedNotificationCenter Strangeness

2013-12-17 Thread Pax
My apologies if this question has appeared once already - I'm resending it because I fear it may have been lost during the Cocoa Dev List outage. Here's a little oddity that might either be me being foolish (again) or relate to an open Radar. I'm inclined to the former because (according to my

NSDistributedNotificationCenter Strangeness

2013-12-16 Thread Pax
Here's a little oddity that might either be me being foolish (again) or relate to an open Radar. I'm inclined to the former because (according to my search of this list, to see if anyone else was having the same problem) the Radar was opened in 2011 - which should be enough time to squish the

NSDistributedNotificationCenter Strangeness

2013-12-16 Thread Pax
Here's a little oddity that might either be me being foolish (again) or relate to an open Radar. I'm inclined to the former because (according to my search of this list, to see if anyone else was having the same problem) the Radar was opened in 2011 - which should be enough time to squish the

NSButton state not persisting

2013-12-10 Thread Pax
Another weird one (or another paper bag error from me!) I'm writing a pref pane and, when it loads, it checks to see if the application that it provides the settings for is running or not. If the application is running then it sets an NSButton to On, and if it isn't then it sets the button to

Re: NSButton state not persisting

2013-12-10 Thread Pax
as alloc init, will it, because that will override the existing connections to the button as defined in IB? What is the secret sauce that I'm missing here? - Pax On 10 Dec 2013, at 20:39, Jens Alfke j...@mooseyard.com wrote: Check for nil — in the set-the-state code add an assertion

NSStatusBar removeStatusItem on Mavericks

2013-12-08 Thread Pax
Just a quickie - and it may be that I've found a small bug in Mavericks. My app contains the following code: [[NSStatusBar systemStatusBar] removeStatusItem:statusItem]; This works perfectly on single monitor setups, and on OS's older than Mavericks. On a multi-monitor Mavericks setup,

Re: NSTask and 10.9

2013-11-26 Thread Pax
Why would you delete files in this manner? It's more efficient to delete them directly from your Objective C code, thus: NSArray *fileArray = [@path1,@path2]; for (NSString *filename in fileArray) { [fileMgr removeItemAtPath:filename error:NULL]; } You already know what

Re: NSTask and 10.9

2013-11-26 Thread Pax
wrote: On Nov 26, 2013, at 8:56 AM, Pax 45rpmli...@googlemail.com wrote: hy would you delete files in this manner? Need to wildcard the file names. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests

sandboxd deny file-write-create

2013-11-24 Thread Pax
Okay, so I think I know what the problem is here - the problem is that I prompt the user for a filename, and then I modify the filename before using it. I suspect that sandboxd looks dimly on what I've done, and considers me to be riding roughshod over the users wishes! In fact I'm not, but

Problems with reachability observer in Mavericks / Xcode 5

2013-11-12 Thread Pax
Here's an odd one. It works before Mavericks (Xcode 5) - and doesn't work now. I've been playing with Reachability (https://developer.apple.com/Library/ios/samplecode/Reachability/Introduction/Intro.html). Apple's example is for iOS, but with a few small mods it worked fine on Mac OS X. I

Weird bug affecting 10.6 (but not newer)

2013-11-09 Thread Pax
My application has three buttons, each with the same Sent Action. In fact, all of the buttons are identical, except for their name, icon and identifier (the identifiers are 0, 1 and 2). The Sent Action points to a spot of code which will select a tab view: -(IBAction)selectView:(id)sender {

Re: Weird bug affecting 10.6 (but not newer)

2013-11-09 Thread Pax
Thank you Ken and Keary. That nailed it - and I'm now a very happy chap. Thanks for this. On 9 Nov 2013, at 16:59, Keary Suska cocoa-...@esoteritech.com wrote: On Nov 9, 2013, at 9:33 AM, Pax wrote: My application has three buttons, each with the same Sent Action. In fact, all

Re: Modifying the save path in an NSDocument based application

2013-09-19 Thread Pax
Sep 2013, at 20:54, Pax 45rpmli...@googlemail.com wrote: Okay, the plot thickens. I've now updated my app for the app store - sandboxing is now enabled. Sandboxing breaks the save path modification, and particularly my creation of a folder: if(![fileManager

Re: Modifying the save path in an NSDocument based application

2013-09-18 Thread Pax
- which probably explains this. How can I get read/write access to wherever the user chooses to extract the files (most likely Documents, loose in their home folder, or the desktop?) On 17 Sep 2013, at 15:20, Jerry Krinock je...@ieee.org wrote: On Sep 17, 2013, at 07:49:56, Pax 45rpmli

Modifying the save path in an NSDocument based application

2013-09-17 Thread Pax
I have a slightly odd requirement in that I need to modify, under certain circumstances, the save path used for an NSDocument based application. The reason for this is that I may, depending on the format chosen by the user, need to unpack the data into multiple files. Under this circumstance,

Re: Modifying the save path in an NSDocument based application

2013-09-17 Thread Pax
Thanks Jerry, Thanks Steve, You guys rock! If you're ever in London I definitely owe you beer! On 17 Sep 2013, at 14:41, Steve Mills smi...@makemusic.com wrote: You might try overriding saveToURL:ofType:forSaveOperation:completionHandler: instead. writeToURL is at a very low level in the

Save Panel without Filename selection

2013-09-14 Thread Pax
I have a requirement for a save dialog where the user can select a location but not a filename. At the moment I am implementing this functionality using the Open panel - but this has the disadvantages of a) having the action button labelled Open rather than Save and b) not having 'New Folder'

Re: Save Panel without Filename selection

2013-09-14 Thread Pax
14, 2013, at 10:42 AM, Pax wrote: I have a requirement for a save dialog where the user can select a location but not a filename. At the moment I am implementing this functionality using the Open panel - but this has the disadvantages of a) having the action button labelled Open rather

Re: Crashing Problem calling postNotificationName

2013-09-10 Thread Pax
What do the debug logs for the crash say? At what point does the crash occur? Is your program getting into parseOperationComplete? When you step through, which line fails? On 10 Sep 2013, at 12:08, Dave d...@looktowindward.com wrote: Hi, I have a crashing problem when calling

Re: ARC vs Manual Reference Counting

2013-09-09 Thread Pax
It's something new to learn, but in order to stay current there will always be something new. I'm just porting my software to ARC, and whilst there are one or two gotchas (oversights on my part, leading to leakage), I'm finding it to be an excellent idea. Using ARC (in my experience) leads to

validateUserInterfaceItem problem

2013-08-29 Thread Pax
toggleToolbarShown or runToolbarCustomizationPalette get validated? How would you suggest that I fix this? Regards, Pax ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact

Re: validateUserInterfaceItem problem

2013-08-29 Thread Pax
Ah okay. Well that's easily fixed then (and has been). Thanks for your explanation. On 29 Aug 2013, at 14:42, Keary Suska cocoa-...@esoteritech.com wrote: These two methods are implemented by NSWindow, and chances are the window is gobbling up the actions because it is earlier in the

NSToolbar settings not saved

2013-08-09 Thread Pax
Okay, I think that this might be a weird one. I've read the documentation, and I've implemented a toolbar for my document based application. For the most part, it works perfectly but its settings don't seem to be getting saved. For example: 1. If I have x many windows open and I add an item

Re: NSToolbar settings not saved

2013-08-09 Thread Pax
Mostly in code. I've added a toolbar in IB, and hooked it up to an NSToolBar object in my code - and then I use that NSToolBar object to set up my toolbar. I am doing some unusual things (mainly to do with the validation of items, and subtle changes to the icon to give the user additional

Re: Apple Developer Update

2013-07-25 Thread Pax
On 25 Jul 2013, at 15:54, Fritz Anderson anderson.fr...@gmail.com wrote: Those of us who have been on the net for 30+ years have seen valuable, even beloved, fora die as the essential contributors decide they have better uses for their energy than sorting through (often unpleasant) noise.

Re: Getting the location of the Library

2013-06-24 Thread Pax
:49 PM, Pax 45rpmli...@googlemail.com wrote: Just a quickie, I hope! I'm writing a sandboxed application that uses plugins. The plugin directories that I want to load from are '/Library/Application Support/MyApp' and '~/Library/Application Support/MyApp'. You do not have access

Getting the location of the Library

2013-06-23 Thread Pax
Just a quickie, I hope! I'm writing a sandboxed application that uses plugins. The plugin directories that I want to load from are '/Library/Application Support/MyApp' and '~/Library/Application Support/MyApp'. I don't really care if '~/Library/Containers/com.myapp/Data/Library/Application

Setting NSWindow to be transparent

2013-06-16 Thread Pax
I am trying to set NSWindow (borderless, with no controls) to be transparent before I display it (so that I can fade it onto the screen). Unfortunately, I don't seem to be able to - it loads, visibly, then sets the opacity to 0 (resulting in the window flickering at full opacity, before

Re: Setting NSWindow to be transparent

2013-06-16 Thread Pax
)windowDidLoad { [super windowDidLoad] [splashWindow setAlphaValue:0.0]; } Works find for me. Code is here: https://github.com/mstarke/MacPass/blob/master/MacPass/MPOverlayWindowController.m -Michael On 16.06.2013, at 10:22, Pax 45rpmli...@googlemail.com wrote: I am trying

Sandbox Autolaunch

2013-05-13 Thread Pax
I'm having the very devil of a time trying to get auto launch of sandboxed apps to work, which is a real pity because I can think of quite a few apps for which it would be rather handy. My latest attempt flings out the following error: 13/05/2013 21:42:09.962

Re: sandboxd deny hid-control weirdness

2013-04-26 Thread Pax
very much for your help. I'm most grateful. On 25 Apr 2013, at 17:37, Nick Zitzmann n...@chronosnet.com wrote: On Apr 25, 2013, at 7:10 AM, Pax 45rpmli...@googlemail.com wrote: I am writing a program that I hope to get into the App Store. During testing, all went well - no errors

sandboxd deny hid-control weirdness

2013-04-25 Thread Pax
I am writing a program that I hope to get into the App Store. During testing, all went well - no errors, no crashes, nothing to be concerned about. Having Archived it, and exported a Developer ID-signed Application (for further testing), I find myself facing a rather annoying problem. My

SMLoginItemSetEnabled ACL Problem

2013-04-25 Thread Pax
Forgive me for having two questions in flight at once. This is an entirely separate issue - and this might not even be the right forum for it. I can't find a sandbox / app store forum to ask though. My app should be able to launch itself at start up - but the helper app doesn't seem to work.

makeKeyAndOrderFront (not working)

2013-04-14 Thread Pax
I want my window to come to the front when I select it. My window (with its own class to handle it), sadly, has other ideas - and stays resolutely in the background. Complicating matters, my app is faceless - just a menu item to show for itself, and no icon in the dock. The code I'm having

Re: makeKeyAndOrderFront (not working)

2013-04-14 Thread Pax
are everywhere... http://www.zathras.de On 14.04.2013, at 18:33, Pax 45rpmli...@googlemail.com wrote: I want my window to come to the front when I select it. My window (with its own class to handle it), sadly, has other ideas - and stays resolutely in the background. Complicating matters

Accessing members from NSDictionary

2013-04-05 Thread Pax
I have a situation where a user might have a great many information windows open at the same time (like the situation in Finder where you can click on a file and select 'Get Info' ad infinitum.) In order handle this situation, and so that I can still update each Window individually, I decided

Re: Accessing members from NSDictionary

2013-04-05 Thread Pax
On 5 Apr 2013, at 14:20, Mike Abdullah cocoa...@mikeabdullah.net wrote: For a start, trying to access instance variables directly is almost always a bad idea. Expose proper accessor methods instead. Why is it a bad idea? I do this quite often, and I find it has the double benefit of

Re: Accessing members from NSDictionary

2013-04-05 Thread Pax
Ah, I see. I shall try that out. And, referring to my earlier question, would I be able to: [[device objectForKey:@InformationWindowRef].infoWindow cascadeTopLeftFromPoint:NSMakePoint(20,20)]; On 5 Apr 2013, at 15:00, Tom Davie tom.da...@gmail.com wrote: The reason it's a bad idea is

Re: Accessing members from NSDictionary

2013-04-05 Thread Pax
…And how would I make '@property (assign, nonatomic) NSWindow* iWindow;' an IBOutlet so that I can hook it up to my window in interface builder? On 5 Apr 2013, at 15:00, Tom Davie tom.da...@gmail.com wrote: The reason it's a bad idea is because it means that you have two strongly coupled

Re: Pop Up Menu in NSTableView

2013-03-25 Thread Pax
I'm going to try both types of table - but I need to find good documentation, preferably with examples, first. Right now, however, I've decided that this is useful future functionality, and not core to the software. So I've gone back to plan a - checkboxes in NSTableView (still need to work

Re: Pop Up Menu in NSTableView

2013-03-24 Thread Pax
With regard to the title to display, I was thinking of 'Activated' if actions are selected (and by clicking on the pop up one can see exactly what actions are selected), and 'Deactivated' if no selections have been made. That wording might need a little work, but that's the gist of it. As to

Re: Pop Up Menu in NSTableView

2013-03-24 Thread Pax
: On Mar 24, 2013, at 14:50 , Pax 45rpmli...@googlemail.com wrote: You may be more successful if you use a view-based table rather than a cell-based table. One of the reasons we have view-based tables is to be able to avoid dealing with cells directly, in situations like this. However

Re: 'Pseudo' Singleton in Objective C

2013-03-15 Thread Pax
, 2013, at 11:22 AM, Pax wrote: I don't really know how to describe what I'm trying to do except as a 'Pseudo' Singleton. I have a class with an NSWindow, which displays information. It is run by selecting an NSMenuItem called 'More Information…' My issue is that I only want one

'Pseudo' Singleton in Objective C

2013-03-14 Thread Pax
I don't really know how to describe what I'm trying to do except as a 'Pseudo' Singleton. I have a class with an NSWindow, which displays information. It is run by selecting an NSMenuItem called 'More Information…' My issue is that I only want one instance of the Information class to be