programmitically creating nstextfield

2010-04-14 Thread mark
Would someone please tell me why this text field will not show. It is 
driving me spastic.

The window and text field are valid. And there are no errors.
The window shows but the text field does not.
relativeToWindow is valid.

NSRect w=[relativeToWindow frame];
NSRect r={{NSMaxX(w)-96, 
NSMaxY(w)-ToolbarHeightForWindow(relativeToWindow) - 
	titleBarHeight(relativeToWindow)-24},

{256, 64}};
window=[[NSWindow alloc] initWithContentRect:r styleMask:0
backing:NSBackingStoreRetained defer:NO];

//[window setBackgroundColor:[NSColor redColor]];
[window makeKeyAndOrderFront:self];
//[window setAlphaValue:0.3];
[relativeToWindow addChildWindow:window ordered:NSWindowAbove];
[window setLevel:NSFloatingWindowLevel];

f.origin.x=4;
f.origin.y=4;
f.size.width=128;
f.size.height=32;
textInfo=[[NSTextField alloc] initWithFrame:f];
[textInfo setSelectable:NO];
NSFont* font=[NSFont fontWithName:@"Times-Roman" size:12];
[textInfo setFont:font];
[textInfo setStringValue:@"hello world"];
[textInfo setBackgroundColor:[NSColor blueColor]];
[[window contentView] addSubview:textInfo];
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: programmitically creating nstextfield

2010-04-15 Thread mark

On Wed, Apr 14, 2010 at 9:24 PM, mark  wrote:

 window=[[NSWindow alloc] initWithContentRect:r styleMask:0


Use the NSBorderlessWindowMask symbolic constant instead of passing 0.


backing:NSBackingStoreRetained defer:NO];


As the documentation says, do not use NSBackingStoreRetained, or in
fact anything other than NSBackingStoreBuffered.


This fixed it. Thanks



--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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How do you set the text in an NSTextView?

2010-05-08 Thread Mark


On 8 May 2010, at 07:02:59, G S wrote:

Interface Builder shows that this control is an NSScrollView.   
Repeatedly
clicking on it does not drill down any further; NSScrollView is the  
end of
the line.  The class is never shown as NSTextView.  Check out what  
happens

if you Control-drag from the app delegate to the supposed NSTextView
control:


You need to Control-drag to a region in the NSTextView that  
conceptually represents a first line of text (somewhere near the top)  
if it's empty, or to the visible text if it's not, to select the  
textView instead of the scrollView.


Repeatedly clicking on it does drill down (there's only two classes),  
but again you need to click on the text region or the 'top line' if  
there's no text visible.  If you Control-Shift-click it you can see  
and select from the window's view hierarchy.



___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How do you set the text in an NSTextView?

2010-05-10 Thread Mark


On 10 May 2010, at 00:50:41, G S wrote:

You need to Control-drag to a region in the NSTextView that  
conceptually represents a first line of text (somewhere near the  
top) if it's empty, or to the visible text if it's not, to select  
the textView instead of the scrollView.


Yep, that's it!  Thanks.  Talk about OBSCURE.



It could be considered obscure.  Some people will find it, some won't  
I guess.  I think I found it by just moving the mouse around (it's a  
general trick to learn in IB because embedded objects often have  
certain hit targets for drag-connecting to those particular parts.  It  
can seem like a crazy mess until you figure this out).




Repeatedly clicking on it does drill down (there's only two  
classes), but again you need to click on the text region or the 'top  
line' if there's no text visible.  If you Control-Shift-click it you  
can see and select from the window's view hierarchy.


Not even Control-Shift-click will allow access to the real  
textView.  The bottom level in the pop-up list is, once again, the  
ScrollView.


You're clicking off the 'textView region' again and just hitting the  
content view of the scrollView (because the textView doesn't extend  
the full height of the scrollView's content view unless it has enough  
content to actually do so).  Try the Control-Shift-click up at the top  
and you'll see the full hierarchy.  Also try it in one of the  
scrollers, if they're visible, and you'll see an NSScroller instance  
(e.g. "Vertical Scroller").  It all makes sense if you think about how  
it's constructed.


The textView is a more obvious target if it contains some visible text  
in IB, but when empty it becomes rather small by definition, but it's  
not actually shrunk to zero height though, there's always a single  
line there to hold the caret and to give you something to click on.



___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


'Customize Toolbar...' menu item disabled

2011-10-15 Thread mark

I have a nib based toolbar in a window.
I have set the customise toolbar flag to YES (in IB and programmatically).
I have set the View menu items 'Customise Toolbar...' and 'Hide/Show 
Toolbar' to the first responder as directed  in the documentation.
I have implemented the delegate protocols 
-toolbarAllowedItemIdentifiers: & -toolbarDefaultItemIdentifiers: .

I have set the delegate of the toolbar.

The 'Customise Toolbar...' and the Hide/Show menu items are both disabled.
And all the menu items in the toolbar's contextual menu (except for 
Remove Item) are disabed.


The toolbar shows up in the window and all the toolbar items work as expected.

How do I get the menu items enabled? What am I missing?

Mark
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: 'Customize Toolbar...' menu item disabled

2011-10-16 Thread mark

On Oct 15, 2011, at 3:47 PM, mark wrote:


 I have a nib based toolbar in a window.
 I have set the customise toolbar flag to YES (in IB and programmatically).
 I have set the View menu items 'Customise 
Toolbar...' and 'Hide/Show Toolbar' to the 
first responder as directed  in the 
documentation.
 I have implemented the delegate protocols 
-toolbarAllowedItemIdentifiers: & 
-toolbarDefaultItemIdentifiers: .

 I have set the delegate of the toolbar.

 The 'Customise Toolbar...' and the Hide/Show menu items are both disabled.
 And all the menu items in the toolbar's 
contextual menu (except for Remove Item) are 
disabed.


 The toolbar shows up in the window and all the 
toolbar items work as expected.


 How do I get the menu items enabled? What am I missing?


For your "Show Toolbar" and "Customize ToolbarŠ" 
menu items, did you select the appropriate 
actions (toggleToolbarShown: and 
runToolbarCustomizationPalette:, respectively)?


Yes.
Connected to Sent Actions - 'First Responder --- 
toggleToolbarShown:' & 'First Responder --- 
runToolbarCustomizationPalette:'

___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Debugger() and iOS

2011-07-13 Thread mark
Is the Debugger() function supported in iOS? (This is for testing 
purposes only.)

I get a 'Symbol not found' error from the linker.
What framework do I have to include?
If not, is there an equivalent?

Mark
TIA
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSBrowser and double click

2010-07-24 Thread mark

A problem which is driving me spastic:
I have an NSBrowser that allowes multiple selection.
When I double click one of the selected items, all other selected 
items deselect.
I have set the doubleaction and action methods and correct target. 
These are called AFTER the deselection.

I have tried to override doClick and that doesn't prevent the deselection.
Any ideas?
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSBrowser and double click

2010-07-26 Thread mark

On 25/07/2010, at 9:00 AM, mark wrote:


 A problem which is driving me spastic:
 I have an NSBrowser that allowes multiple selection.
 When I double click one of the selected items, all other selected 
items deselect.
 I have set the doubleaction and action methods and correct target. 
These are called AFTER the deselection.

 I have tried to override doClick and that doesn't prevent the deselection.
 Any ideas?


In general this is the expected behaviour. Most stuff that handles 
multiple selection doesn't wait to see if a click is going to end up 
as the first of a double-click, and so processes the first click in 
a straightforward way. Typically, this is to deselect everything 
except what was clicked (unless modifier keys are down that might 
extend or flip the selection). On the second click, the double-click 
is detected and the double action triggered.


How does the Finder do it?



It is possible to be smarter when processing clicks and wait to see 
if a second click arrives within the double-click time before 
processing the first click, but you rarely see code that does this, 
since for one thing it seems unresponsive - every single-click will 
have no effect until the double-click period elapses.


--Graham


___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Recursive file remove

2010-08-14 Thread mark
As noted, your choices are either NSFileManager methods of BSD/POSIX 
functions.  I would tend to start with the latter because, at the 
end of the week, NSFileManager might not have the configurability 
you need to handle the nitty-gritty like system "dot" or "dot dot" 
files, (not) following symbolic links, etc. etc.  But it may be just 
a personal preference.  NSFileManager has not always been my friend.



What's wrong with FSDeleteObjec()? (Core Services File Manager).
You need to do a lot of recursive stuff using to empty directories bottom up.
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Okay I have those pieces… now where's the glue?

2008-05-27 Thread Mark
I see a lot of blah blah and 2 fully distinct questions on your post -  
plus a completelly meaningfull subject text.


Where's that link about how to ask questions...

Ps: Is there any generic(!) open source app that you would recommend  
me to study to learn more about how to structure an app at best?
Optimal would be an app that's not too specific in functionality  
(extensive use of libraries e.g.) and gives a good idea about app  
structure in general.___


Really, how hard are you trying to solve these problems - did you look  
at the sample code installed with XCode?



mark


On 27.05.2008, at 22:04, Satsumac wrote:


Hi… just another beginner speaking…

I'm coming from the rather procedural programming world of  
Applescript and web programming with PHP (OOP with CodeIgniter,  
though).


Coming from OOP PHP I found the concept of object oriented  
programming and the MVC pattern quite easy to adapt to Cocoa.
Having Hillegass' 3rd Edition at hand is also a great thing, along  
with some great (video) tutorials on the internet.

But I'm yet having some odd difficulties.
It's not that much about strictly technical questions like "how do I  
get this to do that?", but rather questions like "okay, I can think  
of several ways to do this, it's just that I have no clue which path  
to take?"


Books like Hillegass or the documentations teach you how to do this  
or that specific task in a very good manner.
But what I'm really missing are some lessons on how to glue the  
pieces you just learnt together to form a real app. (see my first  
example)
Or just fairly trivial issues like "what's the best/most common  
practice for detecting an NBPopUpButton's selected item?", just to  
give an example.


Just to give an example:
How do I allow controller A to send commands to controller B and  
vice versa?
If controller A initialized controller B, then A knew about B, but  
what about the other way round?


Just take this as an example:
Controller A is my AppController and does all the general GUI stuff  
like opening windows, swapping subviews, etc.
Controller B is the class that performs the actual task. Controller  
B shall not have an instance in the nib. It gets its outlets by  
being passes to the nib as File's Owner via "setDelegate".


I then have a Button for invoking an action. NSButton sends an  
action to Controller A which then does some GUI stuff and then tells  
Controller B to perform its task.
During the execution of this task Controller B might notice that  
something went horribly wrong and Controller A is highly needed to  
update the GUI.


But as only Controller A knows about B and not the other way round  
this seems not possible.


How would one solve such a thing?

Or to something completely different:
I have created a NSPopupButton in IB. I also created some MenuItems  
for it in IB.

How can I identify the current menu item?

One way would be to make every menu item an outlet of the controller  
and then just use something like:

if ([myPopupButton selectedItem] == myMenuItemOutlet) {
   //do something
}
But is this how to do such a thing? This would become quite messed  
up with every menu item you add to it.


I have to say that I'm feeling quite lost right now.

Thanks,
Vincent

Ps: Is there any generic(!) open source app that you would recommend  
me to study to learn more about how to structure an app at best?
Optimal would be an app that's not too specific in functionality  
(extensive use of libraries e.g.) and gives a good idea about app  
structure in general.___


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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/dev%40cine-scan.com

This email sent to [EMAIL PROTECTED]


___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Enabling add button

2008-12-19 Thread Mark
I did something like this once.  I'm not sure if this is a good way to  
tackle the problem or not but here's what you need:


- A BOOL ivar exposed as a property on one of your controllers:

BOOL isTableViewSelected;

@property(assign) BOOL isTableViewSelected;

@synthesize isTableViewSelected;


- Next, set up an observer of NSWindowDidUpdateNotification in - 
awakeFromNib or somewhere else so we can watch for any changes in the  
window (like first responder changing):


[[NSNotificationCenter defaultCenter]
  addObserver:self
  selector:@selector(checkFirstResponderStatusNotification:)
  name:NSWindowDidUpdateNotification
  object:[aView window]];  // <-- Get to the main window somehow


- In the selector for the notification check the class of the first  
responder and then set the isTableViewSelected ivar accordingly.  By  
using the synthesized setter it broadcasts change notifications so you  
can bind the 'Enabled' binding of the button to  
yourController.isTableViewSelected and it should then update its  
status correctly as you move around your UI.


- (void)checkFirstResponderStatusNotification:(NSNotification *)note {
	NSWindow *mainWindow = [self.aView window];  // <-- Get to the main  
window somehow
	self.isTableViewSelected = ([[mainWindow firstResponder]  
isKindOfClass:[NSTableView class]]);

}


I think this should work, you'll probably have to fiddle about with  
some things (I originally used this to check the class of one of my  
own classes, not a table view).  I think there was some weird problems  
with flickering (rapid on/off changes?) when a sheet was present on  
the window which I never got round to solving, ymmv.



(Also [[NSNotificationCenter defaultCenter] removeObserver:self]; in - 
dealloc or elsewhere)







On 18 Dec 2008, at 23:28, Andre Masse wrote:



On Dec 18, 2008, at 15:43, I. Savant wrote:


The issue Andre mentioned is that the app is mostly keyboard-driven
(and the key combo fires the button, which he fears can be triggered
inadvertently). This means it doesn't matter where the button is -  
the

key combo can still trigger the action without calling "enough"
attention to the resulting insert.


Exactly. You're way better than me explaining my own problems :-) I  
used to talk/write English much more 5-6 years ago (even co- 
translated a book from French to English). Now, I only use English  
in this list and it shows :-)


Thanks,

Andre Masse
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/blue.buconero%40virgin.net

This email sent to blue.bucon...@virgin.net


___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSBrowser, NSTreeController and Core Data

2008-10-14 Thread Mark .


On Oct 13, 2008, at 15:44, Quincey Morris wrote:

> Your relationship is from categories to subcategories (and inversely
> from categories to parent categories). So calling the relationship
> "id" makes no sense. IAC, to-many relationship names make more sense
> if they're plural ("categories" instead of "id", and "parentCategory"
> instead of "parentID").

But I'm going to need to know the id of the category the user ultimately 
selects.  And, I'm reading it as one parentID to-many ids.


> If 'childNode' is of a Cocoa class like NSXMLNode, [childNode
> stringValue] is going to return the same value each time, which
> doesn't look like what you want. If you're trying to get to various
> XML nodes or attributes, you're going to have to do it a different
> way. (Or perhaps you've invented a class that returns different
> results each time.) This all suggests that you believe that the
> relationships are implemented by matching of (string) names. They're
> not. Relationships are object references. Core Data is an object
> graph, not a database.

I'm sorry.  I should have included the other code.  I realize that 
relationships are object references.  I am handling it in a different way.  
I'm looping through the nodes.  Also, what I had as "childNode", is actually 
"categoryChildNode".


// Get an enumerator that contains all the children of this one category 
listed in the XML


NSEnumerator *categoryChildEnumerator = [[categoryNode children] 
objectEnumerator];

NSXMLNode *categoryChildNode = nil;

while (categoryChildNode = [categoryChildEnumerator nextObject]) {

   NSString *categoryChildName = [categoryChildNode name];

   if ([categoryChildName isEqualToString:@"CategoryName"])
   {
   [category setValue:[categoryChildNode stringValue] forKey:@"name"];
   }
   else if ([categoryChildName isEqualToString:@"CategoryID"])
   {
   [category setValue:[childNode stringValue] forKey:@"id"];
   }
   else if ([categoryChildName isEqualToString:@"CategoryParentID"])
   {
   [category setValue:[childNode stringValue] forKey:@"parentID"];
   }


... and so on

}

All this works fine with core data and an NSTextView.

> When you create a category object, it's going to have no subcategories
> yet, so there's nothing to set for that relationship immediately. If
> it has a parent, you need to find the parent object (possibly via the
> name of the parent object, which is another subject), and set that
> object for the parent relationship. (The inverse will get set
> automatically.)

> The to-many relationship is a NSSet, so if you ever need to add or
> remove subcategories from an object directly, you would use NSSet
> accessors. You won't use [setValue:forKey:] for that.

Given the error I received, I guess this is really my main question then.  
How do I do this?  Do I need to create a custom managed object class?


Regards,
Mark.


___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


What does 'DO' mean?

2008-12-08 Thread mark

What does 'DO' stand for?

Mark
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Communicating with Privileged Helper Tool

2015-12-23 Thread Mark Allan
Hi all,

I've got a an OS X application that needs to perform some privileged 
operations, so I've written a privileged helper tool (PHT) and it all works 
fine to call the necessary functions from my user-land application and get the 
response.

What I'm struggling with is some additional communication between the helper 
tool and my application during lengthy operations, so the application can 
provide some visual feedback to the user.

I need to support 10.6, so NSXPCConnection is out of the question. I've tried 
Distributed Objects as well as CFMessagePort/NSMessagePort but neither seems to 
work.

For DO, I can successfully vend the object within my GUI application, but I'm 
unable to connect from my helper tool. When doing the following in the PHT, I 
always get the log message saying "couldn't connect", and the method in my 
application doesn't get called.

NSConnection *theConnection = [NSConnection 
connectionWithRegisteredName: @"uk.co.blahblahconnection" host:nil];
if (!theConnection) {
asl_log(logClient, NULL, ASL_LEVEL_ERR, "Couldn't connect");
}

id myServer = [theConnection rootProxy];
if (!myServer) {
asl_log(logClient, NULL, ASL_LEVEL_ERR, "myServer is nil");
}
[myServer setProtocolForProxy:@protocol(MyServerProtocol)];

