Re: Error when closing window with IKImageBrowserView in it

2010-07-01 Thread Gideon King
I have tested using the orderOut: way of working around this issue, and it 
works for me. I will still file a bug report on the issue.

Gideon

On 02/07/2010, at 3:48 PM, Nick Zitzmann wrote:

> 
> On Jul 1, 2010, at 9:41 PM, Dave Fernandes wrote:
> 
>> Hmmm. I still can't get it to happen reproducibly, but the workaround, if I 
>> understand correctly would leek resources in a document-based app, would it 
>> not?
> 
> Perhaps. Then you could try removing the image browser from its superview 
> instead.
> 
> Nick Zitzmann
> 

___

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: horizontal radio group

2010-07-01 Thread Ken Thomases
On Jul 2, 2010, at 1:05 AM, Angelo Chen wrote:

> radio group created in Interface builder is vertical, how  to set it 
> horizontal? example, two radio buttons in one line? Thanks,

A group of radio buttons is really an NSMatrix.  The way to change the number 
of rows and columns in a matrix is to Option-resize it.  You can also directly 
edit the rows and columns by selecting the matrix and opening the attributes 
inspector.

Cheers,
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


Re: horizontal radio group

2010-07-01 Thread Kyle Sluder
On Thu, Jul 1, 2010 at 11:05 PM, Angelo Chen  wrote:
> Hi,
> radio group created in Interface builder is vertical, how  to set it 
> horizontal? example, two radio buttons in one line? Thanks,
> a.c.

Please read the documentation before posting to the list.

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


horizontal radio group

2010-07-01 Thread Angelo Chen
Hi,
radio group created in Interface builder is vertical, how  to set it 
horizontal? example, two radio buttons in one line? Thanks,
a.c.



___

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: Error when closing window with IKImageBrowserView in it

2010-07-01 Thread Nick Zitzmann

On Jul 1, 2010, at 9:41 PM, Dave Fernandes wrote:

> Hmmm. I still can't get it to happen reproducibly, but the workaround, if I 
> understand correctly would leek resources in a document-based app, would it 
> not?

Perhaps. Then you could try removing the image browser from its superview 
instead.

Nick Zitzmann




___

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 ambiguities

2010-07-01 Thread Jens Alfke

On Jul 1, 2010, at 4:02 AM, Ariel Feinerman wrote:

> I wish to get the strings from file, exclude some strings and empty strings
> and write them to file, so do you sure these methods are for that?

Yup, they should work for that. They will help you iterate over the lines in 
the contents, regardless of what line endings are used.

> Can you explain what you suggest by given an example?

Why not read the documentation for those methods (-paragraphRangeForRange:, 
getParagraphStart:end:contentsEnd:forRange:) first, and try to write some code 
using them, before asking for more help?

—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


Re: Error when closing window with IKImageBrowserView in it

2010-07-01 Thread Dave Fernandes
Hmmm. I still can't get it to happen reproducibly, but the workaround, if I 
understand correctly would leek resources in a document-based app, would it 
not? When this does happen, it is when I close a document.

On 2010-07-01, at 12:41 PM, Nick Zitzmann wrote:

> 
> On Jul 1, 2010, at 10:36 AM, Dave Fernandes wrote:
> 
>> I've seen the same error message logged, but I've never narrowed the cause 
>> down enough to file a bug report. What's the workaround?
> 
> If you order the window out instead of closing it, then IKImageBrowserView 
> will quit squawking. The window will still be resident, but it won't be on 
> screen.
> 
> Nick Zitzmann
> 
> 

___

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 NSImage to render the view

2010-07-01 Thread Tony Romano

Thanks for the tip.

I figured it was too good to be true that the image would scale.  
Thinking about it, the class hierarchy only shows NSObject, I should 
have looked there to know for sure.  I'm not tied to this method, it 
just works nicely.  I'll covert the coordinates to the view's bounding 
rectangle and not rely on scaling. Thanks for the detailed reply Graham.


-Tony

On 7/1/10 6:55 PM, Graham Cox wrote:

On 02/07/2010, at 11:29 AM, Tony Romano wrote:

   

I have a view who's bounding rectangle has been normalize to make drawing a 
grid easier.  It' bounds is set to ~1x1. Currently I can draw the grid and what 
ever curve I want just fine.  What I am trying to do is draw into a NSImage and 
render it in the view and cache the image so I can also save the image to disk 
later.  In my test example I am drawing a curve and to see if the curve renders 
prior to unlockFocus(i.e post the last stroke method) I make a call to:

NSRect br = [bp controlPointBounds];
NSLog(@"Path Bounding Box: origin.x:%1.5f origin.y:%1.5f size.width:%1.5f 
size.height:%1.5f", br.origin.x, br.origin.y, br.size.width, br.size.height);
 

Tip: check out NSStringFromRect()

   

The Output I get is: Path Bounding Box: origin.x:0.0 origin.y:0.0 
size.width:1.0 size.height:1.0. Looks like the path is drawn just fine.

The documents look pretty straight forward but it looks like I am only getting 
a 1x1 view of my data(i.e. the pixel(s) at 0,0) and losing the scaling factor 
of the frame.
 



   

I am assuming the same trick to normalize a view to 1x1 should also work??  
Again, if I just draw to the view and not to the image, it all draws perfectly.
 


You are assuming wrong. You create an image with size 1,1 and draw into it data 
with bounds 1,1. You therefore have a 1x1 pixel image with all the complexity 
and nuance that implies.

The reason the "trick" works with a view is that the view incorporates a 
transform that scales between the bounds and the frame rect, so the data you draw to the 
1,1 bounds is scaled up to fill the n,m frame. The scaled path is stroked on the fly to 
fill the resulting part of the screen. NSImage has no similar automatic transformations.

To my mind your approach is flawed, I'm not sure why you think having a 1,1 
view is needed or why that's any advantage over doing things conventionally, 
but if you want to persist with it, you need to make the image the size of your 
frame and set up a suitable transform yourself when you lock focus on the image 
to scale the data up the same way the view is.

--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: Using NSImage to render the view

2010-07-01 Thread Graham Cox

On 02/07/2010, at 11:29 AM, Tony Romano wrote:

> I have a view who's bounding rectangle has been normalize to make drawing a 
> grid easier.  It' bounds is set to ~1x1. Currently I can draw the grid and 
> what ever curve I want just fine.  What I am trying to do is draw into a 
> NSImage and render it in the view and cache the image so I can also save the 
> image to disk later.  In my test example I am drawing a curve and to see if 
> the curve renders prior to unlockFocus(i.e post the last stroke method) I 
> make a call to:
> 
>NSRect br = [bp controlPointBounds];
>NSLog(@"Path Bounding Box: origin.x:%1.5f origin.y:%1.5f size.width:%1.5f 
> size.height:%1.5f", br.origin.x, br.origin.y, br.size.width, br.size.height);

Tip: check out NSStringFromRect()

> 
> The Output I get is: Path Bounding Box: origin.x:0.0 origin.y:0.0 
> size.width:1.0 size.height:1.0. Looks like the path is drawn just 
> fine.
> 
> The documents look pretty straight forward but it looks like I am only 
> getting a 1x1 view of my data(i.e. the pixel(s) at 0,0) and losing the 
> scaling factor of the frame.



> I am assuming the same trick to normalize a view to 1x1 should also work??  
> Again, if I just draw to the view and not to the image, it all draws 
> perfectly.


You are assuming wrong. You create an image with size 1,1 and draw into it data 
with bounds 1,1. You therefore have a 1x1 pixel image with all the complexity 
and nuance that implies.

The reason the "trick" works with a view is that the view incorporates a 
transform that scales between the bounds and the frame rect, so the data you 
draw to the 1,1 bounds is scaled up to fill the n,m frame. The scaled path is 
stroked on the fly to fill the resulting part of the screen. NSImage has no 
similar automatic transformations.

To my mind your approach is flawed, I'm not sure why you think having a 1,1 
view is needed or why that's any advantage over doing things conventionally, 
but if you want to persist with it, you need to make the image the size of your 
frame and set up a suitable transform yourself when you lock focus on the image 
to scale the data up the same way the view is.

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


Using NSImage to render the view

2010-07-01 Thread Tony Romano
I have a view who's bounding rectangle has been normalize to make 
drawing a grid easier.  It' bounds is set to ~1x1.  Currently I can draw 
the grid and what ever curve I want just fine.  What I am trying to do 
is draw into a NSImage and render it in the view and cache the image so 
I can also save the image to disk later.  In my test example I am 
drawing a curve and to see if the curve renders prior to unlockFocus(i.e 
post the last stroke method) I make a call to:


NSRect br = [bp controlPointBounds];
NSLog(@"Path Bounding Box: origin.x:%1.5f origin.y:%1.5f 
size.width:%1.5f size.height:%1.5f", br.origin.x, br.origin.y, 
br.size.width, br.size.height);


The Output I get is: Path Bounding Box: origin.x:0.0 
origin.y:0.0 size.width:1.0 size.height:1.0.  Looks like the 
path is drawn just fine.


The documents look pretty straight forward but it looks like I am only 
getting a 1x1 view of my data(i.e. the  pixel(s) at 0,0) and losing the 
scaling factor of the frame.  I am assuming the same trick to normalize 
a view to 1x1 should also work??  Again, if I just draw to the view and 
not to the image, it all draws perfectly.


This is what I am doing.

- (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
if (self) {
viewBounds = NSMakeRect(-0.1, -0.1, 1.2, 1.2);
[self setBounds:viewBounds];
}
return self;
}

-(void) setFrameSize:(NSSize)newSize
{
[super setFrameSize:newSize];
[self setBounds:viewBounds];
}

- (void)drawRect:(NSRect)dirtyRect
{

// Set the image size to the bounding rect
NSImage* anImage = [[NSImage alloc] initWithSize:viewBounds];
[anImage lockFocus];

// Draw a bunch of stuff



// Unlock and draw the image
[anImage unlockFocus];
[anImage drawAtPoint:NSMakePoint(0, 0)
fromRect: NSZeroRect
   operation: NSCompositeSourceOver
fraction: 1.0];

 [anImage release];  // for now.
}

Thanks people,
-Tony
___

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: [KINDA SOLVED] Core Data : Save As : Object temporarily missing...

2010-07-01 Thread Jerry Krinock
On 2010 Jul 01, at 15:38, I wrote:

> I'm debugging a problem with Save As in a Core Data document...

Yeah, I know, that original post was a long shot.

I fixed the problem but still don't understand it.

The "Save As" operation I was debugging is actually a home-made one which also 
deletes the original.  I had implemented this by sending -[NSPersistentDocument 
writeSafelyToURL:ofType:forSaveOperation:error:], and manually moving the files 
and setFileURL: in code.  Upon waking from a nap, I replaced this message with 
-[NSManagedObjectContext save:], and the problem went away.

Actually, there was another problem I didn't mention in my first post, and that 
problem went away too.  The second problem was that, during the save, Core Data 
would register a single Undo invocation which had a nil target, with selector 
_noop: and argument of type __NSArray0*, which had a -count = 0.  (Thanks to 
Graham Cox' GCUndoManager for that peek!)  Obviously this action was a no-op, 
but it dirtied my red button, etc.

In NSPersistentDocument documentation, the only one of the save/write methods 
overridden from NSDocument is supposedly 
writeToURL:ofType:forSaveOperation:originalContentsURL:error:, which is the 
next lower-level method invoked by 
writeSafelyToURL:ofType:forSaveOperation:error:.  So I don't see what the 
problem was.  Anyhow, since I'm taking care of the high-level file management 
stuff as explained above, I'm satisfied that -[NSManagedObjectContext save:] 
should be sufficient, and it seems to work.

"Message Flow In the Document Architecture" [1] is possibly the single most 
useful "Programming Guide" page on developer.apple.com, but it doesn't cover 
the little variations for Core Data.  I just submitted Document Feedback 
suggesting that they do so.

Jerry


[1] 
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Documents/Articles/ObjectInteractions.html

___

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: set defaults in another application?

2010-07-01 Thread koko

forget the set part:

[dflts setPersistentDomain:[NSDictionary dictionaryWithObjects:objects  
forKeys:keys] forName:@"com.company.applicationA"];



On Jul 1, 2010, at 6:49 PM, Angelo Chen wrote:


Hi,
In application A, I use following code to set some settings:
NSUserDefaults *defaults = [NSUserDefaults  
standardUserDefaults];NSData *defaultSettings = [defaults  
objectForKey : EXPORT_SETTINGS];
ExportSettings *es = [[ExportSettings alloc] init];NSData *settings  
= [es getExportSettings: defaultSettings];[es release];if (settings)	 
[defaults setObject:settings forKey:EXPORT_SETTINGS];		Now I'd like  
to access and set the settings in application B to the defaults in  
A, possible? thanks,

Angelo  



___

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/koko%40highrolls.net

This email sent to k...@highrolls.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: set defaults in another application?

2010-07-01 Thread Kyle Sluder
On Thu, Jul 1, 2010 at 5:49 PM, Angelo Chen  wrote:
> Hi,
> In application A, I use following code to set some settings:
> NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];NSData 
> *defaultSettings = [defaults objectForKey : EXPORT_SETTINGS];
> ExportSettings *es = [[ExportSettings alloc] init];NSData *settings = [es 
> getExportSettings: defaultSettings];[es release];if (settings)        
> [defaults setObject:settings forKey:EXPORT_SETTINGS];           Now I'd like 
> to access and set the settings in application B to the defaults in A, 
> possible? thanks,

http://www.google.com/search?q=nsuserdefaults+other+application

--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: set defaults in another application?

2010-07-01 Thread koko


NSUserDefaults* dflts = [NSUserDefaults standardUserDefaults];
	NSDictionary* dict = [dflts  
persistentDomainForName:@"com.company.applicationA"];






On Jul 1, 2010, at 6:49 PM, Angelo Chen wrote:


Hi,
In application A, I use following code to set some settings:
NSUserDefaults *defaults = [NSUserDefaults  
standardUserDefaults];NSData *defaultSettings = [defaults  
objectForKey : EXPORT_SETTINGS];
ExportSettings *es = [[ExportSettings alloc] init];NSData *settings  
= [es getExportSettings: defaultSettings];[es release];if (settings)	 
[defaults setObject:settings forKey:EXPORT_SETTINGS];		Now I'd like  
to access and set the settings in application B to the defaults in  
A, possible? thanks,

Angelo  



___

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/koko%40highrolls.net

This email sent to k...@highrolls.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


set defaults in another application?

2010-07-01 Thread Angelo Chen
Hi,
In application A, I use following code to set some settings:
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];NSData 
*defaultSettings = [defaults objectForKey : EXPORT_SETTINGS];
ExportSettings *es = [[ExportSettings alloc] init];NSData *settings = [es 
getExportSettings: defaultSettings];[es release];if (settings)[defaults 
setObject:settings forKey:EXPORT_SETTINGS];   Now I'd like to access 
and set the settings in application B to the defaults in A, possible? thanks,
Angelo  



___

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: Capturing output from another task with elevated privilages

2010-07-01 Thread Eric Hoaglin
That output is from standard out as the output is "Syntax OK" which I know is 
standard out...

On Jul 1, 2010, at 9:10 AM, Kevin Wojniak wrote:

> I may be wrong, but I believe AEWP only captures stdout, not stderr, so you 
> could check for that.

Regards,

Eric Hoaglin
GryphonClaw Software
http://www.gryphonclaw.net
REALbasic Paste Site: http://code.gryphonclaw.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: Subclass UIScrollView or compose?

2010-07-01 Thread Luke the Hiesterman
It just sounds like trying to subclass UIScrollView is overkill for the problem 
you're trying to solve. What you want is a custom view inside a UIScrollView 
and be able to provide the whole view hierarchy as an object for consumption. 
You don't require special scrollview behavior. If you don't want to use 
UIViewController, there's no reason you can't write a generic 
controller/container object that creates a UIScrollView along with your custom 
view and packages them up. Then, when someone asks your controller/container 
object for the view, you provide the UIScrollView with hierarchy all neatly 
made. 

Maybe that doesn't even need to be an objectit could be a C function or a 
class method that returns the built hierarchy that you want. Yet another option 
is putting the UIScrollView and its custom subview into a nib, and having the 
owner be NSObject so that anyone can unarchive a copy and put it to use even 
without using UIViewController.

Just a few possible paths that spare you from the fact that subclassing 
UIScrollView is easy to get wrong.

Luke

On Jul 1, 2010, at 3:47 PM, Rick Mann wrote:

> I don't use a UIViewController. That is in this case, the view controllers 
> will be provided by others who just want to use my view. Currently my view 
> has properties that must be set for displaying data, but I may switch that to 
> use a data source model like UITableView.
> 
> I know it's no problem to drop a view into a UIScrollView. I want to avoid 
> that, and I'm simply looking for the best way for my UIScrollView subclass to 
> actually get updates as its scrolled.
> 
> If it's really not good to subclass UIScrollView, why does UITableView do so?
> 
> TIA,
> Rick
> 
> On Jul 1, 2010, at 15:36:21, Luke the Hiesterman wrote:
> 
>> If you use a UIViewController, then dropping your custom view into 
>> UIScrollView in IB should be completely straightforward for all your uses.
>> 
>> Luke
>> 
>> On Jul 1, 2010, at 3:29 PM, Rick Mann wrote:
>> 
>>> I'm developing a custom scrolling view, and I could either subclass 
>>> UIScrollView, or subclass UIView and drop it into a UIScrollView in IB. I 
>>> prefer the former approach, because it's more straightforward when using 
>>> the view (which we use in many places).
>>> 
>>> However, the only way to update the view is to either become the scroll 
>>> view's delegate, or override the contentSize property setter, and call 
>>> setNeedsDisplay. Neither of these solutions seems very elegant or obvious.
>>> 
>>> And just for reference, UITableView subclasses UIScrollView, and doesn't 
>>> make itself the delegate (at least, it doesn't declare the protocol in the 
>>> header).
>>> 
>>> Is there a smarter way to do this?
>>> 
>>> TIA,
>>> Rick
>>> 
>>> ___
>>> 
>>> 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: Subclass UIScrollView or compose?

2010-07-01 Thread Rick Mann
I don't use a UIViewController. That is in this case, the view controllers will 
be provided by others who just want to use my view. Currently my view has 
properties that must be set for displaying data, but I may switch that to use a 
data source model like UITableView.

I know it's no problem to drop a view into a UIScrollView. I want to avoid 
that, and I'm simply looking for the best way for my UIScrollView subclass to 
actually get updates as its scrolled.

If it's really not good to subclass UIScrollView, why does UITableView do so?

TIA,
Rick

On Jul 1, 2010, at 15:36:21, Luke the Hiesterman wrote:

> If you use a UIViewController, then dropping your custom view into 
> UIScrollView in IB should be completely straightforward for all your uses.
> 
> Luke
> 
> On Jul 1, 2010, at 3:29 PM, Rick Mann wrote:
> 
>> I'm developing a custom scrolling view, and I could either subclass 
>> UIScrollView, or subclass UIView and drop it into a UIScrollView in IB. I 
>> prefer the former approach, because it's more straightforward when using the 
>> view (which we use in many places).
>> 
>> However, the only way to update the view is to either become the scroll 
>> view's delegate, or override the contentSize property setter, and call 
>> setNeedsDisplay. Neither of these solutions seems very elegant or obvious.
>> 
>> And just for reference, UITableView subclasses UIScrollView, and doesn't 
>> make itself the delegate (at least, it doesn't declare the protocol in the 
>> header).
>> 
>> Is there a smarter way to do this?
>> 
>> TIA,
>> Rick
>> 
>> ___
>> 
>> 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


Core Data : Save As : Object temporarily missing in fetch results

2010-07-01 Thread Jerry Krinock
I'm debugging a problem with Save As in a Core Data document, and I'm not sure 
if the following is part of the main show, or a sideshow.

A document contains only one object in a given entity.  I've written a little 
debugger method which simply fetches all objects of a given entity and logs the 
result. [1]  

Before my Save As operation, running this method logs an array of one object, 
as expected.  But after the Save As, it logs an empty array (empty fetch).  But 
wait, if I then change an attribute of the "missing" object, using the app's 
GUI, and re-run this logging method, the object reappears in the new fetch 
result.  And it has the same pointer address and permanent objectID as before.  
And its -isFault and -isDeleted are both NO, both before and after its 
dis/reappearance.

Is there any Core Data behavior that might explain this?

Jerry

[1] This is in a window controller subclass.

- (void)debugLogObjectsEntityName:(NSString*)entityName {
NSManagedObjectContext* moc = [[self document] managedObjectContext] ;
[moc processPendingChanges] ;  // Has no effect.

NSFetchRequest* fetchRequest = [[NSFetchRequest alloc] init] ;
NSArray* fetches = nil ;
if (moc) {
[fetchRequest setEntity:[NSEntityDescription entityForName:entityName  
inManagedObjectContext:moc]] ;
fetches = [moc executeFetchRequest:fetchRequest
 error:NULL] ;
}
[fetchRequest release] ;

NSLog(@"This doc contains %d objects of entity %@:\n%@",
  [fetches count],
  entityName,
  [fetches shortDescription]) ;
// -shortDescription is a method I've written to give pertinent info
// about managed objects and collections of managed objects, without
// filling the console/screen like -[NSManagedObject description] does.
}___

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: Subclass UIScrollView or compose?

2010-07-01 Thread Luke the Hiesterman
If you use a UIViewController, then dropping your custom view into UIScrollView 
in IB should be completely straightforward for all your uses.

Luke

On Jul 1, 2010, at 3:29 PM, Rick Mann wrote:

> I'm developing a custom scrolling view, and I could either subclass 
> UIScrollView, or subclass UIView and drop it into a UIScrollView in IB. I 
> prefer the former approach, because it's more straightforward when using the 
> view (which we use in many places).
> 
> However, the only way to update the view is to either become the scroll 
> view's delegate, or override the contentSize property setter, and call 
> setNeedsDisplay. Neither of these solutions seems very elegant or obvious.
> 
> And just for reference, UITableView subclasses UIScrollView, and doesn't make 
> itself the delegate (at least, it doesn't declare the protocol in the header).
> 
> Is there a smarter way to do this?
> 
> TIA,
> Rick
> 
> ___
> 
> 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


Subclass UIScrollView or compose?

2010-07-01 Thread Rick Mann
I'm developing a custom scrolling view, and I could either subclass 
UIScrollView, or subclass UIView and drop it into a UIScrollView in IB. I 
prefer the former approach, because it's more straightforward when using the 
view (which we use in many places).

However, the only way to update the view is to either become the scroll view's 
delegate, or override the contentSize property setter, and call 
setNeedsDisplay. Neither of these solutions seems very elegant or obvious.

And just for reference, UITableView subclasses UIScrollView, and doesn't make 
itself the delegate (at least, it doesn't declare the protocol in the header).

Is there a smarter way to do this?

TIA,
Rick

___

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


Does a Core Animation Runtime Player/Editor exist?

2010-07-01 Thread colo
I am looking for a realtime editing window tool like a script console
that will display Obj-C Core Animation instructions.
Just like Processing and it's many variants Node Box Ruby etc.
Or like Quartz Composer but pure code not nodes.

Can Quartz Composer take Obj-C Code in realtime? Or is there a bridge
that builds just that portion in realtime?
___

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: Finder-like conversion of a fileURL to 'user-friendly' path

2010-07-01 Thread Rainer Standke
What I was looking for was this:

-[NSFileManager componentsToDisplayForPath:]

Thanks, Ken.

Rainer


On Jul 1, 2010, at 10:29 , Rainer Standke wrote:

> At the bottom of each finder window there is a 'path' display that indicates 
> the path to the directory represented by the window. I'd like to be able to 
> convert a path like this one: 
> 'file://localhost/Users/rainer/Desktop/S&S%20material/hidden/' to some like: 
> 'MacHD/Users/rainer/Desktop/S&S material/hidden'.
> 
> I have pieced some things together myself, but the whole thing is a mess. Is 
> there a way to access the same mechanism the Finder is obviously using?
> 
> Thanks,
> 
> Rainer___
> 
> 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/lists%40standke.com
> 
> This email sent to li...@standke.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: Finder-like conversion of a fileURL to 'user-friendly' path

2010-07-01 Thread Matt Neuburg
On Thu, 1 Jul 2010 10:29:17 -0700, Rainer Standke  said:
>At the bottom of each finder window there is a 'path' display that indicates
the path to the directory represented by the window. I'd like to be able to
convert a path like this one:
'file://localhost/Users/rainer/Desktop/S&S%20material/hidden/' to some like:
'MacHD/Users/rainer/Desktop/S&S material/hidden'.

The first one is not a path; it's a file URL. The second one is a path.
NSURL converts between them. m.


-- 
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings



___

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: KVO question

2010-07-01 Thread Keary Suska
On Jul 1, 2010, at 11:30 AM, Rainer Standke wrote:

> I have a core data app where I don't necessarily know when managed objects go 
> away, as in: become faults, will be deleted etc.. I also need to add the 
> observer to the managed object in awakeFromFetch, but that gets not only 
> called upon opening an existing object, but also later on when fetches are 
> executed.
> 
> I take it the answer to my question is no? As in: No, an object can not ask 
> another if it's being observe by it?

Specifically, no, because an object is completely ignorant of what it is 
observing, except when specifically implemented otherwise. The observed object 
*does* know what objects have registered with it, but the data structure is 
opaque and undocumented, and subject to change (AFAIK).

> For now I have solved the problem by setting a flag on the managed object 
> when it registers itself for observation. 
> 
> Rainer
> 
> 
> On Jul 1, 2010, at 9:15 , Kyle Sluder wrote:
> 
>> On Jul 1, 2010, at 8:26 AM, Rainer Standke  wrote:
>> 
>>> Hello all,
>>> 
>>> is it possible to determine if one object is observing another? 
>>> Specifically, I'd like one object to ask another "are you observing me?". 
>>> That way I could determine if I need to remove that observer before I let 
>>> go of the observed object...
>> 
>> This is a very good indication that you have an inverted or cyclical 
>> dependency. Your observee shouldn't need to know about your observers.
>> 
>> What is your specific setup?
>> 
>> --Kyle Sluder


Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

___

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: KVO question

2010-07-01 Thread Matt Neuburg
On Thu, 1 Jul 2010 08:26:00 -0700, Rainer Standke  said:
>Hello all,
>
>is it possible to determine if one object is observing another?

observationInfo doesn't do this?

m.

-- 
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings



___

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: Finder-like conversion of a fileURL to 'user-friendly' path

2010-07-01 Thread Tony Romano
NSFileManager's  mountedVolumeURLsIncludingResourceValuesForKeys:options 
will give you the names of the  volumes.  Use this plus the path to 
build your own version of the a display string.  Remember to use the 
localized names.  However, as Mike suggested, if you are displaying this 
in the UI, use the NSPathControl.


-Tony


On 7/1/10 10:58 AM, Rainer Standke wrote:

That helps, to get rid of the 'file://localhost' part. What about the addition 
of the drive name?

Thanks,

Rainer

On Jul 1, 2010, at 10:33 , Kevin Wojniak wrote:

   

Use -[NSURL path] to get the unix-style path format.


On Jul 1, 2010, at 10:29 AM, Rainer Standke wrote:

 

At the bottom of each finder window there is a 'path' display that indicates the path 
to the directory represented by the window. I'd like to be able to convert a path like 
this one: 'file://localhost/Users/rainer/Desktop/S&S%20material/hidden/' to some 
like: 'MacHD/Users/rainer/Desktop/S&S material/hidden'.

I have pieced some things together myself, but the whole thing is a mess. Is 
there a way to access the same mechanism the Finder is obviously using?

Thanks,

Rainer___

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/kainjow%40kainjow.com

This email sent to kain...@kainjow.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/tonyrom%40hotmail.com

This email sent to tony...@hotmail.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: Finder-like conversion of a fileURL to 'user-friendly' path

2010-07-01 Thread Laurent Daudelin
Didn't you read the message from Ken Thomases about using [NSFileManager 
componentsToDisplayForPath:]? I think that's what you want to use.

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.com

On Jul 1, 2010, at 13:58, Rainer Standke wrote:

> That helps, to get rid of the 'file://localhost' part. What about the 
> addition of the drive name?
> 
> On Jul 1, 2010, at 10:33 , Kevin Wojniak wrote:
> 
>> Use -[NSURL path] to get the unix-style path format.
>> 
>> 
>> On Jul 1, 2010, at 10:29 AM, Rainer Standke wrote:
>> 
>>> At the bottom of each finder window there is a 'path' display that 
>>> indicates the path to the directory represented by the window. I'd like to 
>>> be able to convert a path like this one: 
>>> 'file://localhost/Users/rainer/Desktop/S&S%20material/hidden/' to some 
>>> like: 'MacHD/Users/rainer/Desktop/S&S material/hidden'.
>>> 
>>> I have pieced some things together myself, but the whole thing is a mess. 
>>> Is there a way to access the same mechanism the Finder is obviously using?

___

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: Finder-like conversion of a fileURL to 'user-friendly' path

2010-07-01 Thread Rainer Standke
That helps, to get rid of the 'file://localhost' part. What about the addition 
of the drive name?

Thanks,

Rainer

On Jul 1, 2010, at 10:33 , Kevin Wojniak wrote:

> Use -[NSURL path] to get the unix-style path format.
> 
> 
> On Jul 1, 2010, at 10:29 AM, Rainer Standke wrote:
> 
>> At the bottom of each finder window there is a 'path' display that indicates 
>> the path to the directory represented by the window. I'd like to be able to 
>> convert a path like this one: 
>> 'file://localhost/Users/rainer/Desktop/S&S%20material/hidden/' to some like: 
>> 'MacHD/Users/rainer/Desktop/S&S material/hidden'.
>> 
>> I have pieced some things together myself, but the whole thing is a mess. Is 
>> there a way to access the same mechanism the Finder is obviously using?
>> 
>> Thanks,
>> 
>> Rainer___
>> 
>> 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/kainjow%40kainjow.com
>> 
>> This email sent to kain...@kainjow.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: Finder-like conversion of a fileURL to 'user-friendly' path

2010-07-01 Thread Ken Thomases
On Jul 1, 2010, at 12:33 PM, Kevin Wojniak wrote:

> On Jul 1, 2010, at 10:29 AM, Rainer Standke wrote:
> 
>> At the bottom of each finder window there is a 'path' display that indicates 
>> the path to the directory represented by the window. I'd like to be able to 
>> convert a path like this one: 
>> 'file://localhost/Users/rainer/Desktop/S&S%20material/hidden/' to some like: 
>> 'MacHD/Users/rainer/Desktop/S&S material/hidden'.
>> 
>> I have pieced some things together myself, but the whole thing is a mess. Is 
>> there a way to access the same mechanism the Finder is obviously using?
> 

> Use -[NSURL path] to get the unix-style path format.

He doesn't want the unix-style path format.  He specifically asked about the 
display path.

In particular, -[NSFileManager componentsToDisplayForPath:].  Or, if he 
actually wants to present a path control like he's referring to the Finder 
having, NSPathControl.

Cheers,
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


Re: class_respondsToSelector() in runtime.h?

2010-07-01 Thread Kyle Sluder
On Thu, Jul 1, 2010 at 10:30 AM, Jonathon Kuo
 wrote:
> Interesting... so what happens at runtime if a class object invokes an 
> instance method that accesses instance variables? Exception? Assertion? Seg 
> fault?

"Invoke" is an inaccurate word. Let's use the proper term, "send a
message." The sender of the message is irrelevant; all that matters is
the receiver.

It sounds like you have gotten confused, and interpreted the above
thread to mean that a class object will respond to its instance
methods? This is not true. A class object will only respond to
instance methods defined on the root class.

--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: Finder-like conversion of a fileURL to 'user-friendly' path

2010-07-01 Thread Mike Abdullah
NSPathControl

Sent from my iPad

On 1 Jul 2010, at 18:29, Rainer Standke  wrote:

> At the bottom of each finder window there is a 'path' display that indicates 
> the path to the directory represented by the window. I'd like to be able to 
> convert a path like this one: 
> 'file://localhost/Users/rainer/Desktop/S&S%20material/hidden/' to some like: 
> 'MacHD/Users/rainer/Desktop/S&S material/hidden'.
> 
> I have pieced some things together myself, but the whole thing is a mess. Is 
> there a way to access the same mechanism the Finder is obviously using?
> 
> Thanks,
> 
> Rainer___
> 
> 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/cocoadev%40mikeabdullah.net
> 
> This email sent to cocoa...@mikeabdullah.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: class_respondsToSelector() in runtime.h?

2010-07-01 Thread Michael Ash
On Thu, Jul 1, 2010 at 1:30 PM, Jonathon Kuo
 wrote:
>
> On Jul 1, 2010, at 9:49 AM, Kyle Sluder wrote:
>
>> On Jul 1, 2010, at 9:42 AM, Jonathon Kuo  
>> wrote:
>>
>>> On Jul 1, 2010, at 7:56 AM, Matt Neuburg wrote:
>>>
 "Instance methods defined in a root class can be performed both by 
 instances
 and by class objects. Therefore, all class objects have access to the
 instance methods defined in the root class."
>>>
>>> Not that it would generally be USEFUL to do so, since the purpose of an 
>>> instance is to hold instance variable values; a class object accessing 
>>> instance variables through an instance method would come up with 
>>> uninitialized ivar values, no?
>>
>> They are instances of the root class, so they have all the root class 
>> instances variables, of which there is precisely one: isa.
>
> Interesting... so what happens at runtime if a class object invokes an 
> instance method that accesses instance variables? Exception? Assertion? Seg 
> fault?

I think you may have missed the part where only instance methods
defined IN A ROOT CLASS can be performed by class objects. Therefore
the scenario that you describe cannot occur.

Mike
___

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: class_respondsToSelector() in runtime.h?

2010-07-01 Thread Jean-Daniel Dupas

Le 1 juil. 2010 à 19:30, Jonathon Kuo a écrit :

> 
> On Jul 1, 2010, at 9:49 AM, Kyle Sluder wrote:
> 
>> On Jul 1, 2010, at 9:42 AM, Jonathon Kuo  
>> wrote:
>> 
>>> On Jul 1, 2010, at 7:56 AM, Matt Neuburg wrote:
>>> 
 "Instance methods defined in a root class can be performed both by 
 instances
 and by class objects. Therefore, all class objects have access to the
 instance methods defined in the root class."
>>> 
>>> Not that it would generally be USEFUL to do so, since the purpose of an 
>>> instance is to hold instance variable values; a class object accessing 
>>> instance variables through an instance method would come up with 
>>> uninitialized ivar values, no?
>> 
>> They are instances of the root class, so they have all the root class 
>> instances variables, of which there is precisely one: isa.
> 
> Interesting... so what happens at runtime if a class object invokes an 
> instance method that accesses instance variables? Exception? Assertion? Seg 
> fault?

It just works. isa is a valid pointer on the expected type, even for classes.

-- Jean-Daniel




___

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: Finder-like conversion of a fileURL to 'user-friendly' path

2010-07-01 Thread Kevin Wojniak
Use -[NSURL path] to get the unix-style path format.


On Jul 1, 2010, at 10:29 AM, Rainer Standke wrote:

> At the bottom of each finder window there is a 'path' display that indicates 
> the path to the directory represented by the window. I'd like to be able to 
> convert a path like this one: 
> 'file://localhost/Users/rainer/Desktop/S&S%20material/hidden/' to some like: 
> 'MacHD/Users/rainer/Desktop/S&S material/hidden'.
> 
> I have pieced some things together myself, but the whole thing is a mess. Is 
> there a way to access the same mechanism the Finder is obviously using?
> 
> Thanks,
> 
> Rainer___
> 
> 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/kainjow%40kainjow.com
> 
> This email sent to kain...@kainjow.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: KVO question

2010-07-01 Thread Rainer Standke
I have a core data app where I don't necessarily know when managed objects go 
away, as in: become faults, will be deleted etc.. I also need to add the 
observer to the managed object in awakeFromFetch, but that gets not only called 
upon opening an existing object, but also later on when fetches are executed.

I take it the answer to my question is no? As in: No, an object can not ask 
another if it's being observe by it?

For now I have solved the problem by setting a flag on the managed object when 
it registers itself for observation. 

Rainer


On Jul 1, 2010, at 9:15 , Kyle Sluder wrote:

> On Jul 1, 2010, at 8:26 AM, Rainer Standke  wrote:
> 
>> Hello all,
>> 
>> is it possible to determine if one object is observing another? 
>> Specifically, I'd like one object to ask another "are you observing me?". 
>> That way I could determine if I need to remove that observer before I let go 
>> of the observed object...
> 
> This is a very good indication that you have an inverted or cyclical 
> dependency. Your observee shouldn't need to know about your observers.
> 
> What is your specific setup?
> 
> --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: class_respondsToSelector() in runtime.h?

2010-07-01 Thread Jonathon Kuo

On Jul 1, 2010, at 9:49 AM, Kyle Sluder wrote:

> On Jul 1, 2010, at 9:42 AM, Jonathon Kuo  
> wrote:
> 
>> On Jul 1, 2010, at 7:56 AM, Matt Neuburg wrote:
>> 
>>> "Instance methods defined in a root class can be performed both by instances
>>> and by class objects. Therefore, all class objects have access to the
>>> instance methods defined in the root class."
>> 
>> Not that it would generally be USEFUL to do so, since the purpose of an 
>> instance is to hold instance variable values; a class object accessing 
>> instance variables through an instance method would come up with 
>> uninitialized ivar values, no?
> 
> They are instances of the root class, so they have all the root class 
> instances variables, of which there is precisely one: isa.

Interesting... so what happens at runtime if a class object invokes an instance 
method that accesses instance variables? Exception? Assertion? Seg fault?

___

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


Finder-like conversion of a fileURL to 'user-friendly' path

2010-07-01 Thread Rainer Standke
At the bottom of each finder window there is a 'path' display that indicates 
the path to the directory represented by the window. I'd like to be able to 
convert a path like this one: 
'file://localhost/Users/rainer/Desktop/S&S%20material/hidden/' to some like: 
'MacHD/Users/rainer/Desktop/S&S material/hidden'.

I have pieced some things together myself, but the whole thing is a mess. Is 
there a way to access the same mechanism the Finder is obviously using?

Thanks,

Rainer___

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: redraw weirdness (setFrameSize in drawRect)

2010-07-01 Thread Kyle Sluder
On Thu, Jul 1, 2010 at 2:41 AM, Stefan Jung  wrote:
> Now I wanted to use a scroll view instead of scaling on the horizontal axis.
> I put
>
> [self setFrameSize:NSMakeSize(numberOfDataPoints+1, height)];
>
> into the drawRect: method. (May be a logical error)

Yes, this is an error. Resizing yourself in -drawRect: is a great way
to explode.

Assuming you are following correct MVC design principles, your view
has a method along the lines of -setData: that your controller object
uses to inform the view of new model data. It is in this method that
you should recalculate your size. This will mark your view dirty,
which will cause it to get a -drawRect: on the next window refresh
cycle, at which time you will draw your new data.

--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 to set custom icon folder to invisible?

2010-07-01 Thread Kyle Sluder
On Thu, Jul 1, 2010 at 1:18 AM, Valerio Schiavoni
 wrote:
> How can I change the code so that the Icon? file is invisible?

The file is named "Icon\r". It doesn't begin with a dot, therefore ls
will find it. That can't be changed.

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


redraw weirdness (setFrameSize in drawRect)

2010-07-01 Thread Stefan Jung
I have a little program that loads data, converts them and then displays these 
data in a custom view.
There are no errors or warnings. If the data are scaled into the view, 
everything works as expected.

Now I wanted to use a scroll view instead of scaling on the horizontal axis.
I put 

[self setFrameSize:NSMakeSize(numberOfDataPoints+1, height)];

into the drawRect: method. (May be a logical error)

This works in a way, but if I first display a small amount of data without the 
need of scrolling (looks OK) and then reload a big amount where scrolling is 
necessary, then the old bezierPath (from the old data) is still drawn on the 
left side of the scroll view and the new data continue on the right. It looks 
like the new data are just added at the end of the old path, though the 
bezierPath is created in the drawRect method. There seems to be a buffering 
problem.
The setNeedsDisplay: method is called from the controller (after putting the 
new data into the array that is then used for bezier path creation) and in 
viewDidEndLiveResize:. Resizing the window corrects the problem.
Even weirder: When I use [self setFrameSize:NSMakeSize(numberOfDataPoints, 
height)]; , that means not adding a 1 to the numberOfDataPoints, the data are 
not displayed at all!? Resizing helps. This totally befuddles me. I don’t see 
the logic behind this.
Moving the setFrameSize: method to the controller after data assignment and 
right before setNeedsDisplay: is the cure, but I would like to understand what 
happens.

Best Regards,

Stefan




smime.p7s
Description: S/MIME cryptographic signature
___

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

how to set custom icon folder to invisible?

2010-07-01 Thread Valerio Schiavoni
Hello everyone,
i'm using the code given here:
http://www.macgeekery.com/gspot/2007-02/setting_an_icon_from_the_cli
to set a custom icon folder.

It works fine, but when i do a ls -l inside the folder, i see:


ls -l
total 640
-rw-r--r--@  1 root  admin0  1 Lug 10:14 Icon?
drwxrwxr-x   7 root  admin  238  1 Lug 10:14 bin
drwxrwxr-x   6 root  admin  204  1 Lug 10:14 clibs
drwxrwxr-x  11 root  admin  374  1 Lug 10:14 lualibs

How can I change the code so that the Icon? file is invisible?

thanks,
valerio

ps: i'm a complete newbie in objc/cocoa.
___

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: CoreData and undo/redo : how to add a managed object with attributes already set in the undo/redo stack ?

2010-07-01 Thread Jerry Krinock

On 2010 Jun 29, at 13:47, Sean McBride wrote:

> I don't believe that's the right pattern.  In awakeFromInsert/Fetch, one
> should be using primitive setters.  The docs say "..."

You're correct, Sean.  I thought I got that pattern from some Apple sample 
code, but I can't find it now.  

Use of primitive setters in -awakeFromInsert seems less kludgey, and is also 
demonstrated in "NSPersistentDocument Core Data Tutorial", Chapter 3.

___

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: class_respondsToSelector() in runtime.h?

2010-07-01 Thread Kyle Sluder
On Jul 1, 2010, at 9:42 AM, Jonathon Kuo  wrote:

> On Jul 1, 2010, at 7:56 AM, Matt Neuburg wrote:
> 
>> "Instance methods defined in a root class can be performed both by instances
>> and by class objects. Therefore, all class objects have access to the
>> instance methods defined in the root class."
> 
> Not that it would generally be USEFUL to do so, since the purpose of an 
> instance is to hold instance variable values; a class object accessing 
> instance variables through an instance method would come up with 
> uninitialized ivar values, no?

They are instances of the root class, so they have all the root class instances 
variables, of which there is precisely one: isa.

--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: class_respondsToSelector() in runtime.h?

2010-07-01 Thread Jonathon Kuo
On Jul 1, 2010, at 7:56 AM, Matt Neuburg wrote:

> "Instance methods defined in a root class can be performed both by instances
> and by class objects. Therefore, all class objects have access to the
> instance methods defined in the root class."

Not that it would generally be USEFUL to do so, since the purpose of an 
instance is to hold instance variable values; a class object accessing instance 
variables through an instance method would come up with uninitialized ivar 
values, no?

___

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: Error when closing window with IKImageBrowserView in it

2010-07-01 Thread Nick Zitzmann

On Jul 1, 2010, at 10:36 AM, Dave Fernandes wrote:

> I've seen the same error message logged, but I've never narrowed the cause 
> down enough to file a bug report. What's the workaround?

If you order the window out instead of closing it, then IKImageBrowserView will 
quit squawking. The window will still be resident, but it won't be on screen.

Nick Zitzmann


___

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: Error when closing window with IKImageBrowserView in it

2010-07-01 Thread Dave Fernandes
I've seen the same error message logged, but I've never narrowed the cause down 
enough to file a bug report. What's the workaround?

On 2010-07-01, at 12:29 PM, Nick Zitzmann wrote:

> 
> On Jul 1, 2010, at 7:00 AM, Gideon King wrote:
> 
>> : kCGErrorInvalidConnection: CGSGetSurfaceBounds: Invalid connection
>> : kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch 
>> errors as they are logged.
>> : kCGErrorInvalidConnection: CGSGetSurfaceBounds: Invalid connection
> [...]
>> Has anyone else seen this issue? Is there a known workaround?
> 
> Yes and yes. Did you file a bug report?
> 
> Nick Zitzmann
> 
> 
> ___
> 
> 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/dave.fernandes%40utoronto.ca
> 
> This email sent to dave.fernan...@utoronto.ca

___

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: class_respondsToSelector() in runtime.h?

2010-07-01 Thread Kyle Sluder
On Jul 1, 2010, at 9:14 AM, Michael Ash  wrote:

> On Thu, Jul 1, 2010 at 12:05 PM, Michael Ash  wrote:
>> An extremely minor nitpick: the use of +class here is necessary.
> 
> Of course I meant to write that the use of +class here is UNnecessary. Sigh.

And it can actually get you into trouble. +class returns self, so this won't do 
what you might think at first:

[[SomeClass class] instancesRespondToSelector:@selector(foo)]

One might think that asks if the SomeClass class object responds to foo, 
following the logic that [SomeClass class] would return SomeClass's metaclass. 
In fact, as Mike describes, it is equivalent to [SomeClass 
instancesRespondToSelector:@selector(foo)].

--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: Error when closing window with IKImageBrowserView in it

2010-07-01 Thread Nick Zitzmann

On Jul 1, 2010, at 7:00 AM, Gideon King wrote:

> : kCGErrorInvalidConnection: CGSGetSurfaceBounds: Invalid connection
> : kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch 
> errors as they are logged.
> : kCGErrorInvalidConnection: CGSGetSurfaceBounds: Invalid connection
[...]
> Has anyone else seen this issue? Is there a known workaround?

Yes and yes. Did you file a bug report?

Nick Zitzmann


___

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: class_respondsToSelector() in runtime.h?

2010-07-01 Thread Michael Ash
On Thu, Jul 1, 2010 at 12:05 PM, Michael Ash  wrote:
> An extremely minor nitpick: the use of +class here is necessary.

Of course I meant to write that the use of +class here is UNnecessary. Sigh.

Mike
___

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: KVO question

2010-07-01 Thread Kyle Sluder
On Jul 1, 2010, at 8:26 AM, Rainer Standke  wrote:

> Hello all,
> 
> is it possible to determine if one object is observing another? Specifically, 
> I'd like one object to ask another "are you observing me?". That way I could 
> determine if I need to remove that observer before I let go of the observed 
> object...

This is a very good indication that you have an inverted or cyclical 
dependency. Your observee shouldn't need to know about your observers.

What is your specific setup?

--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: Capturing output from another task with elevated privilages

2010-07-01 Thread Kevin Wojniak
I may be wrong, but I believe AEWP only captures stdout, not stderr, so you 
could check for that.


On Jul 1, 2010, at 7:37 AM, Eric Hoaglin wrote:

> Hi all,
> 
> I have the following code:
> http://www.pasteit4me.com/763005
> 
> I'm trying to capture the output of the task that I run. and from what I 
> understand, if you want to do so, you pass a FILE*
> to AuthorizationExecuteWithPrivileges and then just read it as a normal file 
> (which you can see from lines 29-45
> 
> I'm not sure I'm doing it correctly, as when I run my app in the Xcode 
> debugger, the output gets to the debug console, but doesn't show up
> when I run it from a normal build. I know there is output from the task 
> because I can see it... in the debug console.. but not from my own
> NSLOG tests.
> 
> Any and all help would be greatly appreciated.
> 
> Thanks in advance and regards,
> 
> Eric Hoaglin
> GryphonClaw Software
> http://www.gryphonclaw.net
> REALbasic Paste Site: http://code.gryphonclaw.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/kainjow%40kainjow.com
> 
> This email sent to kain...@kainjow.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: class_respondsToSelector() in runtime.h?

2010-07-01 Thread Dave DeLong
For more information: http://stackoverflow.com/questions/3107213

Dave

On Jul 1, 2010, at 10:05 AM, Michael Ash wrote:

> On Wed, Jun 30, 2010 at 5:44 PM, Dave Carrigan  wrote:
>> 
>> On Jun 30, 2010, at 2:35 PM, Laurent Daudelin wrote:
>> 
>>> Well, isn't -respondsToSelector: an instance method?
>> 
>> 
>> if ([[Someclass class] respondsToSelector:@selector(classSelector)]) {
>>// yup
>> }
> 
> An extremely minor nitpick: the use of +class here is necessary. You
> can simply write [Someclass respondsToSelector:...]. The use of
> [Someclass class] is only necessary when you want to use Someclass as
> a value or parameter or such.


smime.p7s
Description: S/MIME cryptographic signature
___

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: class_respondsToSelector() in runtime.h?

2010-07-01 Thread Michael Ash
On Wed, Jun 30, 2010 at 5:44 PM, Dave Carrigan  wrote:
>
> On Jun 30, 2010, at 2:35 PM, Laurent Daudelin wrote:
>
>> Well, isn't -respondsToSelector: an instance method?
>
>
> if ([[Someclass class] respondsToSelector:@selector(classSelector)]) {
>        // yup
> }

An extremely minor nitpick: the use of +class here is necessary. You
can simply write [Someclass respondsToSelector:...]. The use of
[Someclass class] is only necessary when you want to use Someclass as
a value or parameter or such.

Mike
___

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: Capturing output from another task with elevated privilages

2010-07-01 Thread Ken Thomases
On Jul 1, 2010, at 9:37 AM, Eric Hoaglin wrote:

> I'm trying to capture the output of the task that I run. and from what I 
> understand, if you want to do so, you pass a FILE*
> to AuthorizationExecuteWithPrivileges and then just read it as a normal file 
> (which you can see from lines 29-45
> 
> I'm not sure I'm doing it correctly, as when I run my app in the Xcode 
> debugger, the output gets to the debug console, but doesn't show up
> when I run it from a normal build. I know there is output from the task 
> because I can see it... in the debug console.. but not from my own
> NSLOG tests.

According to the docs, AuthorizationExecuteWithPrivileges captures standard 
output from the task, but it doesn't say it captures standard error.  If the 
tool is outputting to stderr, then that will probably go to the same place that 
the parent's stderr is going, which is often the console log (/dev/console, 
viewable via Console.app).  When run under Xcode, stderr goes to Xcode's 
console window.

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


KVO question

2010-07-01 Thread Rainer Standke
Hello all,

is it possible to determine if one object is observing another? Specifically, 
I'd like one object to ask another "are you observing me?". That way I could 
determine if I need to remove that observer before I let go of the observed 
object...

Thanks,

Rainer___

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: class_respondsToSelector() in runtime.h?

2010-07-01 Thread Matt Neuburg
On Wed, 30 Jun 2010 18:02:38 -0400, Laurent Daudelin
 said:
>On Jun 30, 2010, at 17:48, Greg Parker wrote:
>
>> On Jun 30, 2010, at 2:42 PM, Laurent Daudelin wrote:
>>> Yes, I know that, but can you send an instance method to a class object?
>> 
>> Yes, you can. Every class object is itself an instance of NSObject.
>
>Thanks, Greg. I guess you learn something new every day

Apple's own "Cocoa Fundamentals Guide" is well worth reading. It's truly
excellent, and tells about Cocoa fundamentals (i.e. things one needs to know
in order to use Cocoa):



"Instance methods defined in a root class can be performed both by instances
and by class objects. Therefore, all class objects have access to the
instance methods defined in the root class."

m.

-- 
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings



___

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: CAGradientLayer with horizontal gradient

2010-07-01 Thread MB
I realized I was trying to position the start and end point using the layer 
coordinate system, instead I should use relative values between 0.0 and 1.0.

gradient.startPoint = CGPointMake(0, 0.5);
gradient.endPoint = CGPointMake(1.0, 0.5);

Like this it works.

Thanks for the response.


On 1 jul 2010, at 16:41, Kyle Sluder wrote:

> On Jul 1, 2010, at 1:09 AM, MB  wrote:
> 
>> When you create a CAGradientLayer, the gradient is vertical. How can you get 
>> the gradient to go horizontal? I've tried using startPoint and endPoint, but 
>> that doesn't seem to do the trick.
> 
> But that's indeed how you do it. Care to post your code?
> 
> --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: CAGradientLayer with horizontal gradient

2010-07-01 Thread Kyle Sluder
On Jul 1, 2010, at 1:09 AM, MB  wrote:

> When you create a CAGradientLayer, the gradient is vertical. How can you get 
> the gradient to go horizontal? I've tried using startPoint and endPoint, but 
> that doesn't seem to do the trick.

But that's indeed how you do it. Care to post your code?

--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: CALayer-hosting view and child NSView's

2010-07-01 Thread Kyle Sluder
On Jul 1, 2010, at 12:56 AM, Oleg Krupnov  wrote:

> Thanks Scott,
> 
> To draw shadows around cells, I would have to draw outside the cell
> view's frame, i.e. on the parent view or sibling cells, respecting the
> z-order. Is this possible?

Again, layer-hosting views can't have subviews. You will need to implement your 
buttons as layers, at which point you can give them drop shadows quite easily.

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


Capturing output from another task with elevated privilages

2010-07-01 Thread Eric Hoaglin
Hi all,

I have the following code:
http://www.pasteit4me.com/763005

I'm trying to capture the output of the task that I run. and from what I 
understand, if you want to do so, you pass a FILE*
to AuthorizationExecuteWithPrivileges and then just read it as a normal file 
(which you can see from lines 29-45

I'm not sure I'm doing it correctly, as when I run my app in the Xcode 
debugger, the output gets to the debug console, but doesn't show up
when I run it from a normal build. I know there is output from the task because 
I can see it... in the debug console.. but not from my own
NSLOG tests.

Any and all help would be greatly appreciated.

Thanks in advance and regards,

Eric Hoaglin
GryphonClaw Software
http://www.gryphonclaw.net
REALbasic Paste Site: http://code.gryphonclaw.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


Error when closing window with IKImageBrowserView in it

2010-07-01 Thread Gideon King
Hi, I have a panel which has an IKImageKitBrowser in it, and when I close the 
window, if I have any images selected, I get this message:

 : kCGErrorInvalidConnection: CGSGetSurfaceBounds: Invalid connection
 : kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch 
errors as they are logged.
 : kCGErrorInvalidConnection: CGSGetSurfaceBounds: Invalid connection

I tried to set a breakpoint on CGErrorBreakpoint(), but it didn't stop on it 
(my breakpoints seem to be ignored sometimes in the current XCode).

It definitively only happens when something is selected in the view. Apart from 
the warning, the program appears to work just fine, but I don't like just 
leaving it there spewing messages to the console.

I tried picking up the NSWindowWillCloseNotification and calling 
setSelectionIndexes:[NSIndexSet indexSet] on my array controller for the view 
to clear the selection, and although that clears the selection, I still get the 
error message.

Has anyone else seen this issue? Is there a known workaround?

Thanks.

Gideon







___

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 ambiguities

2010-07-01 Thread Ariel Feinerman
I wish to get the strings from file, exclude some strings and empty strings
and write them to file, so do you sure these methods are for that? Can you
explain what you suggest by given an example?
I take care of backward compatibility with 10.5 therefore 10.6 blocks is out
.

Thank you.


2010/7/1 Douglas Davidson 

>
> On Jun 30, 2010, at 3:02 PM, Ariel Feinerman wrote:
>
> > If we read whole file as a NSString, will be any conversions between
> \r\n,
> > \r, \n? Then if not, will be -componentsSeparatedByCharactersInSet:
> > [NSCharacterSet newlineCharacterSet] create empty strings in Win \r\n
> case?
> > So what is the best: [NSCharacterSet newlineCharacterSet] or
> [NSCharacterSet
> > characterSetWithCharactersInString: @"\n"] or simply
> > -componentsSeparatedByString: @"\n"?
>
> What's best is enumerateSubstringsInRange:options:usingBlock:.  You can use
> NSStringEnumerationByParagraphs to handle all the standard paragraph
> separators.  Prior to 10.6, use paragraphRangeForRange: or
> getParagraphStart:end:contentsEnd:forRange: and construct your own loop.
>
> Douglas Davidson




-- 
best regards
Ariel
___

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


CAGradientLayer with horizontal gradient

2010-07-01 Thread MB
When you create a CAGradientLayer, the gradient is vertical. How can you get 
the gradient to go horizontal? I've tried using startPoint and endPoint, but 
that doesn't seem to do the trick.

MB

___

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: CALayer-hosting view and child NSView's

2010-07-01 Thread Oleg Krupnov
Thanks Scott,

To draw shadows around cells, I would have to draw outside the cell
view's frame, i.e. on the parent view or sibling cells, respecting the
z-order. Is this possible?

Also, the cells in my view can be moving over each other with an
animation. When the cell view is moved using setFrame, it does not
receive the drawRect:, neither do the parent view and the sibling cell
views. so there seems no chance to update its shadow (even assuming
it's possible to draw outside the cell view)

Thanks!

On Thu, Jul 1, 2010 at 10:42 AM, Scott Anguish  wrote:
>
> On Jul 1, 2010, at 3:14 AM, Oleg Krupnov wrote:
>
>> Right, I want to add subviews into a layer-hosting view.
>>
>
> You can’t.
>
>> I want to do this, in particular, because I want the "cells" in my
>> custom view to drop shadows. If I implement cells like simple subviews
>> and use layer-backed view, I can't seem to do it, can I?
>
> Why can’t your cell drawing class (assuming they’re custom classes) just draw 
> the shadow?
>
> And shadows for buttons aren’t exactly a common user experience.
>
>>
>> I have performed an experiment right now and it seems that it's okay
>> to add subviews to a layer-hosting view. It seems to work fine. Is
>> there any explicit prohibition to do so in the docs?
>
> Yes. Animation Overview. It could be stronger, and I’ll repeat it elsewhere.
>
> Regardless, don’t do it.
>
>>
>> Thanks.
>>
>> On Thu, Jul 1, 2010 at 10:07 AM, Scott Anguish  wrote:
>>> A layer-hosting view can’t have subviews, which is what it sounds like you 
>>> want to do in the second to last paragraph.
>>>
>>>
>>> Why can’t you just use layer-backed views? You get the controls, you can 
>>> still do animation using the animation proxy and the other animation 
>>> methods.
>>>
>>> On Jun 30, 2010, at 5:27 AM, Oleg Krupnov wrote:
>>>
 Hi,

 I'd like to create a custom view based on Core Animation, namely, a
 layer-hosting view. In other words, I'd like to directly manipulate
 layers in my code rather than using children NSView's.

 The custom view is like a matrix consisting of cells. Each cell is
 represented with a separate CALayer.

 However, certain cells should contain standard buttons like if they
 were "child views" of those cell layers. In other words, when I move
 the cell layer, the button needs to move synchronously; when I hide
 the cell layer, the button needs to hide as well.

 I would like to use the standard NSButton control, to avoid
 reinventing the wheel.

 But if I just place the button as a first-level child view of the
 custom view, it will not be associated with its parent cell layer. I
 also cannot access and manipulate NSButton's root layer to add it as a
 sublayer to the cell layer, AFAIK.

 So what is the best way around?

>>>
>>>
>
>
___

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: CALayer-hosting view and child NSView's

2010-07-01 Thread Scott Anguish

On Jul 1, 2010, at 3:14 AM, Oleg Krupnov wrote:

> Right, I want to add subviews into a layer-hosting view.
> 

You can’t.

> I want to do this, in particular, because I want the "cells" in my
> custom view to drop shadows. If I implement cells like simple subviews
> and use layer-backed view, I can't seem to do it, can I?

Why can’t your cell drawing class (assuming they’re custom classes) just draw 
the shadow?

And shadows for buttons aren’t exactly a common user experience.

> 
> I have performed an experiment right now and it seems that it's okay
> to add subviews to a layer-hosting view. It seems to work fine. Is
> there any explicit prohibition to do so in the docs?

Yes. Animation Overview. It could be stronger, and I’ll repeat it elsewhere.

Regardless, don’t do it.

> 
> Thanks.
> 
> On Thu, Jul 1, 2010 at 10:07 AM, Scott Anguish  wrote:
>> A layer-hosting view can’t have subviews, which is what it sounds like you 
>> want to do in the second to last paragraph.
>> 
>> 
>> Why can’t you just use layer-backed views? You get the controls, you can 
>> still do animation using the animation proxy and the other animation methods.
>> 
>> On Jun 30, 2010, at 5:27 AM, Oleg Krupnov wrote:
>> 
>>> Hi,
>>> 
>>> I'd like to create a custom view based on Core Animation, namely, a
>>> layer-hosting view. In other words, I'd like to directly manipulate
>>> layers in my code rather than using children NSView's.
>>> 
>>> The custom view is like a matrix consisting of cells. Each cell is
>>> represented with a separate CALayer.
>>> 
>>> However, certain cells should contain standard buttons like if they
>>> were "child views" of those cell layers. In other words, when I move
>>> the cell layer, the button needs to move synchronously; when I hide
>>> the cell layer, the button needs to hide as well.
>>> 
>>> I would like to use the standard NSButton control, to avoid
>>> reinventing the wheel.
>>> 
>>> But if I just place the button as a first-level child view of the
>>> custom view, it will not be associated with its parent cell layer. I
>>> also cannot access and manipulate NSButton's root layer to add it as a
>>> sublayer to the cell layer, AFAIK.
>>> 
>>> So what is the best way around?
>>> 
>> 
>> 

___

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 to retrieve a vCard during an ISyncSession?

2010-07-01 Thread unixo
My need is to retrieve a vCard given a ISyncChange record identifier.
Does anyone know if there is a relationship between the two IDs?

Thanks in advance

On 30/giu/2010, at 08.34, Laurent Cerveau wrote:

> Why would you want to retrieve the vCard? The sync engine can give you all 
> attributes for a record. Or maybe AddressBook framework is more suited to 
> your needs
> 
> laurent 
> 
> Sent from my road phone
> 
> 
> On Jun 30, 2010, at 7:59 AM, unixo  wrote:
> 
>> Hi,
>> 
>> I'm writing a sync client which pulls "Contacts" entity from sync server; an 
>> unique identifier is associated with each record: given an ID, is there a 
>> way to load the corresponding vCard from address book?
>> 
>> Even if data are similar (except for suffix ":ABPerson"), I can't find a 
>> record using recordsMatchingSearchElement: method.
>> ISyncChange UID: 04854671-4DD3-41C8-9601-3AE65C1AAEA1
>> AddressBook UID: C8CD9946-D629-4CD1-90A4-F270190AC4A0:ABPerson
>> 
>> Any ideas?
>> 
>> 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/lcerveau%40me.com
>> 
>> This email sent to lcerv...@me.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: CALayer-hosting view and child NSView's

2010-07-01 Thread Oleg Krupnov
Right, I want to add subviews into a layer-hosting view.

I want to do this, in particular, because I want the "cells" in my
custom view to drop shadows. If I implement cells like simple subviews
and use layer-backed view, I can't seem to do it, can I?

I have performed an experiment right now and it seems that it's okay
to add subviews to a layer-hosting view. It seems to work fine. Is
there any explicit prohibition to do so in the docs?

Thanks.

On Thu, Jul 1, 2010 at 10:07 AM, Scott Anguish  wrote:
> A layer-hosting view can’t have subviews, which is what it sounds like you 
> want to do in the second to last paragraph.
>
>
> Why can’t you just use layer-backed views? You get the controls, you can 
> still do animation using the animation proxy and the other animation methods.
>
> On Jun 30, 2010, at 5:27 AM, Oleg Krupnov wrote:
>
>> Hi,
>>
>> I'd like to create a custom view based on Core Animation, namely, a
>> layer-hosting view. In other words, I'd like to directly manipulate
>> layers in my code rather than using children NSView's.
>>
>> The custom view is like a matrix consisting of cells. Each cell is
>> represented with a separate CALayer.
>>
>> However, certain cells should contain standard buttons like if they
>> were "child views" of those cell layers. In other words, when I move
>> the cell layer, the button needs to move synchronously; when I hide
>> the cell layer, the button needs to hide as well.
>>
>> I would like to use the standard NSButton control, to avoid
>> reinventing the wheel.
>>
>> But if I just place the button as a first-level child view of the
>> custom view, it will not be associated with its parent cell layer. I
>> also cannot access and manipulate NSButton's root layer to add it as a
>> sublayer to the cell layer, AFAIK.
>>
>> So what is the best way around?
>>
>
>
___

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: CALayer-hosting view and child NSView's

2010-07-01 Thread Scott Anguish
A layer-hosting view can’t have subviews, which is what it sounds like you want 
to do in the second to last paragraph.


Why can’t you just use layer-backed views? You get the controls, you can still 
do animation using the animation proxy and the other animation methods.

On Jun 30, 2010, at 5:27 AM, Oleg Krupnov wrote:

> Hi,
> 
> I'd like to create a custom view based on Core Animation, namely, a
> layer-hosting view. In other words, I'd like to directly manipulate
> layers in my code rather than using children NSView's.
> 
> The custom view is like a matrix consisting of cells. Each cell is
> represented with a separate CALayer.
> 
> However, certain cells should contain standard buttons like if they
> were "child views" of those cell layers. In other words, when I move
> the cell layer, the button needs to move synchronously; when I hide
> the cell layer, the button needs to hide as well.
> 
> I would like to use the standard NSButton control, to avoid
> reinventing the wheel.
> 
> But if I just place the button as a first-level child view of the
> custom view, it will not be associated with its parent cell layer. I
> also cannot access and manipulate NSButton's root layer to add it as a
> sublayer to the cell layer, AFAIK.
> 
> So what is the best way around?
> 

___

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