asl_log(logClient, NULL, ASL_LEVEL_ERR, "Function returned 
%d",[myServer myServerFunction]);

If I use the exact same code in a new project (GUI application), it works 
absolutely fine!

I assumed that that meant DO isn't permitted from a PHT (despite being 
permitted over a network, therefore connecting from a different user on a 
different machine entirely), so dug a bit lower and tried NSMessagePort instead.

Unfortunately, this gives me the exact same issue:

CFMessagePortRef remotePort = CFMessagePortCreateRemote(NULL, 
CFSTR("com.example.app.port.server"));

if (!remotePort) {
asl_log(asl, aslMsg, ASL_LEVEL_ERR, "no remote port");
}

When using the above code in my PHT, I get "no remote port" in the console log, 
however, trying it from a completely new GUI application project, it works 
absolutely fine.

Googling/Ducking (DuckDuckGoing?) didn't turn up anything I hadn't already 
tried, and the search on CocoaBuilder.com isn't working.

Am I missing something?  Is there a way to do what I'm looking for, or am I 
just barking up the wrong tree entirely?

Thanks
Mark


___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Communicating with Privileged Helper Tool

2015-12-23 Thread Mark Allan
Hi Damien,

Thanks for replying.

> On 23 Dec 2015, at 5:18 pm, Damien DeVille  wrote:
> 
>> Unfortunately, this gives me the exact same issue:
> 
> How are you creating the other end of the connection? The remote port will 
> just attempt to connect to the local port and not actually register the mach 
> service. If you never registered the mach service name it will fail as you’re 
> seeing.

Oops, sorry for missing this out.  Here's the code in my main GUI application:

CFMessagePortRef localPort = CFMessagePortCreateLocal(NULL, 
CFSTR("com.example.app.port.server"), Callback, nil, nil);
if (!localPort) {
NSLog(@"couldn't open localport");
}
CFRunLoopSourceRef runLoopSource = 
CFMessagePortCreateRunLoopSource(nil, localPort, 0);
CFRunLoopAddSource(CFRunLoopGetCurrent(), runLoopSource, 
kCFRunLoopCommonModes);

I know the port is getting created, as I can connect from another GUI app, I 
just can't connect from the helper tool.

I'm using the following to try and connect to it from the helper tool:

CFMessagePortRef remotePort = CFMessagePortCreateRemote(NULL, 
CFSTR("com.example.app.port.server"));

> You can use `CFMessagePortCreateLocal` in you helper tool. This function will 
> take care of registering the service name with the bootstrap server (on top 
> of giving you a port to listen on). If you’re using objc you can register 
> your mach port directly by calling `NSMachBootstrapServer.registerPort:name:`.
> 
> If you helper tool is launched by launchd, you can add the MachService name 
> to your job plist and launchd will bootstrap it in the right domain for you.

The helper tool *is* launched by launchd, however if I add the MachService name 
to the plist, won't that mean the connection is going the wrong way?  I want 
the GUI to listen for connections from the helper tool.

Thanks again
Mark


___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Very basic need, very difficult to achieve.

2016-05-04 Thread Mark Allan

___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Prioritize my own app's disk access

2016-07-05 Thread Mark Allan
Have you tried to nice/renice your process ID? I know that works for CPU usage 
but I'm not sure about other hardware resources.

A cursory glance at the man pages for getpriority & setpriority seem to 
indicate that network and disk IO can be lowered in priority so I would try 
that first to see if it also works to increase priority.

Mark

> On 5 Jul 2016, at 1:36 pm, Jonathan Taylor  
> wrote:
> 
> This is a long shot, but I thought I would ask in case an API exists to do 
> what I want. One of the roles of my code is to record video to disk as it is 
> received from a camera. A magnetic hard disk can normally keep up with this, 
> but if the user is also doing other things on the computer (e.g. long file 
> copy in the Finder) then we are unable to keep up, and accumulate an 
> ever-increasing backlog of frames waiting to be saved. This eventually leads 
> to running out of memory, thrashing, and an unresponsive computer. Dropping 
> frames is not an option. In this case, the computer is a dedicated 
> workstation running my code, so it *is* correct for me to consider my code to 
> be the number 1 priority on the computer.
> 
> What I am wondering is whether there is some way I can communicate this 
> requirement, to cause other apps such as the finder to get disk access at 
> lower priority. Or alternatively, a way that I can demand high priority 
> temporarily, at times when I identify that we have accumulated a save backlog?
> 
> I can see reasons why this is probably not possible, but I thought I’d ask if 
> anyone has any suggestions that might be relevant here.
> Thanks for any suggestions
> Jonny.



___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Communication with privileged helper crashes my main application

2016-07-18 Thread Mark Allan
Hi all,

I have an application which installs and uses a privileged helper tool that, 
for myself and most users, seems to work just fine.

I do, however, have one user (and experience tells me there'll be more who 
simply aren't reporting it) who's experiencing my app crashing when 
communicating with the helper tool.

I still need to support OS X 10.6, so I'm using the BetterAuthorizationSample 
code and the crash appears to be happening in BetterAuthorizationSampleLib.c at 
line 1665.  The error I'm seeing is

Assertion failed: (err == noErr), function BASSetDefaultRules

To me, that would indicate the user has the wrong version of the helper tool 
for the app in use, but from the diagnostics report being sent back, they are 
using the correct version of the helper with the correct version of the 
application so I've no idea what could be going wrong.

Has anyone else experienced this?  If so, do you have any suggestions please?

Many thanks
Mark


___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Running apps compiled for newer OS X versions on older versions (rant)

2016-09-05 Thread Mark Allan

> On 22 Aug 2016, at 2:27 pm, Andreas Falkenhahn  wrote:
> 
> On 22.08.2016 at 13:34 Alastair Houghton wrote:
> 
> 
>>> On 22 Aug 2016, at 12:15, Andreas Falkenhahn  wrote:
>>> Out of curiosity, I've just run a little test and compiled my app on the
>>> 10.11 system for the 10.11 target and tried to run it on the 10.6 system,
>>> just to see what happens. All I got is a message "Illegal instruction"
>>> printed to stdout, or, when starting the app through Finder, a message
>>> dialog telling me that the app has crashed and needs to be shut down.
>>> Optionally, it offered me to send a crash report to Apple.
> 
>>> That was quite a surprise to me. I mean, this is the 21st century, I think
>>> one could at least expect a message dialog telling the user that this app
>>> needs at least Mac OS 10.11 or something, but no, it just crashed, leaving
>>> the user quite clueless as to why it did so.
> 
>> The trick here is that you need to set the LSMinimumSystemVersion
>> key in your Info.plist (this appears in Xcode as “Minimum system version”).
> 
> Ah, ok, thanks!

It's probably also worth noting that you *can* compile for 10.6 using the tools 
on 10.11 by adjusting the deployment target.

The only things you need to watch out for are the fact that you're compiling 
against the 10.11 SDK which will happily let you use APIs that didn't exist in 
previous incarnations of OS X, which will obviously cause your app to crash on 
those older versions. Also beware of any new projects you start, as their 
Interface Builder files will be set to use auto-layout and won't automatically 
set their deployment target to that of the project's main target.

If you're careful, there's no reason why you can't create and compile something 
on 10.11 and have it run happily on 10.6 (or even further back if you're 
feeling adventurous!)

Mark


___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Getting at NSTextFinder from text view

2015-04-14 Thread Mark Wright
I’m afraid I may not be too helpful here because in my case I’m not using an 
NSTextView, rather mine is a custom view that displays text in various ‘cells’ 
so I had to implement the full textFinderClient protocol and build a corpus of 
searchable text for it to query against.

> On 14 Apr 2015, at 07:20, Martin Hewitson  wrote:
> 
> Alas, this doesn’t actually help. If I do this, then switch out the text 
> storage, then the very next time the user hits cmd-f the old search results 
> are highlighted again, but of course over the wrong text, and potentially out 
> of range. My impression is that the -cancelFindIndicator doesn’t clear the 
> last search, just removes it from the screen. Then when bringing back the 
> find bar (after a cancel) the old results are assumed still to be ok, rather 
> than being recalculated.

At this point you need to re-cache the data the find bar is using.

In my case, because I’m implementing the NSTextFinderClient protocol, I simply 
rebuild the model that is the store of text to search (an array of dictionaries 
as it happens).  When the text finder asks for its data it is thus correct and 
up to date.

It would seem that in both your cases NSTextView should be fully aware of all 
this by itself.  Perhaps the problem is in switching the NSTextStorage out 
without notifying the text view of the change?  Are you swapping the 
textStorage instance completely?  Perhaps changing it’s content and wrapping 
with editing calls would work? :

[textStorage beginEditing];
[textStorage setAttributedString:theNewAttributedString];
[textStorage endEditing];

Maybe there’s another way to inform the parent textView that it’s content has 
been changed.

Shane, in your case I agree, -noteClientStringWillChange sounds like exactly 
the method that’s needed.  I can’t see how to get to the textView’s textFinder 
either.  You can get to the *findBar* with [[self.textView enclosingScrollView] 
findBarView] but that’s just an NSView and likely to not be helpful.  If you’re 
not creating your own textFinder (and it seems from Martin’s experience that 
even if you do it doesn’t work) then the only thing I can think of is to 
somehow notify the textView that its content has changed and hope and presume 
that it has an internal mechanism for also notifying its textFinder.

Sorry I can’t be more helpful.



___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Understanding the "declaration of instance variables in the interface is deprecated" warning.

2015-06-03 Thread Mark Wright
That’s a ‘Class Extension’.  Furthermore, it’s under the title "Class 
Extensions Extend the Internal Implementation”.  It also mentions that it goes 
in the @implementation block…




> On 03 Jun 2015, at 15:11, Alex Zavatone  wrote:
> 
> Apple's Programming with Objective-C reference document © 2014
> 
> https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/ProgrammingWithObjectiveC.pdf
> 
> 
> Page 73
> 
> @interface XYZPerson () { 
>id _someCustomInstanceVariable;
> } 
> ...
> @end
> 
> Uhh.
> 
> Doesn't this violate Clang's own mention that "declaration of instance 
> variables in the interface is deprecated" in Apple's own recommendations and 
> documentation?
> ___
> 
> 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 cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/blue.buconero%40virgin.net
> 
> This email sent to blue.bucon...@virgin.net


___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Understanding the "declaration of instance variables in the interface is deprecated" warning.

2015-06-03 Thread Mark Wright
Sorry, yes, I misread the initial paragraph that mentions the @implementation 
block.  I actually meant implementation *file* since that’s typically where the 
class extension @interface is declared (it extends the class internally).

However, as you’ve surmised, all this talk of clang warnings regarding this is 
directly related to the primary *class interface* which is typically declared 
in the header file.  This is the class interface:

@interface SubClass : ParentClass
….
@end

The idea is to end the old ways of declaring ivars in the header and move them 
into the implementation where they belong (they’re private to the class).




> On 03 Jun 2015, at 16:02, Alex Zavatone  wrote:
> 
> 
> On Jun 3, 2015, at 10:41 AM, David Duncan wrote:
> 
>> There are 3 ways to add ivars to a class. The traditional way:
>> 
>> @interface Foo {
>>  id _bar;
>> }
>> 
>> And 2 new ways:
>> 
>> @interface Foo() { // Class extension, note the ()
>>  id _baz;
>> }
> 
> Ahhh.  Completely missed that.  Haven't seen it explained that clearly in 
> a morning of surfing.
> 
> So, running a quick test using the clang pragma for -Wobjc-interface-ivars, 
> in both the .h and .m files of a class this clarifies the Apple and Clang 
> documentation quite a bit.
> 
> In the 3 cases you outlined for declaring iVars, Clang ONLY warns about 
> declaring the ivars within the @interface parens of @interface which is 
> generally within the header file.
> 
> Both other cases (the two new ways of class extension, @interface stuff() {} 
> and @implementation stuff {} ) do not upset Clang at all.
> 
> So, generally, the rule comes down to "don't declare ivars within the 
> @interface that is probably within your .h file but if you need to (you 
> should use properties instead), you can within the class extension and 
> @implementation."
> 
> Does this sound like a proper explanation?
> 
> Thanks much, David.
> 
> 
>> @implementation Foo { // Implementation block.
>>  id _faz;
>> }
>> 
> 
> 
>>> On Jun 3, 2015, at 7:32 AM, Alex Zavatone  wrote:
>>> 
>>> Maybe I should have included the text above it.
>>> 
>>> "It's also possible to use a class extension to add custom instance 
>>> variables. These are declared inside braces in the class extension 
>>> interface."
>>> 
>>> So, I don't know how you see that it goes in the @implementation block 
>>> since the code I pasted and the line above it say it goes in the @interface.
>>> 
>>> Page 73 of 
>>> https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/ProgrammingWithObjectiveC.pdf
>>> 
>>> On Jun 3, 2015, at 10:22 AM, Mark Wright wrote:
>>> 
>>>> That’s a ‘Class Extension’.  Furthermore, it’s under the title "Class 
>>>> Extensions Extend the Internal Implementation”.  It also mentions that it 
>>>> goes in the @implementation block…
>>>> 
>>>> 
>>>> 
>>>> 
>>>>> On 03 Jun 2015, at 15:11, Alex Zavatone  wrote:
>>>>> 
>>>>> Apple's Programming with Objective-C reference document © 2014
>>>>> 
>>>>> https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/ProgrammingWithObjectiveC.pdf
>>>>> 
>>>>> 
>>>>> Page 73
>>>>> 
>>>>> @interface XYZPerson () { 
>>>>> id _someCustomInstanceVariable;
>>>>> } 
>>>>> ...
>>>>> @end
>>>>> 
>>>>> Uhh.
>>>>> 
>>>>> Doesn't this violate Clang's own mention that "declaration of instance 
>>>>> variables in the interface is deprecated" in Apple's own recommendations 
>>>>> and documentation?
>>>>> ___
>>>>> 
>>>>> 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 cocoa-dev-admins(at)lists.apple.com
>>>>> 
>>>>> Help/Unsubscribe/Update your Subscription:
>>>>> https://lists.apple.com/mailman/options/cocoa-dev/blue.buconero%40virgin.net
>>>>> 
>>>>> This email sent to blue.bucon...@virgin.net
>>>> 
>>> 
>>> ___
>>> 
>>> 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 cocoa-dev-admins(at)lists.apple.com
>>> 
>>> Help/Unsubscribe/Update your Subscription:
>>> https://lists.apple.com/mailman/options/cocoa-dev/david.duncan%40apple.com
>>> 
>>> This email sent to david.dun...@apple.com
>> 
>> --
>> David Duncan
>> 
> 


___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Understanding the "declaration of instance variables in the interface is deprecated" warning.

2015-06-03 Thread Mark Wright

> On 03 Jun 2015, at 16:27, Bernard Desgraupes  wrote:
> 
> 
> What about the @property declarations in the new scheme ?
> 
> 

I’m not sure what you’re asking, @properties are a big part of the 'new way'… 

This is not about properties though, just about the notion of moving ivars out 
of the class @interface and (if still needed) into the @implementation or class 
extension.  There’s a clang warning that can be enabled to help you if desired: 
-Wobjc-interface-ivars



> 
> Le 3 juin 2015 à 17:15, Mark Wright  a écrit :
> 
>> Sorry, yes, I misread the initial paragraph that mentions the 
>> @implementation block.  I actually meant implementation *file* since that’s 
>> typically where the class extension @interface is declared (it extends the 
>> class internally).
>> 
>> However, as you’ve surmised, all this talk of clang warnings regarding this 
>> is directly related to the primary *class interface* which is typically 
>> declared in the header file.  This is the class interface:
>> 
>> @interface SubClass : ParentClass
>> ….
>> @end
>> 
>> The idea is to end the old ways of declaring ivars in the header and move 
>> them into the implementation where they belong (they’re private to the 
>> class).
>> 
>> 
>> 
>> 
>>> On 03 Jun 2015, at 16:02, Alex Zavatone  wrote:
>>> 
>>> 
>>> On Jun 3, 2015, at 10:41 AM, David Duncan wrote:
>>> 
>>>> There are 3 ways to add ivars to a class. The traditional way:
>>>> 
>>>> @interface Foo {
>>>>id _bar;
>>>> }
>>>> 
>>>> And 2 new ways:
>>>> 
>>>> @interface Foo() { // Class extension, note the ()
>>>>id _baz;
>>>> }
>>> 
>>> Ahhh.  Completely missed that.  Haven't seen it explained that clearly 
>>> in a morning of surfing.
>>> 
>>> So, running a quick test using the clang pragma for -Wobjc-interface-ivars, 
>>> in both the .h and .m files of a class this clarifies the Apple and Clang 
>>> documentation quite a bit.
>>> 
>>> In the 3 cases you outlined for declaring iVars, Clang ONLY warns about 
>>> declaring the ivars within the @interface parens of @interface which is 
>>> generally within the header file.
>>> 
>>> Both other cases (the two new ways of class extension, @interface stuff() 
>>> {} and @implementation stuff {} ) do not upset Clang at all.
>>> 
>>> So, generally, the rule comes down to "don't declare ivars within the 
>>> @interface that is probably within your .h file but if you need to (you 
>>> should use properties instead), you can within the class extension and 
>>> @implementation."
>>> 
>>> Does this sound like a proper explanation?
>>> 
>>> Thanks much, David.
>>> 
>>> 
>>>> @implementation Foo { // Implementation block.
>>>>id _faz;
>>>> }
>>>> 
>>> 
>>> 
>>>>> On Jun 3, 2015, at 7:32 AM, Alex Zavatone  wrote:
>>>>> 
>>>>> Maybe I should have included the text above it.
>>>>> 
>>>>> "It's also possible to use a class extension to add custom instance 
>>>>> variables. These are declared inside braces in the class extension 
>>>>> interface."
>>>>> 
>>>>> So, I don't know how you see that it goes in the @implementation block 
>>>>> since the code I pasted and the line above it say it goes in the 
>>>>> @interface.
>>>>> 
>>>>> Page 73 of 
>>>>> https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/ProgrammingWithObjectiveC.pdf
>>>>> 
>>>>> On Jun 3, 2015, at 10:22 AM, Mark Wright wrote:
>>>>> 
>>>>>> That’s a ‘Class Extension’.  Furthermore, it’s under the title "Class 
>>>>>> Extensions Extend the Internal Implementation”.  It also mentions that 
>>>>>> it goes in the @implementation block…
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>>> On 03 Jun 2015, at 15:11, Alex Zavatone  wrote:
>>>>>>> 
>>>>>>> Apple's Programming with Objective-C reference document © 2014
>>>>>>> 
>>>>>>> https://developer.apple.com/library/mac/documentation/Cocoa/Co

Re: Understanding the "declaration of instance variables in the interface is deprecated" warning.

2015-06-03 Thread Mark Wright

> On 03 Jun 2015, at 17:08, Alex Zavatone  wrote:
> 
> 
> One point I haven't looked at is, "if @properties are declared within the 
> @implementation or the class extension, are they private?  And if so, 
> shouldn't they be preceded with an underscore and in that case, what does 
> that make the ivar look like"?
> 
> How are we to name private properties in modern Objective-C even though 
> properties were/are inherently public (as I understand it)
> 

This is important and is all about *scope*.

A class’s properties are only public if they’re in the header.

The .h header file describes the class’s public facing interface.  You might 
consider this the ‘outside’ of the class.

The .m implementation file describes the class’s internal private inner 
workings.  You might consider this the ‘inside’ of the class.

The header is used to advertise what is accessible to other objects (often 
called ‘clients’).  This being properties that can be set, properties that can 
be queried and methods that can be called (really ‘sending messages’).

The implementation however is considered completely out of bounds and is 
private to the class.  So, if you declare @properties inside the 
@implementation then, yes, they are private.  However, you don’t need any 
special naming conventions or extra underscores or anything like that, *they’re 
only accessible by code inside the .m file itself.*

Now, as the programmer yourself, the code you’re writing inside the .m file is 
the same sort of code you’re writing everywhere else so it’s up to you to 
always keep in mind this concept of scope.

An example: if you want an internal object that you might be wanting to get and 
set frequently *but is not part of the public facing side of the class* you’d 
declare a @property just for use inside the class.  On the other hand, maybe 
there’s an object you need inside the class but you only set it up once, 
perhaps an NSUndoManager for example, then there’s no point making it a 
property so instead you can declare this as an ivar in the @implementation 
block, set it up in the init method and just refer to it whenever it’s needed.





___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Understanding the "declaration of instance variables in the interface is deprecated" warning.

2015-06-03 Thread Mark Wright

> On 03 Jun 2015, at 18:59, Uli Kusterer  wrote:
> 
> On 03 Jun 2015, at 19:09, Alex Zavatone  wrote:
>> On Jun 3, 2015, at 12:59 PM, Uli Kusterer wrote:
>> 
>>> So you're not supposed to use the underscore convention even for your 
>>> private ivars, as Apple could add secret stuff to NSObject or any other 
>>> base class you'd collide with.
>>> 
>>> -- Uli
>> 
>> So, how are we expected to tell the private/public/ivar/property difference 
>> between all these variables we have to look at all day in an easy, clear and 
>> straightforward manner that doesn't require unnecessary thinking?
> 
> I've never had a problem telling that difference, so I can't answer that 
> question for you. If an object is complex enough that this becomes an issue, 
> I'd probably split it up into several objects so it becomes easier and more 
> obvious to grasp.
> 
> -- Uli


For what it’s worth, I’ve never had that problem either.  Most of the time 
self.whatever is used for property access, _whatever is used for ivar access 
and that’s about it.  Public or private property doesn’t matter within the .m 
file since they’re both properties of the class.  Which is which is a result of 
the overarching design of the class at a higher level.

The rest is taken care of within the IDE in some manner or can be quickly 
checked if really needed.

The only potential problem is ivars that don’t have the leading underscore.  My 
own declared ivars *are* declared with the underscore so I typically don’t see 
that problem (the IDE’s colouring helps here I suppose since they tend to look 
different).  I believe Uli is mistaken on this point, I’m pretty sure Apple 
actually recommends prefixing your own ivars in this manner (hence the way auto 
property synthesis works), it’s *methods* that generally shouldn’t be prefixed 
with an underscore (but I do that on occasion too since the naming is generally 
specific enough to render collisions vanishingly unlikely).



___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Understanding the "declaration of instance variables in the interface is deprecated" warning.

2015-06-03 Thread Mark Wright

> On 03 Jun 2015, at 19:54, Alex Zavatone  wrote:
> 
> 
> On Jun 3, 2015, at 2:30 PM, Mark Wright wrote:
> 
>> The only potential problem is ivars that don’t have the leading underscore.
> 
> My project has 377 of them.  All named the same as the property, if there is 
> a property to begin with.   That's why I'm walking down this fun little road. 
>  


Yeah, tis dog work and there’s nothing much to be done but get stuck in.  I 
don’t know if it’ll help but this is how I’d initially tackle a wholesale 
ivar-to-property refactor manually:

Step 1  -  Cut and paste all ivars out of header and into @implementation block 
- should be no change from compiler’s point of view.  This takes the header 
file out of the equation.

Step 2  -  Comment out or remove any explicit @synthesize statements.

Step 3  -  Now select each ivar in turn in the newly pasted block and ‘Edit All 
in Scope’ (ctrl + command + E).  This will select them throughout the entire 
file.  Add the leading underscore so that they conform to the expected pattern.

Step 4  -  Now that they will mirror their property if it exists, one-by-one 
comment them out and see if any compiler errors show up.  If not then the 
property is intact and the ivar is likely not needed.  If there are errors then 
maybe a property needs creating for that one or the ivar can stay depending on 
its role in the class.




___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: contextual menu plugin example in cocoa

2009-09-01 Thread Mark Munz
> - Items that change title and effect when modifier keys are used.
> - Items that reflect the context on which they're about to operate (such as
> a file name or "### Files").
> - Fine control over the conditions under which items are presented. You
> can't, for example, define a command to operate on file system objects but
> identify specific objects - like, say, the /System hierarchy - as invalid.

As someone who has been pushing better Services support since 10.0,
some of these issues are among the list of issues that I think still
need addressing to better flesh out Services.

Snow Leopard Services is a good start, but there is more to be done,
especially if it is to be used as an alternative to CMMs.

I've filed a number of bugs on Services and recommend you do so as
well. Not sure if it is better to file each issue separately or group
them together. The more folks that push for it, the better some of
these issues can be addressed without waiting another 7-8 years.


-- 
Mark Munz
unmarked software
http://www.unmarked.com/
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Crash in CFRunLoopWakeUp

2009-09-03 Thread Mark Allan

Hi all,

I've been battling with this intermittent crash for about two weeks  
now and can't figure it out for the life of me.  I've got try/catch  
blocks around nearly all my code, and definitely around any code which  
runs in a separate thread, but it's not catching whatever causes this  
crash.  Also, I'm not even convinced it's my threads causing the crash  
as this one happened while a modal sheet was being displayed, before  
any of my external threads got started.


I'm fairly sure it's not a leak or a double-free - I've tried running  
with NSZombieEnabled, NSDebugEnabled, Malloc Guard, run the Clang  
Static Analyser over it and it's not showing anything up.


If I set NSExceptionHandlingMask to 63 in the terminal before  
launching my app, I get the following lines appearing in the console  
when a crash would have happened, and the application keeps running.   
The problem is, I can't seem to catch the exception anywhere.


NSExceptionHandler has recorded the following exception:
NSUncaughtSystemExceptionException -- Uncaught system exception:  
signal 5

Stack trace:  0x94f340a9  0x95294e3b  0x94f33b11  0xc0f2a  0xc121e
0x911502bb  0x  0x932e2556  0x91115155  0x91115012


Here's the crash log I mentioned earlier.  It's an intermittent crash  
and I'm going crazy trying to debug it.  Can anyone offer me any  
insight at all please?  Should I just burn an ADC support ticket and  
be done with it?


Many thanks for any help or suggestions you can give me.

Mark


Version: 2.0 (200)
Code Type:   PPC (Native)
Parent Process:  launchd [65]

Date/Time:   2009-08-27 11:32:25.003 -0700
OS Version:  Mac OS X 10.5.8 (9L30)
Report Version:  6
Anonymous UUID:

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0001, 0x90d5c02c
Crashed Thread:  6

Thread 0:
0   libSystem.B.dylib   0x95ece1f8 mach_msg_trap + 8
1   libSystem.B.dylib   0x95ed511c mach_msg + 56
2   com.apple.CoreFoundation  	0x90d61394 CFRunLoopRunSpecific +  
1812
3   com.apple.HIToolbox   	0x938a3b14  
RunCurrentEventLoopInMode + 264
4   com.apple.HIToolbox   	0x938a3938 ReceiveNextEventCommon +  
412
5   com.apple.HIToolbox   	0x938ead04  
IsUserStillTracking(MenuSelectData*, unsigned char*) + 472
6   com.apple.HIToolbox   	0x938d47a0  
TrackMenuCommon(MenuSelectData&, unsigned char*) + 3180
7   com.apple.HIToolbox   	0x938cf854  
MenuSelectCore(MenuData*, Point, double, unsigned long,  
OpaqueMenuRef**, unsigned short*) + 228
8   com.apple.HIToolbox   	0x938cf3bc _HandleMenuSelection2 +  
388
9   com.apple.AppKit  	0x93147c54 _NSHandleCarbonMenuEvent  
+ 188

10  com.apple.AppKit0x930bd728 _DPSNextEvent + 1848
11  com.apple.AppKit  	0x930bcbfc -[NSApplication  
nextEventMatchingMask:untilDate:inMode:dequeue:] + 112

12  com.apple.AppKit0x930b689c -[NSApplication run] + 744
13  com.apple.AppKit0x93087298 NSApplicationMain + 440
14  uk.co.markallan.myapp   0x27f8 _start + 756
15  uk.co.markallan.myapp   0x24fc start + 44

Thread 1:
0   libSystem.B.dylib 	0x95ece278  
semaphore_timedwait_signal_trap + 8

1   libSystem.B.dylib   0x95f11368 _pthread_cond_wait + 1320
2   com.apple.Foundation  	0x9037f1a0 -[NSCondition  
waitUntilDate:] + 384
3   com.apple.Foundation  	0x9037efcc -[NSConditionLock  
lockWhenCondition:beforeDate:] + 268
4   com.apple.AppKit  	0x931189cc -[NSUIHeartBeat  
_heartBeatThread:] + 664

5   com.apple.Foundation0x90341d84 __NSThread__main__ + 1004
6   libSystem.B.dylib   0x95f100c4 _pthread_start + 316

Thread 2:
0   libSystem.B.dylib   0x95ece1f8 mach_msg_trap + 8
1   libSystem.B.dylib   0x95ed511c mach_msg + 56
2   com.apple.CoreFoundation  	0x90d61394 CFRunLoopRunSpecific +  
1812
3   com.apple.Foundation  	0x90398d50 + 
[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:] +  
280

4   com.apple.Foundation0x90341d84 __NSThread__main__ + 1004
5   libSystem.B.dylib   0x95f100c4 _pthread_start + 316

Thread 3:
0   libSystem.B.dylib   0x95ece1f8 mach_msg_trap + 8
1   libSystem.B.dylib   0x95ed511c mach_msg + 56
2   com.apple.CoreFoundation  	0x90d61394 CFRunLoopRunSpecific +  
1812
3   com.apple.CFNetwork   	0x94de63b0  
CFURLCacheWorkerThread(void*) + 288

4   libSystem.B.dylib   0x95f100c4 _pthread_start + 316

Thread 4:
0   libSystem.B.dylib   0x95f31d74 select$DARWIN_EXTSN + 12
1   com.apple.CoreFoundation0x90d6c808 __CFSocketManager + 764

Thread 5:
0   libSystem.B.dylib   0x95f0f904 kevent + 12
1   com.apple.Co

Re: Crash in CFRunLoopWakeUp

2009-09-05 Thread Mark Allan

On 4 Sep 2009, at 12:04 am, Greg Parker wrote:

On Sep 3, 2009, at 3:41 PM, Mark Allan wrote:
I've been battling with this intermittent crash for about two weeks  
now and can't figure it out for the life of me.  I've got try/catch  
blocks around nearly all my code, and definitely around any code  
which runs in a separate thread, but it's not catching whatever  
causes this crash.  Also, I'm not even convinced it's my threads  
causing the crash as this one happened while a modal sheet was  
being displayed, before any of my external threads got started.


Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0001, 0x90d5c02c
Crashed Thread:  6

Thread 6 Crashed:
0   com.apple.CoreFoundation0x90d5c02c CFRunLoopWakeUp + 156
1   com.apple.Foundation  	0x903ad0e4 _backgroundActivity +  
440


EXC_BREAKPOINT means the process deliberately killed itself  
(including `int3` on i386, `trap` on ppc, `__builtin_trap()` in  
gcc). In the case of CFRunLoopWakeUp(), it's halting because it  
tried and failed to send a Mach message to that run loop. Most  
likely this means the target run loop has already been deleted, but  
other Mach messaging problems are possible.


_backgroundActivity is part of NSFileHandle, to perform things like - 
readInBackgroundAndNotify. Perhaps there's bad memory management of  
an NSFileHandle somewhere.


Thank you so much for your answer.

It turns out one of my threads was running after all and I think what  
was happening was that the NSTask started by my second thread was  
completing so quickly that the thread (and hence the run loop) was  
disappearing before some notification was being sent/received.  I was  
under the impression that the waitUntilExit method was supposed to  
prevent this from happening, but it doesn't appear to be doing so  
reliably.  Anyway, I've now moved all my -release calls into the  
object's dealloc method, removed the -waitUntilExit call and the  
NSTask is now being started from the main run loop.  Hopefully that  
covers all the bases.


Because it's an intermittent bug, it'll be a while before I can be  
sure I've managed to squash it once and for all, but initial reports  
look good :)

Thanks again
Mark

___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: change in launch services binding behavior?

2009-09-05 Thread Mark Munz
On Sat, Sep 5, 2009 at 5:46 PM, Matt Neuburg wrote:

> Yeah, that's just FUD. It supports creator codes, but not in the same *way*
> that Leopard did. And since this is a major undocumented change, which has
> broken the way apps like BBEdit and Nisus (and I guess some Adobe apps)
> work, I'm hoping to get some official word on what's going on. m.


Sorry Matt.. it's broken. And it's not just BBEdit, Nisus & Adobe,
it's every app that makes use of creator codes. It's a major problem
for any app dealing with generic types like .txt, .rtf, .html, .png,
.jpg or anything where the app the creates it is not the default app
to open the given filetype. Snow Leopard appears to ignore the creator
code and launch the default app, making creator codes useless.

And Apple has been moving away from creator/type codes for years.
Sadly, they've never offered a good alternate solution to the problem.
They just pulled a basic behavior out from under the user.

-- 
Mark Munz
unmarked software
http://www.unmarked.com/
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


authorization services

2009-09-14 Thread Mark Thomas

Hi ALL,
I was wondering if anybody could tell me if it's correct to use  
authorizationExecuteWithPrivileges and wait() calls together, so the  
parent process wait's until that new child process finishes. Googling  
seems to imply this from the examples I've seen.


However reading the documentation (within XCode) the  
authorizationExecuteWithPrivileges, doesn't mention that the  
privileged process is actually a child of the process which executed  
this ? As while I can understand this, I thought maybe another process  
actually launched the requested executable as root.


Thanks for any clarifications, as I would like to be sure this is  
correct way to wait for process to finish when I call  
authorizationExecuteWithPrivileges, and not this how it works today.


Thanks
Mark.
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Mac Mini or iMac for Cocoa Development?

2009-09-14 Thread Mark Allan

On 14 Sep 2009, at 1:59 pm, Jonathan Hendry wrote:

On Sep 13, 2009, at 19:28 PM, Paul Bruneau wrote:

The iMac is so much prettier plus can drive a second display.  
Refurb store = $999 or even sometimes $849 ones show up.


The Mini can drive additional displays if you connect them through  
USB video adapters. They work quite well, although they can't do  
OpenGL.


For what it's worth the current Mac Mini has two video out ports (mini  
display port and mini DVI) and is capable of running two displays at  
the same time:

http://www.apple.com/macmini/specs.html

"Extended desktop and video mirroring: Simultaneously supports up to  
1920 by 1200 pixels on a DVI or VGA display; up to 2560 by 1600 pixels  
on a dual-link DVI display using Mini DisplayPort to Dual-Link DVI  
Adapter (sold separately)"




___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: enabling/ disabling a uitextfield

2009-09-15 Thread Mark Bateman

Hi,

anyone know how I can enable ./ disable a UItext field outside of  
IB.  I can do this as part of the XIB but I want to disable  
interaction on a particular condition.


Also is there a keyboard property i can set to enable the caps lock  
key (not the auto capitalization)




___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


TAB bar and nav bar together

2009-09-15 Thread Mark Bateman

Hi,

I have an app that uses a TAB bar controller to launch "n" view  
controllers through my main window.XIB.  I wanted each of them to  
have a nav bar with custom buttons and so I added a nav bar  
controller to the XIB for each one.  so the hierarchy in IB is


Tab bar controller
-> tab bar
 --->navigation controller
> nav bar
> view controller
> UIview
> navbar item
> tab bar item

I have this structure for each viewcontroller.  Problem is I can't  
help but think this adding a massive overhead to the application  
(launch is slower also).  is there a better way to do this. should i  
split them out into separate XIB's.


Also, one of my controllers uses a table view and from that I launch  
two XIB's dependant on the row selected.  one has a UIview with an  
embeded webview the other a UIview with a uitextview embedded.  The  
problem I have is that I use use the nav bar to start a 
UIActivityIndicatorView to show the views loading.  for the webview  
everything works ok.  for the view with the UItext view I have to  
wait for the user to add some text then it performs a load but the  
UIActivityIndicatorView on this doesn't show up on the nav bar.  did  
I miss something obvious.  I know from NSlog that the method is  
called the only difference I can see is in the CAlayer.


last but not least..

Is there a way I can stop my searchbar from disappearing when the  
user scrolls the table view (3.0 it is attached to the top of the  
table view not the nav bar)


thanks in advance.






___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Drawing a graph & testing ranges

2009-09-15 Thread Mark Bateman

Hi,

I have a completed app that calculates graph points x and y  
coordinates.  I want to present these on a graph that has an  
acceptable "envelope"  of coordinates.


I'm guessing that i need to learn how to use quartz to draw lines  
pixel by pixel to represent this on a UIview.  is there any easier /  
better way to do this that I have overlooked  i did look at  
providing a uiview background preformattted with the graph but i  
haven't found a tool that will allow me to draw that accurately.


Also can is use the NSrange objects to check if a certain set of  
coordinates is inside a particular envelope.


That is,

if I have a value of   x= 10,000   y = 211.2 and an envelope  
of   9500, 200: 13000, 211:  14000,214: 9500,214 can i use  
NS range to check if the original coordinates are inside the bounds  
of that rectangle...


if not any ideas how i might do that...





___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: authorization services

2009-09-15 Thread Mark Thomas

Hi All,
  Thanks for the replies, however I'm noticing from the snippet below

FILE* commsPipe = NULL;

DEBUG_SHOW(CFStringCreateWithFormat(kCFAllocatorDefault, NULL,  
CFSTR("Call external Tool (%s) withs Args(%s)."), cmd, pArguments) );
err = (WirelessError)AuthorizationExecuteWithPrivileges([auth  
authorizationRef], &cmd[0], (unsigned long)kAuthorizationFlagDefaults,  
argumentsChown, &commsPipe );

if ( err == noErr )
{
  NSLog(@"Waiting for profile tool to finish.");
  int child; wait(&child);
  close(fileno(commsPipe));
  NSLog(@"profile tool has finished.");
}

  I notice from the NSLog's outputs that this code doesn't seem to be  
waiting for that launched tool to finish, as I have also put some  
NSLogs within the tool itself, as I do not see NSLog's timestamps  
match up, as I would expect to see the timestamp of the above 'tool  
has finished' to be the last in console log, however I see timestamps  
after the 'wait' has returned.


  Am I missing something here ?

Thanks
Mark.

On 14 Sep 2009, at 20:57, Mark Thomas wrote:


Hi ALL,
I was wondering if anybody could tell me if it's correct to use  
authorizationExecuteWithPrivileges and wait() calls together, so the  
parent process wait's until that new child process finishes.  
Googling seems to imply this from the examples I've seen.


However reading the documentation (within XCode) the  
authorizationExecuteWithPrivileges, doesn't mention that the  
privileged process is actually a child of the process which executed  
this ? As while I can understand this, I thought maybe another  
process actually launched the requested executable as root.


Thanks for any clarifications, as I would like to be sure this is  
correct way to wait for process to finish when I call  
authorizationExecuteWithPrivileges, and not this how it works today.


Thanks
Mark.


___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: authorization services

2009-09-15 Thread Mark Thomas

Hi

> wait() only works if there's a direct child process. Other  
relationships (e.g. grandparentage) don't count.


Seems fair and matches the documentation

> I recommend that your privileged tool log its getppid() value and  
you manually compare to the getpid() value of the > initiating  
process. You should also log getpgid() of the privileged process.


  This I cannot check the pid of the initiating process as it's  
'AuthorizationExecuteWithPrivileges' which has launched this process  
and given it extra privileges somehow, as the below path to the tool  
is passed in via the 'cmd' argument, so it's the direct tool which  
being launches not something else ?


Thanks
Mark.

> Or use the 'ps' command to examine the process and process-group  
relationships.

>
> You should also read the man page for wait(2) and note the variants  
waitpid, wait3, wait4.

>
>  -- GG

On 15 Sep 2009, at 19:07, Mark Thomas wrote:


Hi All,
  Thanks for the replies, however I'm noticing from the snippet below

FILE* commsPipe = NULL;

DEBUG_SHOW(CFStringCreateWithFormat(kCFAllocatorDefault, NULL,  
CFSTR("Call external Tool (%s) withs Args(%s)."), cmd, pArguments) );
err = (WirelessError)AuthorizationExecuteWithPrivileges([auth  
authorizationRef], &cmd[0], (unsigned  
long)kAuthorizationFlagDefaults, argumentsChown, &commsPipe );

if ( err == noErr )
{
  NSLog(@"Waiting for profile tool to finish.");
  int child; wait(&child);
  close(fileno(commsPipe));
  NSLog(@"profile tool has finished.");
}

  I notice from the NSLog's outputs that this code doesn't seem to  
be waiting for that launched tool to finish, as I have also put some  
NSLogs within the tool itself, as I do not see NSLog's timestamps  
match up, as I would expect to see the timestamp of the above 'tool  
has finished' to be the last in console log, however I see  
timestamps after the 'wait' has returned.


  Am I missing something here ?

Thanks
Mark.

On 14 Sep 2009, at 20:57, Mark Thomas wrote:


Hi ALL,
I was wondering if anybody could tell me if it's correct to use  
authorizationExecuteWithPrivileges and wait() calls together, so  
the parent process wait's until that new child process finishes.  
Googling seems to imply this from the examples I've seen.


However reading the documentation (within XCode) the  
authorizationExecuteWithPrivileges, doesn't mention that the  
privileged process is actually a child of the process which  
executed this ? As while I can understand this, I thought maybe  
another process actually launched the requested executable as root.


Thanks for any clarifications, as I would like to be sure this is  
correct way to wait for process to finish when I call  
authorizationExecuteWithPrivileges, and not this how it works today.


Thanks
Mark.




___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Suppressing Crash Reporter dialogs for a task

2009-09-22 Thread Mark Woods
I have an application that launches an NSTask and checks to see if it  
returned successfully.


The task checks the validity of certain files and in some cases, the  
task could definitely crash if the data is corrupt - that is the whole  
purpose of launching a separate task. This is not a problem as the  
application notifies the user if the task was not successful.


However, when the task crashes, a Crash Reporter dialog appears which  
could be confusing for the user and ugly if several appear at once. Is  
there any way to suppress these messages and prevent them from  
appearing? I know there is a terminal command to suppress Crash  
Reporter dialogs for the entire OS - is there a similar method of  
suppressing them for a single app or task?

___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Suppressing Crash Reporter dialogs for a task

2009-09-22 Thread Mark Woods

Easier said than done. It's QuickTime that's crashing.

I'm calling canInitWithFile first and checking for errors with  
movieWithFile:error: but in certain instances it will still crash.


On Sep 22, 2009, at 5:53 PM, Kyle Sluder wrote:

On Tue, Sep 22, 2009 at 9:47 AM, Mark Woods  
 wrote:
The task checks the validity of certain files and in some cases,  
the task
could definitely crash if the data is corrupt - that is the whole  
purpose of
launching a separate task. This is not a problem as the application  
notifies

the user if the task was not successful.


Perhaps instead of crashing, you should design this tool to return
nonzero if the file is invalid?

--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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Suppressing Crash Reporter dialogs for a task

2009-09-23 Thread Mark Woods
Thanks Ken. The link you gave me was very helpful and the crash dialog  
no longer appears using the code provided. I've verified that it works  
on 10.5 and 10.6.


Thanks to everyone who posted.

Mark.

On Sep 23, 2009, at 5:57 AM, Ken Thomases wrote:


On Sep 22, 2009, at 2:27 PM, Alastair Houghton wrote:

If you was *your* process that crashed, on "normal" UNIX-like  
systems you can use signal handlers to catch the crash and do  
something about it.  Likewise, on a normal UNIX-like platform you'd  
get a SIGCHLD from the system and you could check the process exit  
status.  Or you could act as a debugger using the ptrace() API.


On OS X though, you can't (or couldn't, last I checked which was  
some time ago) intercept the system crash reporter using signal- 
related APIs because it's triggered by the lower-level Mach  
exception port.  Even if you somehow handle the signal (in the  
parent or the child process), the crash reporter is still triggered  
via the Mach exception port.


On Tiger and earlier, the CrashReporter would generate a crash  
report for a Mach exception even if it was later delivered as a  
signal and handled by the process.  Since Leopard, though, a crash  
report is only generated if the signal is not handled.  So, handling  
signals is sufficient to suppress crash reports these days.


That said, it's actually pretty simple to disconnect the  
CrashReporter from your process using Mach routines.  I had to do  
this for Wine on Tiger because Wine routinely provokes exceptions  
(and uses signal handlers to deal with the consequences) and the  
CrashReporter was suspending the process while it generated its  
report, slowing it _way_ down.


   kern_return_t kret = task_set_exception_ports(
   mach_task_self(),
   EXC_MASK_BAD_ACCESS | EXC_MASK_BAD_INSTRUCTION |  
EXC_MASK_ARITHMETIC,

   MACH_PORT_NULL,
   EXCEPTION_STATE_IDENTITY,
   MACHINE_THREAD_STATE);

I went into it in more depth here: 
http://lists.apple.com/archives/unix-porting/2007/Mar/msg9.html

Regards,
Ken



___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSApplication's behavior

2009-09-30 Thread Mark Hurley
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 MainWindowController.h/.m setting
appropriately the relationship between them.  MainWindowController inherits
from NSWindowController and follows the proper procedures of fixing the
"MainWindow" in the init* methods as mentioned in Apple docs.  I also set
the window and delegate

My assumption (based on docs) is that my default or main NIB to be loaded is
the one that has NSApplication set as the File's Owner.  And this should
remain as MainMenu, to ensure the responders for the Menu's are properly
registered/set up.

What is the recommended way to move MainWindow in another NIB? Shall I
instantiate it from applicationDidFinishLaunching? Is there another way
through interface builder, where one NIB refers to the other, etc?

Thank you,

Mark
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


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  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?

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 if all these defaults for your app are visible from the  
settings application on the iPhone (it is too late and my brain is  
fried); that would screw up this approach.


Todd

___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/mark.woollard%40mac.com

This email sent to mark.wooll...@mac.com

___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSPasteboard -> NSTextView

2009-10-03 Thread Mark Munz
You might just go with some built-in NSTextView methods:

- (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pboard

which should take the richest data type available or if you want to
specify the type:

- (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pboard type:(NSString *)type



On Sat, Oct 3, 2009 at 1:13 PM, Kyle Sluder  wrote:
> On Oct 3, 2009, at 12:59 PM, Knut Lorenzen  wrote:
>
>> How do I assign the RTF(D) in NSPasteboard to my NSTextView
>> *programmatically*?
>
> Deserialize the data off the pasteboard, and mutate the text view's
> associated text storage. Undo events will be logged correctly, but you may
> want to set the undo group name to be a bit more descriptive.
>
> Hope that helps,
> --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 cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/unmarked%40gmail.com
>
> This email sent to unmar...@gmail.com
>



-- 
Mark Munz
unmarked software
http://www.unmarked.com/
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


UITabBar & UIActionSheet

2009-10-07 Thread Mark Bateman

Hi,

I have an app that uses a TabBarController and on certain of the  
tabbar items I want the user to be presented with a UIActionsheet even  
if the user presses the the same tab bar item that is currently  
selected.


I have tried the viewwillappear method and that works only if i select  
another icon first.


I also tried to use setneedsdisplay using the delegate method - (void) 
tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item

but this method never runs.

Any help would be appreciated

Mark.
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Subclassing a view class from an external framework

2009-10-13 Thread Mark Gallegly
I have an NSView subclass defined in a framework called FrameworkView. The
FrameworkView class has a property like so:

@property (nonatomic, retain) IBOutlet NSView* someView;

This framework has the necessary code in it to work as an Interface Builder
plugin, and everything seems to work fine in Interface Builder.


However, if I subclass the FrameworkView in a separate project that contains
my .app target, with say a class called MyFrameworkViewSubclass, I get a
warning like this when building the .xib file containing
MyFrameworkViewSubclass:

The 'someView' outlet of 'MyFrameworkViewSubclass' is connected to 'Custom
View' but 'someView' is no longer defined on MyFrameworkViewSubclass.

Now, within IB the outlet shows up and I am able to make the connection, and
when the app runs everything works fine, but for some reason XCode spits out
this warning. Does anybody know what is going on here and how to get rid of
the warning?
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Subclassing a view class from an external framework

2009-10-13 Thread Mark Gallegly
I have an NSView subclass defined in a framework called FrameworkView. The
FrameworkView class has a property like so:

@property (nonatomic, retain) IBOutlet NSView* someView;

This framework has the necessary code in it to work as an Interface Builder
plugin, and everything seems to work fine in Interface Builder.


However, if I subclass the FrameworkView in a separate project that contains
my .app target, with say a class called MyFrameworkViewSubclass, I get a
warning like this when building the .xib file containing
MyFrameworkViewSubclass:

The 'someView' outlet of 'MyFrameworkViewSubclass' is connected to 'Custom
View' but 'someView' is no longer defined on MyFrameworkViewSubclass.

Now, within IB the outlet shows up and I am able to make the connection, and
when the app runs everything works fine, but for some reason XCode spits out
this warning. Does anybody know what is going on here and how to get rid of
the warning?
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Subclassing a view class from an external framework

2009-10-15 Thread Mark Gallegly
Turns out the issue I was having was caused by the fact that I did not have
the headers in the framework bundle, once I figured out how to add the
header files to the framework - which was not easy to figure out - and did
the 'reload all class files' menu item in IB for each xib the problem went
away. At least on my xcode 3.2.1 machine. On a machine running xcode 3.1 the
warnings still show up, but I have not bothered to open each xib and choose
to 'reload all class files' yet..

Mark


On 10/15/09 4:24 PM, "Kevin Cathey"  wrote:

>> Although Interface Builder 3 is supposed to automatically sync with header
>> files in your project, it seems to have trouble with headers in frameworks.
> Which version of Interface Builder were you seeing this on? IB 3.2.x will
> parse the headers for all frameworks you've linked against in your Xcode
> project.
> 
> Kevin
> 
> On 13 Oct 2009, at 07:55, Jeff Johnson wrote:
> 
>> Hi Mark.
>> 
>> I had the same problem with NSWindow subclasses. Although Interface Builder 3
>> is supposed to automatically sync with header files in your project, it seems
>> to have trouble with headers in frameworks. What I did was select "Read Class
>> Files..." in the "File" menu of Interface Builder and read the header file
>> for my framework class. The solved the problem for me.
>> 
>> -Jeff
>> 
>> 
>> On Oct 12, 2009, at 11:22 AM, Mark Gallegly wrote:
>> 
>>> I have an NSView subclass defined in a framework called FrameworkView. The
>>> FrameworkView class has a property like so:
>>> 
>>> @property (nonatomic, retain) IBOutlet NSView* someView;
>>> 
>>> This framework has the necessary code in it to work as an Interface Builder
>>> plugin, and everything seems to work fine in Interface Builder.
>>> 
>>> 
>>> However, if I subclass the FrameworkView in a separate project that contains
>>> my .app target, with say a class called MyFrameworkViewSubclass, I get a
>>> warning like this when building the .xib file containing
>>> MyFrameworkViewSubclass:
>>> 
>>> The 'someView' outlet of 'MyFrameworkViewSubclass' is connected to 'Custom
>>> View' but 'someView' is no longer defined on MyFrameworkViewSubclass.
>>> 
>>> Now, within IB the outlet shows up and I am able to make the connection, and
>>> when the app runs everything works fine, but for some reason XCode spits out
>>> this warning. Does anybody know what is going on here and how to get rid of
>>> the warning?
>> 
>> ___
>> 
>> 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 cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/cathey%40apple.com
>> 
>> This email sent to cat...@apple.com
> 


___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: unsleep the display programatically?

2009-10-18 Thread Mark Ritchie

On 18-Oct-2009, at 5:11 PM, jon wrote:
can you unsleep the display programatically?   i haven't found a  
method yet for doing it?


Hrm... In what situation would you want to do such a thing?
And what if the user has set security to require a password after  
being in sleep?

M.
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: unsleep the display programatically?

2009-10-19 Thread Mark Ritchie

On 18-Oct-2009, at 6:36 PM, David LeBer wrote:

On 2009-10-18, at 9:30 PM, jon wrote:
Hi David,   that would not work,  because the display does need to  
sleep,  it would be working a long time,   and at nightbut  
needs to let people know that it is done.   i have an alarm go off,  
but people can know it has gone off  much better from a distance if  
suddenly the room is filled with light from the display waking up.

surely there is a method for this?  wouldn't there be?

I don't know, and haven't tried, but what happens if you call:
UpdateSystemActivity(UsrActivity);



I'm not sure if it's more correct to pass the OverallAct instead of  
UsrActivity since in this case there actually isn't any specific user  
activity  Does anyone know how the arguments are interpreted?


Given what you're trying to do, it would seem that UpdateSystemActivity 
() is going to do what you want however, I stand by what I said  
before, if the user has set their security settings to require a  
password then this call will cause the password screen to showup.   
After a short time of no password being entered, the screen will go  
back to sleep (At least it did for the test app that I wrote using  
10.6.1 to check this out).  That might be enough for you, I don't know.


Good luck with it!
M.
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Neophyte Question: Connecting to nib objects

2009-10-19 Thread Mark Ritchie

On 19-Oct-2009, at 8:51 AM, Phil Hystad wrote:
Given that I have an object defined in the nib (aka xib), for  
example, an object that responds to a given view, what is the  
correct way for my running application (if it is in some other  
state, not responding to an action) to obtain a pointer to that  
object.


The "File's Owner" is what you're after!

The docs are here:
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html#//apple_ref/doc/uid/1051i-CH4-SW15


Maybe a second question is "Do I ever need to do this?".

Yes, yes, yes and yes! ;-)

Some examples:
1) initialization of state so that objects from a nib file are in sync  
with your controller

2) state updates
3) enable/disable of optional UI components
4) dynamic changes to the UI which could not be foreseen before runtime.
etc, etc

Regards!
M.
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


[MEET] (Sydney/Australia) CocoaHeads/NSCoder Sydney - November 5th - Mac/iPhone hack night

2009-10-29 Thread Mark Aufflick
First Thursday of the month == one of CocoaHeads Sydney or NSCoder
Sydney (Australia).

After much discussion (and an excellent Guinness pie) we have decided
on an alternating calendar - one month we'll have a CocoaHeads night,
with presentations etc. - the alternate month we'll have an NSCoder
night where everyone brings their laptops and gets to work on their
iPhone or Mac projects, showing off your code, asking questions,
whatever. Newbies allowed!

In either case we start at 6:30pm followed by beer posthaste!

Same as last month, we are in room CB02.05.32 of UTS (University of
Technology Sydney).

That's Building 2, Level 5, Room 32. You can access building 2 via the
main entrance. This will be our room for the rest of the year.

You might find the UTS Broadway campus map useful: http://is.gd/3l1iu

Thanks to David Morrison for organising the room as always.

A gleaming pile of laptops will surely guide you, else call me on my
mobile: 0438 700 647.

The Australian CocoaHeads mailing list is at
http://groups.google.com/group/cocoaheadsau

-- 
Mark Aufflick
  contact info at http://mark.aufflick.com/about/contact
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: why use pow(x, 2)?

2009-11-02 Thread Mark Gallegly
Hasn't this gone off topic? Shouldn't this be discussed on the pow(x,x) Vs.
x * x forum?


On 11/2/09 2:10 PM, "Luke the Hiesterman"  wrote:

> I can't speak for others, but I never meant to actually argue that pow
> (x, 2) is clearer than x * x. My argument was that each author should
> use whichever version he or she thinks is clearer. There are rarely
> absolutes about that sort of thing, as clarity is subjective by its
> very nature. I urge programmers to use the clearer choice, whatever
> that might be to them.
> 
> Luke
> 
> On Nov 2, 2009, at 2:01 PM, Chris Williams wrote:
> 
>> How completely rude of you, Greg, to confuse a good argument with
>> facts :)
>> 
>> But it still does leave the style question: is pow(x,2) clearer than
>> x*x?
>> 
>> In the case from the OP, I think that the pow is clearer, because it
>> is
>> implementing an algorithm that calls specifically for x-squared.
>> And in the
>> case where x is not a simple variable, but rather an expression,
>> it's even
>> more clear (and less prone to typing errors).
>> 
>> My $0.02...
>> 
>>> From: Greg Parker 
>>> Subject: Re: why use pow(x, 2)?
>>> 
>>> This is easy to test empirically. In this simple case, the compiler
>>> does optimize pow(x, 2) directly to a single-instruction x*x.
>>> 
>>> % cat test.c
>>> #include 
>>> int main(int argc, char **argv) {
>>> return pow(argc, 2);
>>> }
>>> % cc -O3 test.c -o - -S
>>> [...]
>>> _main:
>>> LFB17:
>>> pushq %rbp// build stack frame
>>> LCFI0:
>>> movq %rsp, %rbp   // build stack frame
>>> LCFI1:
>>> cvtsi2sd %edi, %xmm0  // convert int argc to float
>>> mulsd %xmm0, %xmm0  // pow(argc, 2)
>>> cvttsd2si %xmm0, %eax  // convert float->int for return
>>> leave
>>> ret
>> 
>> ___
>> 
>> 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 cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/luketheh%40apple.com
>> 
>> This email sent to luket...@apple.com
> 
> ___
> 
> 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 cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/markgallegly%40gmail.com
> 
> This email sent to markgalle...@gmail.com


___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


[MEET] (Sydney/Australia) CHANGE OF VENUE - CocoaHeads/NSCoder Sydney - November 5th - Mac/iPhone hack night

2009-11-02 Thread Mark Aufflick
Hi All,

The kind people at Snepo are letting us use their offices for our hack night
this Friday, including Wifi and a fridge (fridge contents not included I'm
assuming).

Snepo Research office is at 2/21 Mary St, Surry Hills, Cameron will need to
buzz you in, so buzz Unit 2 when you arrive or call Cameron on 0418 115 045
or me on 0438 700 647.

Google maps 
link<http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=Corner+Reservoir+St+and++Mary+St,+Surry+Hills+NSW+2010,+Australia&sll=-33.880991,151.21022&sspn=0.001338,0.00284&ie=UTF8&hq=&hnear=Reservoir+St+&ll=-33.881267,151.210131&spn=0.001338,0.00284&z=19&layer=c&cbll=-33.88108,151.210144&panoid=zF0zPjRtt1075goKl2Aq1A&cbp=12,301.66,,0,-7.26>

See you there!

Mark.

On Fri, Oct 30, 2009 at 12:38 PM, Mark Aufflick wrote:

> First Thursday of the month == one of CocoaHeads Sydney or NSCoder
> Sydney (Australia).
>
> After much discussion (and an excellent Guinness pie) we have decided
> on an alternating calendar - one month we'll have a CocoaHeads night,
> with presentations etc. - the alternate month we'll have an NSCoder
> night where everyone brings their laptops and gets to work on their
> iPhone or Mac projects, showing off your code, asking questions,
> whatever. Newbies allowed!
>
> In either case we start at 6:30pm followed by beer posthaste!
>
> Same as last month, we are in room CB02.05.32 of UTS (University of
> Technology Sydney).
>
> That's Building 2, Level 5, Room 32. You can access building 2 via the
> main entrance. This will be our room for the rest of the year.
>
> You might find the UTS Broadway campus map useful: http://is.gd/3l1iu
>
> Thanks to David Morrison for organising the room as always.
>
> A gleaming pile of laptops will surely guide you, else call me on my
> mobile: 0438 700 647.
>
> The Australian CocoaHeads mailing list is at
> http://groups.google.com/group/cocoaheadsau
>
> --
> Mark Aufflick
>  contact info at http://mark.aufflick.com/about/contact
>



-- 
Mark Aufflick
 contact info at http://mark.aufflick.com/about/contact
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [MEET] (Sydney/Australia) CHANGE OF VENUE - CocoaHeads/NSCoder Sydney - November 5th - Mac/iPhone hack night

2009-11-02 Thread Mark Aufflick
Typo - It's this Thursday Nov 5th, not Friday.

On Tue, Nov 3, 2009 at 1:49 PM, Mark Aufflick wrote:

> Hi All,
>
> The kind people at Snepo are letting us use their offices for our hack
> night this Friday, including Wifi and a fridge (fridge contents not included
> I'm assuming).
>
> Snepo Research office is at 2/21 Mary St, Surry Hills, Cameron will need to
> buzz you in, so buzz Unit 2 when you arrive or call Cameron on 0418 115 045
> or me on 0438 700 647.
>
> Google maps 
> link<http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=Corner+Reservoir+St+and++Mary+St,+Surry+Hills+NSW+2010,+Australia&sll=-33.880991,151.21022&sspn=0.001338,0.00284&ie=UTF8&hq=&hnear=Reservoir+St+&ll=-33.881267,151.210131&spn=0.001338,0.00284&z=19&layer=c&cbll=-33.88108,151.210144&panoid=zF0zPjRtt1075goKl2Aq1A&cbp=12,301.66,,0,-7.26>
>
> See you there!
>
> Mark.
>
> On Fri, Oct 30, 2009 at 12:38 PM, Mark Aufflick 
> wrote:
>
>> First Thursday of the month == one of CocoaHeads Sydney or NSCoder
>> Sydney (Australia).
>>
>> After much discussion (and an excellent Guinness pie) we have decided
>> on an alternating calendar - one month we'll have a CocoaHeads night,
>> with presentations etc. - the alternate month we'll have an NSCoder
>> night where everyone brings their laptops and gets to work on their
>> iPhone or Mac projects, showing off your code, asking questions,
>> whatever. Newbies allowed!
>>
>> In either case we start at 6:30pm followed by beer posthaste!
>>
>> Same as last month, we are in room CB02.05.32 of UTS (University of
>> Technology Sydney).
>>
>> That's Building 2, Level 5, Room 32. You can access building 2 via the
>> main entrance. This will be our room for the rest of the year.
>>
>> You might find the UTS Broadway campus map useful: http://is.gd/3l1iu
>>
>> Thanks to David Morrison for organising the room as always.
>>
>> A gleaming pile of laptops will surely guide you, else call me on my
>> mobile: 0438 700 647.
>>
>> The Australian CocoaHeads mailing list is at
>> http://groups.google.com/group/cocoaheadsau
>>
>> --
>> Mark Aufflick
>>  contact info at http://mark.aufflick.com/about/contact
>>
>
>
>
> --
> Mark Aufflick
>  contact info at http://mark.aufflick.com/about/contact
>



-- 
Mark Aufflick
 contact info at http://mark.aufflick.com/about/contact
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSString of selected text in NSTextView

2009-11-07 Thread Mark Gallegly
Here is one:

-(NSString*) getSelectedTextInTextView:(NSTextView*)theTextView
{
NSRange range = [theTextView selectedRange];
NSData* rtfData = [theTextView RTFFromRange: range];
NSAttributedString* aStr = [[NSAttributedString alloc]
initWithRTFData:rtfData documentAttributes: NULL];
NSString* str = [aStr string];
return str;
}


On 11/7/09 5:57 PM, "Todd Heberlein"  wrote:

> This seems like a simple task, but it has become a series of steps. Am
> I missing a simple method that will do this?
> 
> I have a Text View and want to get the selected text in an NSString
> form. I can get an NSString for the entire NSTextView (-string), but
> to get the string for just the selected text seems to take multiple
> steps:
> 
> NSRange range = [theTextView selectedRange];
> NSData* rtfData = [theTextView RTFFromRange: range];
> NSAttributedString* aStr = [[NSAttributedString alloc]
> initWithRTFData:rtfData documentAttributes: NULL];
> NSString* str = [aStr string];
> 
> Is there a method that combines all these steps?
> 
> Thanks,
> 
> Todd
> 
> ___
> 
> 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 cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/markgallegly%40gmail.com
> 
> This email sent to markgalle...@gmail.com


___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSArrayController question [Solved]

2009-11-10 Thread Mark Smith
That's actually what I thought the answer should be when I saw your  
original question, but really didn't know how to articulate it as I'm  
new to cocoa programming myself.


Get some sleep. :-)

Best Regards,
Mark Smith

Sent from my iPhone

On Nov 10, 2009, at 11:26 PM, Oftenwrong Soong > wrote:



Hi all,

Sorry. I'm just too tired to be programming right now. The solution  
to my earlier question is to send the action to my document  
controller instead of sending it to the NSArrayController. My  
document controller's action method calls NSArrayController's  
newObject, does its additional processing, and then calls  
NSArrayController's addObject. For future reference, when you think  
of subclassing framework classes, that's a sign that it's time for  
bed. :)


Thanks,
Soong



- Original Message 
From: Oftenwrong Soong 
To: cocoa-dev@lists.apple.com
Sent: Tue, November 10, 2009 7:26:45 PM
Subject: NSArrayController question

Hi all,

I have a very common UI layout: a Master/Detail view. The Master is  
a NSTableView bound via a NSArrayController to a NSMutableArray,  
with buttons for Add and Remove whose Target/Action is the  
NSArrayController's add and remove actions. The Detail box displays  
attributes of the NSArrayController's current selection. Like I  
said, a pretty common setup.


I want to intercept the "add" action to fill in default information  
for the newly added item. I can't do this in the model's initializer  
because each item's default information will be computed based on  
all the prior information in the NSMutableArray. It belongs in the  
controller and not in the model. Is this an appropriate time to  
subclass NSArrayController? Is there a more elegant way to do it?  
Most of what I have read about subclassing says that you shouldn't  
do it. :)


Thanks,
Soong




___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/oftenwrongsoong%40yahoo.com

This email sent to oftenwrongso...@yahoo.com




___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/mark%40estimatesoftware.com

This email sent to m...@estimatesoftware.com


___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa Sounds

2009-11-10 Thread Mark Gallegly
That's a good idea. Someone should of suggested that before.

On Nov 10, 2009 11:36 PM, "mlist0...@gmail.com"  wrote:

What I've done in the past is to simply play a silent sound before I
actually need to play a sound for real. This "primes the pump".

_murat

On Nov 9, 2009, at 11:40 AM, lbland wrote: > hi- > > On Nov 9, 2009, at
12:58 PM, Chunk 1978 wro...
> http://lists.apple.com/mailman/options/cocoa-dev/mlist0987%40gmail.com
>
> This email sent to mlist0...@gmail.com

___ Cocoa-dev mailing list (
Cocoa-dev@lists.apple.com)...
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa Sounds

2009-11-11 Thread Mark Gallegly
That's a shame, sounds of silence always seem to work for Simon & Garfunkel.

On Nov 10, 2009 11:56 PM, "Chunk 1978"  wrote:

i have a launch sound of silence already implemented in my code, but it
doesn't always work for some reason.

On Wed, Nov 11, 2009 at 2:39 AM, Mark Gallegly wrote:

> That's a good idea. Someone should of suggested that before. > > On Nov
10, 2009 11:36 PM, "mlist...
> ___

> > 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 c...
> http://lists.apple.com/mailman/options/cocoa-dev/chunk1978%40gmail.com
>
> This email sent to chunk1...@gmail.com

> ___ Cocoa-dev mailing list
(cocoa-...@lists.apple.com...

Please do not post admin requests or moderator comments to the list. Contact
the moderators at cocoa...
http://lists.apple.com/mailman/options/cocoa-dev/markgallegly%40gmail.com

This email sent to markgalle...@gmail.com
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Using HTML form in cocoa app

2009-11-13 Thread Mark Reddick
Hey all. I'm trying to figure out how to use an HTML form in a cocoa  
application.


The situation is that I need to be able to read files that contain an  
HTML page with an HTML form in it. I then need to somehow present this  
form to the user (in my cocoa app) and let them fill it out. These  
forms have input fields on them but no submit buttons. So, in my cocoa  
app I need to be able to grab the data the user fills in on the form.  
These HTML form files will be on the local computer. No web access is  
involved here. These forms will basically be to allow people to extend  
my application.


At first I thought I'd read the HTML form file and convert it to a  
cocoa form but that doesn't seem very feasible. I then tried throwing  
a webview on my window and present the HTML form that way. This works  
fine but I am unable to figure out how to access the form data after  
the user fills it in (as the form is not being submitted). I tried  
using DOM to get to the data but it only seems to access the form  
without the user data.


So, if anyone has a solution for this or ideas I can try, please let  
me know.


Thanks,

Mark

___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Creation date of Feb 14th 1946 - Why?

2009-11-16 Thread Mark Woollard
It was the day ENIAC, the first general purpose electronic computer was 
revealed to the world. I guess you can't have a digital file created before 
that ;-)

Mark

On 16 Nov 2009, at 17:16, Matt Gough wrote:

> Can someone let me know if there is something magical about a file having its 
> creation date set to:
> 
> 1946-02-14 08:34:56 +
> 
> I am guessing it is a special flag used by Finder to let it know that a file 
> is busy (since even after a restart a file with such a creation date is shown 
> dimmed)
> Am I correct?
> 
> Are there any other magic dates that are being used?
> 
> FYI - I am writing a FUSE file system and need to prevent such dates ending 
> up at the back-end.
> 
> Thanks
> 
> Matt Gough___
> 
> 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 cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/mark.woollard%40mac.com
> 
> This email sent to mark.wooll...@mac.com

___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Help with Background Tasks

2009-11-18 Thread Mark Bateman
Hi,

I am developing an App with a table that will hold URL content.  I want to 
download that in the background and then have it update the table as it 
arrives.  I tried using 

[self performSelectorInBackground:@selector(MakeURLRequest:) 
withObject:UrlRequest];

but I can't get it to return an object id or get notification or tracking so I 
can trigger a table reload.

Can anyone point me in the right direction.


___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Help with Background Tasks

2009-11-19 Thread Mark Bateman
List,

OK to make my request a little more detailed.  In my tableview "cell for row at 
index path" method I make several URL requests that fill in a cell within a 
section.  E.G

section 1 - row 1  (1st url request)
section 1 - row 2 (2nd URL request),  etc...

section 2 - row 1 (URL request Same as url request in section 1 but different 
data supplied)
section 2 - row 2 (URL request Same as url request in section 1 but different 
data supplied)

Obviously I want each URL request as it ends to update the correct index path 
table cell. I would like to send index path as one of the parameters so that 
when I perform the selector in background. I can modify that specific cell with 
that result.  The method below only allows me one object, I'm not sure if the 
withObject:withObject: method will sole the problem if i create a compound 
selector with the @selector.

[self performSelectorInBackground:@selector(MakeURLRequest:) 
withObject:URLRequest];

All that said I would like to use URLconnection instead (as jens points out) 
they are asynch but again I have the problem of allocating the responses back 
to the correct index path object.



Jens,

Thanks..




On Nov 18, 2009, at 2:35 PM, Jens Alfke wrote:

> 
> On Nov 18, 2009, at 11:21 AM, Mark Bateman wrote:
> 
>> I am developing an App with a table that will hold URL content.  I want to 
>> download that in the background and then have it update the table as it 
>> arrives.
> 
> Don't do this using threads. Cocoa's networking APIs are asynchronous, so you 
> can start a download using NSURLConnection and it will run in the background 
> and notify your delegate when it's complete.
> 
> You almost never need to start threads in Cocoa programming. This can be hard 
> to adjust to if you come from other frameworks, esp. Java.
> 
> —Jens
> 

___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Custom Tableview cell and grouped tables

2009-11-19 Thread Mark Bateman
Hi,

I have created a custom tableview cell and it works great, but when I choose 
the grouped view in the tableview nothing happens, what have I missed.


___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Custom Tableview cell and grouped tables

2009-11-19 Thread Mark Bateman
1. this is iphone
2. after i change the UItableview style to the "grouped style" the table 
continues to show as before a regular table with my custom cells but the 
tableview is not in the grouped style.

hope that makes my question much clearer.


On Nov 19, 2009, at 2:10 PM, Fritz Anderson wrote:

> On 19 Nov 2009, at 12:45 PM, Mark Bateman wrote:
> 
>> I have created a custom tableview cell and it works great, but when I choose 
>> the grouped view in the tableview nothing happens, what have I missed.
> 
> You've told us next to nothing, so you really haven't asked a question.
> 
> I can infer that you're talking about UITableView and UITableViewCell in the 
> iPhone OS, but it's hard to tell. You don't actually say. Cocoa runs on both 
> the iPhone OS and Mac OS X. You should say which.
> 
> What do you mean "nothing happens?" They don't draw? They take up space but 
> are blank? They don't respond to touches? Their subviews don't behave as 
> expected? They didn't respond to table-editing gestures? What did you expect 
> to happen?
> 
> When it "worked great," did the table have sections? When you changed to the 
> grouped style, did you add sections, and are you sure you're accounting for 
> them?
> 
> Have you done anything for yourself to debug your problem? Have you run the 
> app with the debugger? Have you set breakpoints in the relevant methods? Does 
> anything show up in the Debugger Log? <http://whathaveyoutried.com/>
> 
>   — F
> 

___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Custom Tableview cell and grouped tables

2009-11-19 Thread Mark Bateman
I'm referring to changing the style in the NIB prior to compiling, not on the 
fly in the application, if that helps.


On Nov 19, 2009, at 2:19 PM, Luke the Hiesterman wrote:

> You can't change the style of a table after it's been created. Only place to 
> set the table's style is initWithFrame:style:
> 
> Luke
> 
> On Nov 19, 2009, at 11:17 AM, Mark Bateman wrote:
> 
>> 1. this is iphone
>> 2. after i change the UItableview style to the "grouped style" the table 
>> continues to show as before a regular table with my custom cells but the 
>> tableview is not in the grouped style.
>> 
>> hope that makes my question much clearer.
>> 
>> 
>> On Nov 19, 2009, at 2:10 PM, Fritz Anderson wrote:
>> 
>>> On 19 Nov 2009, at 12:45 PM, Mark Bateman wrote:
>>> 
>>>> I have created a custom tableview cell and it works great, but when I 
>>>> choose the grouped view in the tableview nothing happens, what have I 
>>>> missed.
>>> 
>>> You've told us next to nothing, so you really haven't asked a question.
>>> 
>>> I can infer that you're talking about UITableView and UITableViewCell in 
>>> the iPhone OS, but it's hard to tell. You don't actually say. Cocoa runs on 
>>> both the iPhone OS and Mac OS X. You should say which.
>>> 
>>> What do you mean "nothing happens?" They don't draw? They take up space but 
>>> are blank? They don't respond to touches? Their subviews don't behave as 
>>> expected? They didn't respond to table-editing gestures? What did you 
>>> expect to happen?
>>> 
>>> When it "worked great," did the table have sections? When you changed to 
>>> the grouped style, did you add sections, and are you sure you're accounting 
>>> for them?
>>> 
>>> Have you done anything for yourself to debug your problem? Have you run the 
>>> app with the debugger? Have you set breakpoints in the relevant methods? 
>>> Does anything show up in the Debugger Log? <http://whathaveyoutried.com/>
>>> 
>>> — F
>>> 
>> 
>> ___
>> 
>> 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 cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/luketheh%40apple.com
>> 
>> This email sent to luket...@apple.com
> 

___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSTableView retain count problem

2009-11-21 Thread Mark Munz
Since records is a instance variable, you don't want to autorelease
it. You want it to stick around until the object is destroyed.

Delete the [records autorelease]; reference in createDictionary.

then add

(void) dealloc
{
 [records release];
 [super dealloc];
}


On Sat, Nov 21, 2009 at 3:49 PM, Shane
 wrote:
> I have an NSTableView where the data source and delegate are assigned
> to an NSViewController, and in this controller I have the two data
> source methods.
>
> numberOfRowsInTableView
> tableView: objectValueForTableColumn row:
>
> This project was previously done through xcode using Tiger, and I've
> just now imported it in Snow Leopard. My problem is that my table view
> isn't being populated. I see numberOfRowsInTableView being called, but
> it's always returning 0. So I looked at 'records' and the retain count
> is always 0, yet 'records' in my other method 'createDictionary' which
> populates the table is always 1.
>
> @interface DataViewController : MainViewController {
>        …
>        NSMutableArray *records;
> }
>
> - (id) init
> {
>        records = [[NSMutableArray alloc] init];
> }
>
> - (int) createDictionary
> {
>        [records autorelease];
>
>        // retain count for records at this point is 1.
>
>        while (…) {
>                [records addObject:currentLine];
>        }
>
>        [myTableView reloadData];
>
>        // retain count for records at this point is 1.
>        // records is not populated and returns the proper count.
>
>        return [records count];
> }
>
>
> This method gets called before (when NSTableView is setup) and during
> createDictionary (where I populate my NSTableView) and always returns
> 0.
>
> - (int) numberOfRowsInTableView:(NSTableView *)tableView
> {
>    // retain count for records at this point is always 0.
>    return [records count];
> }
>
>
> Anyone see what I'm doing wrong here, or know how I can better track this 
> down?
> ___
>
> 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 cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/unmarked%40gmail.com
>
> This email sent to unmar...@gmail.com
>



-- 
Mark Munz
unmarked software
http://www.unmarked.com/
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


My try/catch block isn't catching exceptions on 10.6

2009-11-26 Thread Mark Allan

Hi folks,

I've got a section of code which crashes intermittently under 10.6 but  
despite being enclosed in try/catch blocks, my app is still forced to  
terminate.  For what it's worth, all of the crash reports are from  
10.6.x.  My app seems to be rock solid when run under 10.4 and 10.5.   
In fact, for one user, the same version of my app only started  
crashing after he had upgraded to 10.6.  It could be coincidental but  
I figured it was worth mentioning.


Anyway, the method (code below) loops through a mutable array of  
NSStrings. Each string acts as a key into two NSMutableDictionary  
objects (myItemList and imminentList).


If the key isn't found in either dictionary, it gets added to  
myItemList with an NSNumber value of -1.  After I've examined all the  
keys, the mutable array is emptied so we don't see these particular  
items again the next time round the thread's runloop.


I've got everything apart from the NSLock logic surrounded in a try/ 
catch block, but when it goes wrong the catch block doesn't get  
executed and my app crashes.


I can't reproduce the problem myself (my main dev machine is still  
10.5.8), but enough people have it that I know it's not an isolated  
incident.


The fact that it's crashing at CFBasicHashFindBucket implies some  
issue with the calls to objectForKey or setObject:ForKey, but does  
anyone know what could be causing it to crash so badly that my  
exception handler can't catch it?


Many thanks for your help,
Mark

PS. Yes, I know there are faster and more efficient ways to enumerate  
an array, but the old-school 'for' loop approach still comes to mind  
first and I still prefer it for small arrays.



Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0010
Crashed Thread:  3

Thread 3 Crashed:
0   com.apple.CoreFoundation  	0x9079e7aa  
___CFBasicHashFindBucket1 + 170
1   com.apple.CoreFoundation  	0x907a6aac CFBasicHashFindBucket +  
252

2   com.apple.CoreFoundation0x907a6973 CFDictionaryGetValue + 131
3   ...allan.identifier0x9e06 -[Dispatcher  
copyItemsToMyItemListFrom:] + 577

4   ...allan.identifier 0x99b9 -[Dispatcher 
mainLoop:] + 223
5   com.apple.Foundation0x940d58d8 -[NSThread main] + 45
6   com.apple.Foundation0x940d5888 __NSThread__main__ + 1499
7   libSystem.B.dylib   0x9435dfbd _pthread_start + 345
8   libSystem.B.dylib   0x9435de42 thread_start + 34


- (void) copyItemsToMyItemListFrom: (NSMutableArray *) listToCopyFrom {
	// we only need to lock the itemList as it's the only array whose  
contents may be changed by external threads. We don't really care if  
imminentList changes because the dictionary object will always be  
there even if the contents aren't.

[self getLock4itemList];
@try{
[listToCopyFrom retain];
int counter = 0;
for (counter=0; counter < [listToCopyFrom count]; counter++) {
NSString *theKey = [listToCopyFrom 
objectAtIndex:counter];
if(theKey != nil){
if ( ([myItemList objectForKey:theKey] == nil) && ([imminentList  
objectForKey:theKey] == nil)) {
	[myItemList setObject:[NSNumber numberWithLongLong:-1]  
forKey:theKey];

}
else{
//theKey already exists, don't add it 
again
}
}
}
		[listToCopyFrom removeAllObjects];	// remove all the objects so we  
don't see them again next time around
		[listToCopyFrom release];			// counteracts the retain at start of  
this method

}
@catch (NSException *e) {
NSLog(@"Splat! Reason: %@", [e reason]);
}
[self releaseLock4itemList];
}

Thanks
Mark

___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Please help, i'm newbe in cocoa + oracle programming.

2010-03-25 Thread Mark Woollard
Are you compiling your Objective-C code as ObjC++ or straight ObjC? Name your 
source files with .mm extension to indicate ObjC++. Also read the following:

http://developer.apple.com/Mac/library/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocCPlusPlus.html

Mark

On 15 Mar 2010, at 07:08, Pavel Subach wrote:

> i know how-to use occi library in C++ based project on macosx, but when i try 
> including iostream and occi.h in my objective-c class when i build my cocoa 
> application and get error such as Cannot find iostream and more others bug...
> If anybody know step-by-step guide for implementing occi library in 
> objective-c or how to create cocoa application that work with Oracle DB, 
> please help :(___
> 
> 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 cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/mark.woollard%40mac.com
> 
> This email sent to mark.wooll...@mac.com

___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Using a SOAP Web Service from iPhone

2010-04-09 Thread Mark Wade


This may be helpful:

http://code.google.com/p/kernseife/

On Apr 9, 2010, at 11:00 AM, Joanna Carter wrote:


Hi folks

Well, I've just spent the last few days, getting to grips with  
consuming a web service.


I though I would try things out in an OS X app first, then move to  
the iPhone, which is the end target.


So, I decided to use WSMakeStubs on the WSDL - it did a reasonable  
job, apart from one or two minot bugs and niggles. Eventually, I got  
a test app working to prove that I could read the service.


Then I thought I would move the app to iPhone, only to discover that  
the classes generated by WSStubMaker would not compile and that I  
would have to find another way to create the stub classes for an  
iPhone app.


Can I ask what is considered the best route to go?

Joanna

--
Joanna Carter
Carter Consulting

___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/markwade%40optonline.net

This email sent to markw...@optonline.net


Mark Wade
markw...@optonline.net



___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Warning with an initializer method of AMWorkflow

2010-04-18 Thread Mark Munz
If I try to create an AMWorkflow using the initContentsWithURL:error:
method, I get a warning.

- (id)myRunWorkflowAtURL:(NSURL*)fileURL withInput:(id)workflowInput
error:(NSError**)error
{

   NSError* createError = nil;
   AMWorkflow* workflow = [[AMWorkflow alloc]
initWithContentsOfURL:fileURL error:&createError];
}

warning: incompatible Objective-C types 'struct NSError **', expected
'struct NSDictionary **' when passing argument 2 of
'initWithContentsOfURL:error:' from distinct Objective-C type

The 2nd parameter is documented as NSError** as documented in AMWorkflow.h

- (id)initWithContentsOfURL:(NSURL *)fileURL error:(NSError **)outError;

This appears to happen with either the 10.5 SDK or 10.6 SDK.
I've logged this bug ID# 7877547

I'd like to know how safe it is to ignore the warning or typecast to
remove the warning?
Not sure how else to create this object to work with AMWorkflowController.

Thanks.

-- 
Mark Munz
unmarked software
http://www.unmarked.com/
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Warning with an initializer method of AMWorkflow

2010-04-19 Thread Mark Munz
I haven't run into this in such a long time that I completely forgot
this could still occur. While I do wish it wasn't necessary to do the
cast, it does solve the problem.

So this works as expected:

AMWorkflow* workflow = [ (AMWorkflow*)[AMWorkflow alloc]
initWithContentsOfURL:fileURL error:&createError];

Thanks for the memory jog.

Mark

On Sun, Apr 18, 2010 at 1:01 PM, Ken Thomases  wrote:
> On Apr 18, 2010, at 2:56 PM, Mark Munz wrote:
>
>> If I try to create an AMWorkflow using the initContentsWithURL:error:
>> method, I get a warning.
>
>> warning: incompatible Objective-C types 'struct NSError **', expected
>> 'struct NSDictionary **' when passing argument 2 of
>> 'initWithContentsOfURL:error:' from distinct Objective-C type
>>
>> The 2nd parameter is documented as NSError** as documented in AMWorkflow.h
>>
>> - (id)initWithContentsOfURL:(NSURL *)fileURL error:(NSError **)outError;
>>
>> This appears to happen with either the 10.5 SDK or 10.6 SDK.
>> I've logged this bug ID# 7877547
>>
>> I'd like to know how safe it is to ignore the warning or typecast to
>> remove the warning?
>
> This is the same issue as in this recent thread 
> <http://lists.apple.com/archives/cocoa-dev/2010/Apr/msg00816.html>.  There is 
> a typecast involved in the solution, but probably not the one you're 
> considering.
>
> Cheers,
> Ken
>
>



-- 
Mark Munz
unmarked software
http://www.unmarked.com/
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Automator Actions and CFBundleExecutable key

2010-04-21 Thread Mark Munz
I've run into this as well -- particularly with Automator Actions. I
decided to finally track down the issue.

The root cause appears to be that the RunScript Phase is being called
too early in the build process. So when amlint checks for an
executable, it hasn't been built yet.

If you look at your detailed log, you'll likely see that the RunScript
occurs right after resources are copies, but before the code is
compiled.

I put ${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME} in the input files
list. Not sure if that is the proper way or not to force the Run
Script to wait for the actual product to be built, but it appears to
do the job.

Hope that helps.

Mark

On Sun, Apr 11, 2010 at 12:31 PM, Scott Ribe  wrote:
>> There are no other warnings tossed out during either compilation
>> Any thoughts?
>
> Compare the build transcripts for debug vs release for clues as to why debug
> is not producing an executable.
>
> --
> Scott Ribe
> scott_r...@killerbytes.com
> http://www.killerbytes.com/
> (303) 722-0567 voice
>
>
> ___
>
> 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 cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/unmarked%40gmail.com
>
> This email sent to unmar...@gmail.com
>



-- 
Mark Munz
unmarked software
http://www.unmarked.com/
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [iPhone] File coping application

2010-04-26 Thread Mark Ritchie
Hey!

On 26/Apr/2010, at 9:04 AM, Arun wrote:
> Is it possible to copy files form iPhone on to a Mac when iPhone is
> connected to USB?

That depends on what kind of files! ;-)  
(Images for example are easily copied.)
What are you trying to do?
M.

___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


extent of the "scratch pad" nature of a Core Data managed object context

2010-05-09 Thread Mark Sanvitale
Curious if anyone can confirm or deny a behavior of Core Data's managed object 
context.  I understand that there is the committed/real-deal state of an 
on-disk, persistent store, and there is a managed object context (moc) that is 
described as a "scratch pad" that builds up modifications to the on-disk state 
and which can then be either committed or discarded.  This is cool.  
Furthermore, the moc can be searched via a "fetch request", and I can control 
how a fetch treats proposed but uncommitted changes via the 
setIncludesPendingChanges method.

Now, the question.  If the pending changes within my moc includes the deletion 
of objects and the to-be-deleted objects include a relationship property with a 
"cascade" delete rule then should the pool of objects returned by an 
includesPendingChanges = YES fetch include the pending, directly deleted 
objects?  What about the pending, indirectly deleted objects?  It is my belief 
that the scratch pad nature of the moc does not extend into the full reaches of 
pending deletions.

Thanks in advance.

Mark Sanvitale
Real Networks___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Posix error 24

2010-05-15 Thread Mark Ritchie
On 15/May/2010, at 7:44 AM, Ken Thomases wrote:
> Probably easier and more productive to use Instruments and the File Activity 
> instrument.
Far easier, no code changes needed and you get the stack traces for each file 
action.  
Definitely the way to go! ;-)
M.

___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Get controller from nib

2010-05-18 Thread Mark Ritchie
On 18/May/2010, at 4:28 PM, James Maxwell wrote:
> What I'm not understanding is how to allow newly created MIDIInstrument 
> objects to read the available/enabled ports from Central_MIDI_Controller. I 
> know this is probably really simple, but how do I grab a reference to a 
> controller object loaded only in the MainMenu.nib file?

Hey James,
I would do it this way:
Modify the nib file containing the MIDIInstrument so that FilesOwner is class 
Central_MIDI_Controller.
Create an outlet on MIDIInstrument which would point to Central_MIDI_Controller.
In IB, wire up the outlet from MIDIInstrument to FilesOwner.
Finally change the code which loads the nib containing MIDIInstrument to pass 
the one instance of Central_MIDI_Controller as the FilesOwner.
The unarchiving process will handle connecting up the bits at runtime.
HTH,
M.
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Get controller from nib

2010-05-18 Thread Mark Ritchie
Hey James!

On 18/May/2010, at 5:00 PM, James Maxwell wrote:
> From the MIDIInstrument init, I can run [[NSApp delegate] midiController] and 
> get the instance of Central_MIDI_Controller loaded in the nib. As I say, it 
> feels a bit hackish. Though it does work, and advice is still welcome.

Sure, that works in a pinch but doesn't work so well when you might want to 
connect different parent objects to the child objects in the nib file.  Using 
FilesOwner is much more flexible.   And yes, I know that you can change the 
NSApp delegate each time before opening a new nib file (and I might have even 
done that many moons ago ;-) however that is really getting hackish! ;-)
M.
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Get controller from nib

2010-05-18 Thread Mark Ritchie
Hey James!

On 18/May/2010, at 5:26 PM, James Maxwell wrote:
> Anyway, I do like the sound of your design... So, does the instance loaded in 
> IB become a one-off, or does it somehow "alias" (for lack of a better word) 
> all future instances? I was under the impression that the instance in IB was 
> just a single instance, and that it wouldn't have any effect on future 
> instances.

Objects which are unarchived from a nib file are independent of other objects 
already loaded into your application.  That's why File's Owner exists, so that 
the newly instantiated objects can be connected up to objects which already 
exist.

It would seem that I've put you on the wrong path though wrt loading nib files. 
I misunderstood and thought you had  a nib file with an instance of 
MIDIInstrument and it's associated UI already and that's what you were trying 
to hook up.  If that's not the case then what I suggested won't be right.

Such fun.  I see that you've posted more on this.
M.
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Get controller from nib

2010-05-18 Thread Mark Ritchie
Hey James!

On 18/May/2010, at 5:42 PM, James Maxwell wrote:
> Okay, getting a bit deeper into this, I realize I'm still "in the woods", so 
> to speak. I'm going to have to hook up my NSTableView to set the *selected* 
> port and channel for the MIDIInstruments, which means it's pretty much going 
> to have to be loaded in the nib after all (since the MIDIInstrument has to 
> respond to the selection made in the table). So, if I do that, and make the 
> connections to Central_MIDI_Controller, as recommended, will the 
> NSArrayController be able to add new instances of MIDIInstrument (and new 
> rows to my table), which also have these connections? As I mentioned, I need 
> an arbitrary number of MIDIInstruments. 

It seems to me that you are not separating the model, view and controller bits.
To me, MIDIInstrument sounds like it's part of the Model (the internal state of 
things) and it should not be talking directly to the TableView.  The controller 
in the middle should be tracking and co-ordinating things.
I hope that helps!
M.
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Invalid exception being thrown: CIUnsharpMask is not kvc for the key inputIntensity - except that it is

2010-06-08 Thread Mark Aufflick
Hi all,

So I have a property, unsharpMaskFilter, setup in init like so:

CIFilter *filter = [CIFilter filterWithName:@"CIUnsharpMask"];
[filter setDefaults];
[filter setValue:[NSNumber numberWithFloat:0.1]
forKey:@"inputIntensity"];
[filter setValue:[NSNumber numberWithFloat:0.2] forKey:@"inputRadius"];

NSLog(@"filter:%@ ii:%@ ir:%@", filter, [filter
valueForKey:@"inputIntensity"], [filter valueForKey:@"inputRadius"]);
self.unsharpMaskFilter = filter;

the NSLog line shows that we can call valueForKey on inputIntensity,
but when it is assigned to the property, bindings in the xib kick in
(there's a slider and a text field whose value is bound to
unsharpMaskFilter.inputIntensity) and I get the following exception:

*** Terminating app due to uncaught exception
'NSUnknownKeyException', reason: '[
valueForUndefinedKey:]: this class is not key value coding-compliant
for the key inputIntensity.'

What on earth is going on here? The very line before the exception is
triggered we successfully call [filter valueForKey:@"inputIntensity"].
I feel like I've tried everything including rebuilding a brand new xib
from scratch with nothing but a single text field.

A fresh idea would be welcomed!

Cheers,

Mark.

-- 
Mark Aufflick
  http://mark.aufflick.com/about/contact
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Invalid exception being thrown: CIUnsharpMask is not kvc for the key inputIntensity - except that it is

2010-06-09 Thread Mark Aufflick
Thanks Stephen,

I'm using garbage collection, but if the problem was that the object
wasn't retained, then the exception wouldn't be thrown by a
CIUnsharpMask object surely?

Thanks for your sample project - works exactly as you would expect! I
noticed that your Foo object instance was frozen in the xib - I'm
using a custom loaded xib and the binding is to the file owner.

So I did an experiment with your simple sample project making the
bindings be with file owner instead of a frozen object, but they still
worked as expected.

Next test is a custom loaded view xib, but that will have to wait for tomorrow.

It is very vexing!

Mark.

On Wed, Jun 9, 2010 at 4:01 PM, Stephen J. Butler
 wrote:
> On Wed, Jun 9, 2010 at 12:35 AM, Mark Aufflick  
> wrote:
>>        *** Terminating app due to uncaught exception
>> 'NSUnknownKeyException', reason: '[
>> valueForUndefinedKey:]: this class is not key value coding-compliant
>> for the key inputIntensity.'
>
> Works for me: 
> <https://netfiles.uiuc.edu/xythoswfs/webui/_xy-38333754_2-t_0Bnz6Glp>
> Are you sure your property is set to retain the filter?
>



-- 
Mark Aufflick
 contact info at http://pumptheory.com/about

 http://pumptheory.com
 iPhone and Enterprise software development
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Invalid exception being thrown: CIUnsharpMask is not kvc for the key inputIntensity - except that it is

2010-06-10 Thread Mark Aufflick
Very good idea, but they are indeed the same:

2010-06-10 19:56:47.036 Redacted[4259:a0f] filter:{CIUnsharpMask {
inputImage = "";
inputIntensity = "0.1";
inputRadius = "0.2";
}} ii:0.1 ir:0.2 pointer:0x2000f84e0
2010-06-10 19:56:47.040 Redacted[4259:a0f] An uncaught exception was raised
2010-06-10 19:56:47.040 Redacted[4259:a0f] [ valueForUndefinedKey:]: this class is not key value
coding-compliant for the key inputIntensity.
2010-06-10 19:56:47.044 Redacted[4259:a0f] *** Terminating app due to
uncaught exception 'NSUnknownKeyException', reason: '[ valueForUndefinedKey:]: this class is not key value
coding-compliant for the key inputIntensity.'

I also refactored your basic example to more match my app (separate
view xib using a programatically created instance of Foo as the file
owner) and it still works fine...

At this point I'm thinking of starting a new project and importing my
code in a bit at a time to find the culprit...



On Thu, Jun 10, 2010 at 3:33 AM, Stephen J. Butler
 wrote:
> On Wed, Jun 9, 2010 at 3:50 AM, Mark Aufflick  wrote:
>> So I did an experiment with your simple sample project making the
>> bindings be with file owner instead of a frozen object, but they still
>> worked as expected.
>>
>> Next test is a custom loaded view xib, but that will have to wait for 
>> tomorrow.
>>
>> It is very vexing!
>
> It is! What happens when you change your NSLog statement to:
>
>    NSLog( @"filter:%@ ii:%@ ir:%@ pointer:%p",
>          filter,
>          [filter valueForKey:@"inputIntensity"],
>          [filter valueForKey:@"inputRadius"],
>          filter
>          );
>
> In particular, I'm interested if the pointer output here matches the
> one in the KVC error.
>



-- 
Mark Aufflick
 contact info at http://pumptheory.com/about

 http://pumptheory.com
 iPhone and Enterprise software development
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSTableView: move rows through drag and drop?

2011-08-10 Thread Mark Munz
Docs say draggedImage:endedAt:operation: has been around since 10.0

In 10.7, NSDraggingSource became a formal protocol, but the informal
protocol has been around a while.

On Wed, Aug 10, 2011 at 2:30 PM, Izak van Langevelde  wrote:
>
> On 2011-08-10, at 5:11 PM, Jens Alfke wrote:
>
>>
>> On Aug 9, 2011, at 8:43 PM, Izak van Langevelde wrote:
>>
>>> Now I want to allow drag and drop from one document to another, and my 
>>> first guess was to write the row data to the pasteboard.
>>> What puzzles me, is how to delete the row data from the source data, in 
>>> case of a move. That is, my acceptDrop inserts the row data into the 
>>> destination data source, but the indexes of the source rows are not 
>>> available at this point.
>>
>> And also consider that the destination of the drag could be a different app, 
>> in which case you don’t get an -acceptDrop: call at all.
>>
>> Instead, to handle the source end of a move (or delete, i.e. drag to Trash) 
>> you need to implement the NSDraggingSource protocol’s 
>> -draggedImage:endedAt:operation: method. If the operation was a move or 
>> delete, you should delete the dragged items.
>
> I considered it, but it seems to have been available since Lion, and am 
> looking for something which works on older systems.
>
> I am a little surprised that there does not seem to be an elegant solution 
> for inter-document drag-and-drop moves within the same application, other 
> than keeping track of the row indexes in the source, putting the row numbers 
> on the pasteboard and notifying the source of a successful move to the 
> destination. I had expected to put the row data on the pasteboard to 
> facilitate cross-document drag-and-drop, but as I need the row indexes 
> anyway, it does not really make sense to put anything other than row indexes 
> on the pasteboard.
>
> ---
> Grinnikend door het leven...
>
> ___
>
> 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 cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/unmarked%40gmail.com
>
> This email sent to unmar...@gmail.com
>



-- 
Mark Munz
unmarked software
http://www.unmarked.com/
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: rightMouseDown: never called in NSView subclass

2011-08-25 Thread Mark Munz
The description of what you're trying to do is a bit vague, but
couldn't you just create an NSToolbarItem with a custom view? You
might need to do a few tweaks if it needs to resize with the window,
but that sure seems easier than trying to circumvent the framework as
you are describing. You'd be able to do virtually anything you want in
that custom view and you wouldn't be necessarily fighting the
framework.

Alternatively, you could just create a custom view that is placed at
the top of your content view of the window and just ignore the
NSToolbar class completely.


On Thu, Aug 25, 2011 at 9:46 PM, Indragie Karunaratne
 wrote:
> Is there any other way to do this aside from what I'm doing right now? As far 
> as I know, I have two choices:
>
> a) Use this method and risk something breaking
> b) Write an NSToolbar clone
>
> I know the risks, but if I could get this to pass through Mac App Store 
> submission then I'd rather deal with possibility of something breaking later 
> on that than to rewrite NSToolbar. The one last thing I can think of is to 
> use the ObjC runtime to retain the original implementation, swizzle hitTest: 
> and check whether my view is under the cursor, and if not, just call the 
> original implementation. However, method swizzling always feels like a dirty 
> workaround so I'm not sure if it would be much better than this (and if it 
> would be acceptable in the MAS).
>
> On 2011-08-25, at 10:40 PM, Quincey Morris wrote:
>
>> Ah, well, yes, if IB doesn't expose the class you need, that makes 
>> subclassing impractical. But in that case, replacing the NSToolbarView 
>> method seems even more undesirable.
>>
>>
>> On Aug 25, 2011, at 20:55 , Indragie Karunaratne wrote:
>>
>>> I'm not sure how I would get NSToolbar to use my subclass of NSToolbarView. 
>>> I can't set the class of the toolbar *view* itself in IB (nor 
>>> programatically, as far as I know), because NSToolbarView is a private 
>>> class that NSToolbar uses to implement the UI. I can of course change the 
>>> class of the NSToolbar object itself to a subclass, but this wouldn't help 
>>> me much as there is no public NSToolbar method that allows me to change the 
>>> class of its view.
>>
>>
>
> ___
>
> 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 cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/unmarked%40gmail.com
>
> This email sent to unmar...@gmail.com
>



-- 
Mark Munz
unmarked software
http://www.unmarked.com/
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: rightMouseDown: never called in NSView subclass

2011-08-26 Thread Mark Munz
OK, I misread your first message. That said, I'd go with the option to
just put your "toolbar" view as part of the contentView of the window.

If your view is within the contentView of the window, it will be part
of the fullscreen window in Lion. Just make sure it can resize with
the window. Xcode gives an example of this. All the navigation stuff
that doesn't sit in the toolbar is still displayed when in fullscreen
mode.

You can specify a custom window to use when in fullscreen mode if you
want a different layout.

If you're set on doing it as an NSToolbarItem, work within its
limitations. If you just need a global right-click option, consider
adding a simple button to give you that access, like the Action button
in the Finder. You might also employ click & hold (like the navigation
buttons in Safari).

I'd also file a bug so that this behavior may change in the future.
Don't count on it, but it's good for Apple to know what developers
need.


On Fri, Aug 26, 2011 at 9:36 AM, Indragie Karunaratne
 wrote:
> Thats actually what I'm doing right now, its an NSToolbarItem with a custom 
> view but like I said, the right mouse events are not passed to it by 
> NSToolbarView without that little hack. I could, as you said, circumvent 
> NSToolbar completely, but when a view is placed outside of the toolbar, it 
> disappears when Lion goes into fullscreen mode. I don't know if this is a bug 
> or intended behaviour.
>
> On 2011-08-26, at 12:03 AM, Mark Munz wrote:
>
>> The description of what you're trying to do is a bit vague, but
>> couldn't you just create an NSToolbarItem with a custom view? You
>> might need to do a few tweaks if it needs to resize with the window,
>> but that sure seems easier than trying to circumvent the framework as
>> you are describing. You'd be able to do virtually anything you want in
>> that custom view and you wouldn't be necessarily fighting the
>> framework.
>>
>> Alternatively, you could just create a custom view that is placed at
>> the top of your content view of the window and just ignore the
>> NSToolbar class completely.
>>
>>
>> On Thu, Aug 25, 2011 at 9:46 PM, Indragie Karunaratne
>>  wrote:
>>> Is there any other way to do this aside from what I'm doing right now? As 
>>> far as I know, I have two choices:
>>>
>>> a) Use this method and risk something breaking
>>> b) Write an NSToolbar clone
>>>
>>> I know the risks, but if I could get this to pass through Mac App Store 
>>> submission then I'd rather deal with possibility of something breaking 
>>> later on that than to rewrite NSToolbar. The one last thing I can think of 
>>> is to use the ObjC runtime to retain the original implementation, swizzle 
>>> hitTest: and check whether my view is under the cursor, and if not, just 
>>> call the original implementation. However, method swizzling always feels 
>>> like a dirty workaround so I'm not sure if it would be much better than 
>>> this (and if it would be acceptable in the MAS).
>>>
>>> On 2011-08-25, at 10:40 PM, Quincey Morris wrote:
>>>
>>>> Ah, well, yes, if IB doesn't expose the class you need, that makes 
>>>> subclassing impractical. But in that case, replacing the NSToolbarView 
>>>> method seems even more undesirable.
>>>>
>>>>
>>>> On Aug 25, 2011, at 20:55 , Indragie Karunaratne wrote:
>>>>
>>>>> I'm not sure how I would get NSToolbar to use my subclass of 
>>>>> NSToolbarView. I can't set the class of the toolbar *view* itself in IB 
>>>>> (nor programatically, as far as I know), because NSToolbarView is a 
>>>>> private class that NSToolbar uses to implement the UI. I can of course 
>>>>> change the class of the NSToolbar object itself to a subclass, but this 
>>>>> wouldn't help me much as there is no public NSToolbar method that allows 
>>>>> me to change the class of its view.
>>>>
>>>>
>>>
>>> ___
>>>
>>> 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 cocoa-dev-admins(at)lists.apple.com
>>>
>>> Help/Unsubscribe/Update your Subscription:
>>> http://lists.apple.com/mailman/options/cocoa-dev/unmarked%40gmail.com
>>>
>>> This email sent to unmar...@gmail.com
>>>
>>
>>
>>
>> --
>> Mark Munz
>> unmarked software
>> http://www.unmarked.com/
>
>



-- 
Mark Munz
unmarked software
http://www.unmarked.com/
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: using AppKit additions in background threads

2011-09-06 Thread Mark Munz
One thing that 3rd party developers *now* have to also consider: Can
you call /usr/bin/textutil in a sandboxed app? Based on all the
limitations I'm seeing when trying to sandbox an app, my bet is no --
although I haven't tested this particular case.


On Tue, Sep 6, 2011 at 1:48 PM, Jens Alfke  wrote:
>
> On Sep 6, 2011, at 12:23 PM, Douglas Davidson wrote:
>
>> One possibility would be to convert the HTML to RTF or RTFD, which could be 
>> loaded in the background.  For that sort of conversion we already have a 
>> tool on the system, /usr/bin/textutil.
>
> Wow, that is good to know about; I didn’t know it existed.
>
> According to the man page it can translate between: txt, html, rtf, rtfd, 
> doc, docx, wordml, odt, webarchive.
> I should file a Radar to add Markdown and Textile to that list ;-)
>
> —Jens___
>
> 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 cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/unmarked%40gmail.com
>
> This email sent to unmar...@gmail.com
>



-- 
Mark Munz
unmarked software
http://www.unmarked.com/
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: using AppKit additions in background threads

2011-09-06 Thread Mark Munz
>Yes that is a good question.  Another is whether I can execute utilities in 
>/usr/bin from a App Store app.

Typically that is not a problem if you are executing something that
already exists there and then use paths that point to an approved
location. But this does become an issue with sandboxing and sandboxing
will become a requirement for MAS apps.

I do believe you can use one of the temporary exceptions to allow you
to read anything on the disk. Not sure if there is one that isn't more
narrowly defined that might work -- info on much of sandboxing,
solutions to numerous issues encountered, remains fairly minimal,
despite the fast approaching deadline for Mac App Store requirement.

If you're concerned about sandboxing (and many of us that want to be
in the App Store will need to be concerned), I recommend going to the
Apple's dev forum on the topic.


On Tue, Sep 6, 2011 at 9:37 PM, Michael Thon  wrote:
>
> On Sep 7, 2011, at 4:22 AM, Glenn L. Austin wrote:
>
>> I would ship the files pre-converted.
>>
> If I could do that I wouldn't have any of these problems in the first place.  
> The app is converting users' documents.
>
>> On Sep 6, 2011, at 4:29 PM, Mark Munz wrote:
>>
>>> One thing that 3rd party developers *now* have to also consider: Can
>>> you call /usr/bin/textutil in a sandboxed app? Based on all the
>>> limitations I'm seeing when trying to sandbox an app, my bet is no --
>>> although I haven't tested this particular case.
>
> Yes that is a good question.  Another is whether I can execute utilities in 
> /usr/bin from a App Store app.
>
>>>
>>>
>>> On Tue, Sep 6, 2011 at 1:48 PM, Jens Alfke  wrote:
>>>>
>>>> On Sep 6, 2011, at 12:23 PM, Douglas Davidson wrote:
>>>>
>>>>> One possibility would be to convert the HTML to RTF or RTFD, which could 
>>>>> be loaded in the background.  For that sort of conversion we already have 
>>>>> a tool on the system, /usr/bin/textutil.
>>>>
>>>> Wow, that is good to know about; I didn’t know it existed.
>>>>
>>>> According to the man page it can translate between: txt, html, rtf, rtfd, 
>>>> doc, docx, wordml, odt, webarchive.
>>>> I should file a Radar to add Markdown and Textile to that list ;-)
>>
>>
>> --
>> Glenn L. Austin, Computer Wizard and Race Car Driver         <><
>> "Where there's breath, there's hope!"
>> <http://www.austin-soft.com>
>>
>> ___
>>
>> 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 cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/mike%40michaelrthon.com
>>
>> This email sent to m...@michaelrthon.com
>
>
>



-- 
Mark Munz
unmarked software
http://www.unmarked.com/
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Stepwise articles

2011-10-17 Thread Mark Taeery
Hi all,

does anybody have a copy of the following article:

http://www.stepwise.com/Articles/Technical/MemoryManagement.html

archive.org appears not to have it.

Thanks,

Mark

___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Future for Mac applications

2011-10-31 Thread Mark Munz
On Mon, Oct 31, 2011 at 12:11 PM, Sean McBride  wrote:
>
> It's also worth remembering that the Mac App Store is not required either,
> unlike on iOS devices.  If you can't or don't want to sandbox, you can
> distribute elsewhere.

It's also worth noting that if you want to use iCloud, sandboxing is a
requirement.

IMHO, sandboxing was rushed out without real world testing. Apple
announced sandboxing to developers in June and with a GM just a few
weeks later, Lion shipped in July. As far as I can tell, there have
been no documented changes/fixes to the sandbox issues in either
10.7.1 or 10.7.2. Apple is often quite vague about what it fixes in
its updates, so it is possible they did something, but did not
document it. And there are no indications of fixes for any of the
issues mentioned in the devforums.

So while the argument can be made that apps aren't required to use the
sandbox, it quickly becomes a hindrance both in making your app
available and supporting things like iCloud.

-- 
Mark Munz
unmarked software
http://www.unmarked.com/
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Future for Mac applications

2011-10-31 Thread Mark Munz
Oops, I mixed up entitlements and sandboxing. Sandboxing is a subset
of entitlements and it is possible to enable entitlements for iCloud
without enabling sandboxing for the app. I thought I recalled
engineers referencing iCloud & the sandbox together during WWDC, but I
must have been mistaken.

I still believe that sandboxing is not ready for primetime and that it
is a concern for a lot of apps that currently are approved for the Mac
App Store, but cannot be sandboxed due to limitations of its
implementation. I know that my own app, which is in the Mac App Store,
requires additional API support from Apple to enable me to sandbox it
without losing significant functionality.


On Mon, Oct 31, 2011 at 8:40 PM, Mark Munz  wrote:
> On Mon, Oct 31, 2011 at 12:11 PM, Sean McBride  
> wrote:
>>
>> It's also worth remembering that the Mac App Store is not required either,
>> unlike on iOS devices.  If you can't or don't want to sandbox, you can
>> distribute elsewhere.
>
> It's also worth noting that if you want to use iCloud, sandboxing is a
> requirement.
>
> IMHO, sandboxing was rushed out without real world testing. Apple
> announced sandboxing to developers in June and with a GM just a few
> weeks later, Lion shipped in July. As far as I can tell, there have
> been no documented changes/fixes to the sandbox issues in either
> 10.7.1 or 10.7.2. Apple is often quite vague about what it fixes in
> its updates, so it is possible they did something, but did not
> document it. And there are no indications of fixes for any of the
> issues mentioned in the devforums.
>
> So while the argument can be made that apps aren't required to use the
> sandbox, it quickly becomes a hindrance both in making your app
> available and supporting things like iCloud.
>
> --
> Mark Munz
> unmarked software
> http://www.unmarked.com/
>



-- 
Mark Munz
unmarked software
http://www.unmarked.com/
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Sandboxing disallows AppleEvents?

2011-11-03 Thread Mark Munz
You can temporarily request to send apple events to specific apps --
but Apple has made it clear that they are doing us a favor with that
and that it won't last.

Welcome to the new sandboxed world.

On Thu, Nov 3, 2011 at 11:10 AM, Rick Mann  wrote:
> Really? I get how that kind of functionality has made Windoze such a security 
> hole forever, but there are so many Mac applications that depend on being 
> able to send AppleEvents, especially within a suite of applications (all from 
> the same vendor).
>
> Is there no facility for doing this?
>
> Thanks,
>


-- 
Mark Munz
unmarked software
http://www.unmarked.com/
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Any success with SMLoginItemSetEnabled?

2011-11-07 Thread Mark Munz
While you should file a bug, expect it to be duped and don't hold your
breath on when they'll fix it.
To date, Apple has not fixed *any* of the (fairly well) known sandbox
issues, including this one. Verify that it is a sandbox issue and not
a registration issue. If it is the latter, you're kind stuck until
Apple actually fixes some of these issues.

5 1/2 months without any fixes on any of sandbox-related issues, but
they did give us another 4 months for us to stress about it. Nice
holiday gift from Apple to Mac developers. If we're lucky, we may get
the fixes before the Mar 1 deadline comes.


Mark

-- 
Mark Munz
unmarked software
http://www.unmarked.com/
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Updating an app's help

2011-12-15 Thread Mark Munz
I've not seen Mac OS X fail to run an app I've double-clicked on, but
it is notorious for grabbing seemly random old versions of plugins
like Automator actions, quicklook plugins, Services from older apps
that are still around -- sometimes giving precedence to apps on
non-boot volumes (over one on the boot volume).

It is especially an annoying mess for developers, who are more likely
to have multiple versions lurking about.


On Thu, Dec 15, 2011 at 7:28 PM, Matt Neuburg  wrote:
> On Wed, 14 Dec 2011 05:14:36 -0500, Bill Cheeseman  
> said:
>>Search the archives, and you will discover that you are likely experiencing a 
>>well-known issue that has been around for a very long time. It typically only 
>>affects the developer, not your users. It is especially annoying to the 
>>developer if another, older version of the application is still on your 
>>computer, in the Applications folder or perhaps in the form of earlier build 
>>products that are still sitting around, because then trashing the help caches 
>>and forcing an update won't necessarily stop the system from using the old 
>>version of your Help folder in an older version of your application.
>
> And not just with help, either. I've been in situations where a developer was 
> sending me new versions of an application several times a day, and it would 
> sometimes happen that I would double-click a new version and an older 
> version's code would run. (This resulted in some really strange conversations 
> about the behavior of the application.) There's some underlying caching 
> mechanism here. As you rightly say, the solution is to trash the old version 
> *and empty the trash* before launching the new version. m.
>
> PS I've also quite often seen it happen that I'll update my code for an iOS 
> app I'm developing and run it and an older version of the app will run, but 
> this is for a different reason, I think.
>
> --
> matt neuburg, phd = m...@tidbits.com, <http://www.apeth.net/matt/>
> A fool + a tool + an autorelease pool = cool!
> Programming iOS 4!
> http://www.apeth.net/matt/default.html#iosbook___
>
> 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 cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/unmarked%40gmail.com
>
> This email sent to unmar...@gmail.com



-- 
Mark Munz
unmarked software
http://www.unmarked.com/
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Determine sandbox/entitlements at runtime?

2011-12-15 Thread Mark Munz
Well, I'm not holding my breath. It is pretty clear that Apple's
desire is to dumb down apps that are permitted in the App Store to the
level of iOS apps.

Of course, I'm sure they'll give their own apps, like Lion installer
and Xcode installer, exceptions to these same sandbox restrictions
they're forcing on developers.


On Thu, Dec 15, 2011 at 3:35 PM, Eric Wing  wrote:
> On 12/15/11, Tim Schröder  wrote:
>> Questioning [[[NSProcessInfo] processInfo] environment] should work to check
>> whether sandboxing is enabled or not, but not for checking entitlements. As
>> use of the Scripting Bridge will be covered by a temporary entitlement at
>> best, better don't rely on scripting at all.
>>
>> Tim
>>
>>
>> http://www.timschroeder.net
>
> Thanks for the reply. After trying it, I see
> "APP_SANDBOX_CONTAINER_ID" is defined when sandboxing is enabled, and
> it doesn't exist when sandboxing is not enabled.
>
> As for the temporary entitlement, I'm still holding out (delusional)
> hope that will revise/fix things for sandboxing before the cutoff date
> to allow for ScriptingBridge. (Yes, I did file a bug report.)
>
> Thanks,
> Eric
> --
> Beginning iPhone Games Development
> http://playcontrol.net/iphonegamebook/
> ___
>
> 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 cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/unmarked%40gmail.com
>
> This email sent to unmar...@gmail.com



-- 
Mark Munz
unmarked software
http://www.unmarked.com/
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


What makes OS X generate a hang report?

2012-01-11 Thread Mark Woods
Does anyone know the criteria OS X uses to determine an application has hung? 
The reason I ask is that I've seen lots of inconsistencies. For example, OS X 
will kill a process and show the log if it hangs for 5 seconds, other times 
less than 1 second (is this even counted as a hang?) and sometimes the app 
hangs forever and I have to force-quit it myself.

Lion seems to be much more sensitive than previous versions and it will 
occasionally kill my app when doing simple things like loading a QuickTime 
movie into a QTMovieView, which has to be done on the main thread. (The hang 
report reports a hang of less than 1 second.)

Has anyone else seen this? Is this a bug I should report to Apple or am I doing 
something wrong?

Any light anyone can shed on this would be 
appreciated.___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: What makes OS X generate a hang report?

2012-01-11 Thread Mark Woods
Thanks Jean.

According to this article all QTMovie objects must be created on the main 
thread:
http://developer.apple.com/library/mac/#technotes/tn2138/_index.html

Mark.

On Jan 11, 2012, at 1:48 PM, Jean Suisse wrote:

> Hi !
> 
> Well, I am no expert, so I can't answer your question. 
> But I do have a suggestion (fix): have you tried loading your QuickTime movie 
> on an other thread, and then attaching it to your main thread ? (you have to 
> detach it first).
> 
> Jean
> 
> On 11 janv. 2012, at 21:56, Mark Woods wrote:
> 
>> Does anyone know the criteria OS X uses to determine an application has 
>> hung? The reason I ask is that I've seen lots of inconsistencies. For 
>> example, OS X will kill a process and show the log if it hangs for 5 
>> seconds, other times less than 1 second (is this even counted as a hang?) 
>> and sometimes the app hangs forever and I have to force-quit it myself.
>> 
>> Lion seems to be much more sensitive than previous versions and it will 
>> occasionally kill my app when doing simple things like loading a QuickTime 
>> movie into a QTMovieView, which has to be done on the main thread. (The hang 
>> report reports a hang of less than 1 second.)
>> 
>> Has anyone else seen this? Is this a bug I should report to Apple or am I 
>> doing something wrong?
>> 
>> Any light anyone can shed on this would be 
>> appreciated.___
>> 
>> 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 cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/jean.lists%40gmail.com
>> 
>> This email sent to jean.li...@gmail.com
> 
> 
> 

___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: My services in my own app

2012-01-15 Thread Mark Munz
You didn't indicate what version of Mac OS X you were running under.

If this is happening under Snow Leopard, then this is a known issue in
Snow Leopard that Apple fixed in Lion.

The only work around I know is to put the service code in a separate
(background) application that then calls back into your app to do
whatever task you need it to do.

Mark

On Sun, Jan 15, 2012 at 9:09 AM, Georg Seifert  wrote:
> Hi,
>
> My app registers some services and they work just fine. Only if I invoke then 
> from within the same application, the app hangs. I tried with other apps and 
> they had the same problem.
>
> I searched the web for it but could not find anything.
>
> Is there anything I can do about it?
>
> Thanks
> Georg___
>
> 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 cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/unmarked%40gmail.com
>
> This email sent to unmar...@gmail.com



-- 
Mark Munz
unmarked software
http://www.unmarked.com/
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: My services in my own app

2012-01-16 Thread Mark Munz
.service bundles are supposed to be in ~/Library/Services/ folder
(which you can't use if you are writing for the Mac App Store). Not
sure if they are recognized within your own bundle. The .service
bundle is designed for dynamic bundles, but clearly hasn't been
updated to support the MAS restrictions on apps.

For Mac App Store apps, there is no good way to currently specify
dynamic services.

Also, there is yet another Services-related bug, specifically in using
.service bundles for dynamic services. Specifically, the icon will
display a circle with a slash overlay because Finder doesn't see an
executable. This same icon will then show up next to your menu item in
the Services menu. Sadly, this has *not* been fixed in Lion either.

If you're getting a sense that Services is less than half-baked, join
the club and file bugs related to these issues with Apple so that
hopefully someone will fix them, maybe by the time Mac OS XIII comes
out (it took ~10 years for Apple to take a look at issues in Services
dating back to 10.0).

Mark

On Mon, Jan 16, 2012 at 1:10 PM, Georg Seifert  wrote:
> Yes, I’m on Snow Leopard.
>
> I just had a another look at the specs. there is something about a .service 
> bundle. Can I put one of this in my .app bundle? And how do I register it?
>
> Thanks
> Georg
>
>> You didn't indicate what version of Mac OS X you were running under.
>>
>> If this is happening under Snow Leopard, then this is a known issue in
>> Snow Leopard that Apple fixed in Lion.
>>
>> The only work around I know is to put the service code in a separate
>> (background) application that then calls back into your app to do
>> whatever task you need it to do.
>>
>> Mark
>>
>>> Hi,
>>>
>>> My app registers some services and they work just fine. Only if I invoke 
>>> then from within the same application, the app hangs. I tried with other 
>>> apps and they had the same problem.
>>>
>>> I searched the web for it but could not find anything.
>>>
>>> Is there anything I can do about it?
>>>
>>> Thanks
>>> Georg
>
> ___
>
> 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 cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/unmarked%40gmail.com
>
> This email sent to unmar...@gmail.com



-- 
Mark Munz
unmarked software
http://www.unmarked.com/
___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Full-Height Toolbar Item

2012-01-26 Thread Mark Alldritt
Hi Everyone,

I'm looking for a way to make a view-based Toolbar Item that occupies the full 
height of the toolbar (i.e. including the space normally reserved for the 
toolbar item's label).  Xcode 4 does this for its "status" display, and I have 
a similar need in my application.  The NSToolbar and NSToolbarItem definitions 
don't appear to make this possible, but perhaps there is something I've 
overlooked.

Thanks
-Mark


___

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 cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


  1   2   3   4   >