Re: A hillegass challenge

2009-12-03 Thread Seth Willits
On Dec 3, 2009, at 11:39 PM, Michael de Haan wrote:

> I would like to ask the group if  this is "good practice"   ( I am almost 
> certain it is not "best practice" :-)  )
> 
> My question pertains to knowingly setting an object to NULL and then 
> knowingly sending it a message as an acceptable technique.

As general answer: Yep. Happens all the time.


> 
> 
> As mentioned above, this does work, but seems ?sloppy?.

A lot of people would probably do it a little differently, but it's totally 
fine as you have it. Some would argue that adding more checks into your 
perfectly valid code is sloppy.


--
Seth Willits



___

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 get an italic font

2009-12-03 Thread mlist0...@gmail.com
Is there some reason you can't use -[NSFontManager convertFont:toHaveTrait:] ?

It "returns a font whose traits are the same as those of the given font, except 
that the traits are changed to include the single specified trait."


So something like:

NSFont* myFont = [your code here];
NSFont* myItalicFont = [[NSFontManager sharedFontManager] convertFont:myFont 
toHaveTrait:NSItalicFontMask];


_murat


On Dec 3, 2009, at 11:15 PM, Gerriet M. Denkmann wrote:

> I want an italic font corresponding to an existing font.
> 
> I tried:
> 
>   NSFontDescriptor *fd1 = [ NSFontDescriptor fontDescriptorWithName: 
> @"Times" size: textFontSize ];
>   NSLog(@"%s text NSFontDescriptor %@",__FUNCTION__, fd1);
>   // NSFontNameAttribute = Times;  NSFontSizeAttribute = 16;
> 
>   fontText = [ NSFont fontWithDescriptor: fd1 size: textFontSize ];
>   NSLog(@"%s text NSFont %@",__FUNCTION__, fontText);
>   //  "Times-Roman 16.00 pt. P [] (0x1190e0f90) fobj=0x1190e0590, 
> spc=4.00"
> 
> So far so good.
> 
> Now I try to make the italic variant:
>   NSFontSymbolicTraits symbolicTraits = NSFontItalicTrait;
>   NSFontDescriptor *fdi = [ fd1 fontDescriptorWithSymbolicTraits: 
> symbolicTraits ];
>   NSLog(@"%s italic NSFontDescriptor %@",__FUNCTION__, fdi);
>   // NSCTFontTraitsAttribute = { NSCTFontSymbolicTrait = 1; }; 
> NSFontSizeAttribute = 16;
> Note: NSFontNameAttribute has disappeared
> The  documentation says: "Returns a new font descriptor that is the same as 
> the receiver but with the specified symbolic traits taking precedence over 
> the existing ones."
> 
>   italicText = [ NSFont fontWithDescriptor: fdi size: textFontSize ];
>   NSLog(@"%s italic NSFont %@",__FUNCTION__, italicText);
>   //  "LucidaGrande 16.00 pt. P [] (0x1190e0f90) fobj=0x10046adb0, 
> spc=5.06"
> 
> This is comple nonsense: Lucida Grande is not italic and does not have an 
> italic variant (only normal and bold).
> 
> I would have expected something like Times-Italic.
> 
> So: how to get an italic variant to a given font without hardcoding font 
> names?
> 
> 
> Kind regards,
> 
> Gerriet.
> 
> ___
> 
> 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/mlist0987%40gmail.com
> 
> This email sent to mlist0...@gmail.com

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


A hillegass challenge

2009-12-03 Thread Michael de Haan
I would like to ask the group if  this is "good practice"   ( I am almost 
certain it is not "best practice" :-)  )

My question pertains to knowingly setting an object to NULL and then knowingly 
sending it a message as an acceptable technique. (If this is not done, drawRect 
will simply show the oval as if it was still being actively drawn).

The challenge was to design a doc based app that allowed a user to draw 
arbitrary ovals.

Very briefly, I used the outline of "Cocoa design patterns" by using an NSArray 
of objects in a "controller" object ( in this case "MyDocument") which defined 
a bezierpath, and in the "drawRect" method of the view, used this code. 

- (void)drawRect:(NSRect)dirtyRect {

code to fill background of viewObject

/* now load the stored ovals from the array */

for (NSBezierPath * oval in [[ self delegate] ovals])  
{
code to set saved color
[oval fill];
}

 /*paint the currently drawn user path (where currentPath is an ivar in the 
NSView Object) */

..code to change color to  "working"  color   
[[self currentPath] fill]; 
}




Now...In order to provide visual feedback on the mouseUp event ( the oval 
changes color to show that it is now saved) I set the current path to NULL thus.

- (void)mouseUp:(NSEvent *)theEvent
{
code that sets the current mouseDown point and creates the current 
bezier path.

...code that adds the current bezierpath to ovals list .


[self setCurrentPath:NULL]; /*sets the current bezierPath to nil */  
[self setNeedsDisplay:YES];


As mentioned above, this does work, but seems ?sloppy?.
Thanks.


___

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 get an italic font

2009-12-03 Thread Gerriet M. Denkmann
I want an italic font corresponding to an existing font.

I tried:

NSFontDescriptor *fd1 = [ NSFontDescriptor fontDescriptorWithName: 
@"Times" size: textFontSize ];
NSLog(@"%s text NSFontDescriptor %@",__FUNCTION__, fd1);
// NSFontNameAttribute = Times;  NSFontSizeAttribute = 16;

fontText = [ NSFont fontWithDescriptor: fd1 size: textFontSize ];
NSLog(@"%s text NSFont %@",__FUNCTION__, fontText);
//  "Times-Roman 16.00 pt. P [] (0x1190e0f90) fobj=0x1190e0590, 
spc=4.00"

So far so good.

Now I try to make the italic variant:
NSFontSymbolicTraits symbolicTraits = NSFontItalicTrait;
NSFontDescriptor *fdi = [ fd1 fontDescriptorWithSymbolicTraits: 
symbolicTraits ];
NSLog(@"%s italic NSFontDescriptor %@",__FUNCTION__, fdi);
// NSCTFontTraitsAttribute = { NSCTFontSymbolicTrait = 1; }; 
NSFontSizeAttribute = 16;
Note: NSFontNameAttribute has disappeared
The  documentation says: "Returns a new font descriptor that is the same as the 
receiver but with the specified symbolic traits taking precedence over the 
existing ones."

italicText = [ NSFont fontWithDescriptor: fdi size: textFontSize ];
NSLog(@"%s italic NSFont %@",__FUNCTION__, italicText);
//  "LucidaGrande 16.00 pt. P [] (0x1190e0f90) fobj=0x10046adb0, 
spc=5.06"

This is comple nonsense: Lucida Grande is not italic and does not have an 
italic variant (only normal and bold).

I would have expected something like Times-Italic.

So: how to get an italic variant to a given font without hardcoding font names?


Kind regards,

Gerriet.

___

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: applicationShouldTerminate problem

2009-12-03 Thread Andrew Farmer
On 3 Dec 2009, at 00:25, proger proger wrote:
> I'm making little cocoa application. After the application will be closed i
> need to show alert. So i created applicationShouldTerminate delegate:
> 
> - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)app 
> {
> 
> if (textChanged == 1)
> 
> {
> 
> int ret = NSRunAlertPanel(@"Save the work?", @"Do you want save the work?",
> @"Yes", @"Cancel", @"No" ) ;

You are reimplementing NSDocumentController, awkwardly. Read this before you 
continue:

http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Documents/Documents.html

Don't reinvent the wheel!___

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


beginSheetForDirectory:file:types:modalForWindow:modalDelegate:didEndSelector: on 10.6

2009-12-03 Thread Charles Burnstagger
What changes were made to NSSavePanel 
beginSheetForDirectory:file:types:modalForWindow:modalDelegate:didEndSelector:

in 10.6?

When I set my Xcode 3.2 project's base SDK to 10.6 and Deployment target to 
10.5 it says the method is deprecated.

Yet when I run Apple's ImageKitDemo, also using the 10.6 SDK, it compiles 
without a warning.

What gives?

Thanks,
Chuck



  
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: Why is "set" a class method of NSColor?

2009-12-03 Thread Jack Boyce
Argh, never mind.  I overlooked an important section of the Cocoa Drawing
Guide.

Jack



On Thu, Dec 3, 2009 at 6:46 PM, Jack Boyce  wrote:

> I'm learning Cocoa, trying to understand certain "magical" features where
> it isn't obvious how things work under the hood.  (KVO and isa-swizzling is
> another prime example.)
>
> Can someone kindly explain, or point me to an explanation for, what's
> really happening with:
> [[NSColor blueColor] set];
>
> In other APIs one commonly sees methods on the target view for setting
> things like pen color and transformations.  I.e., why is it not:
>  [myView setPenColor:[NSColor blueColor]];
>
> In particular, how does the NSColor object know which NSView you're talking
> about when you send it the 'set' message?  My current hypothesis is that
> information like pen color is recorded somehow in the [NSGraphicsContext
> currentContext] object for the current thread, but I can't confirm this in
> the docs.  This would imply Cocoa is doing work behind the scenes to set up
> the NSGraphicsContext before it calls your view's drawFrame: method, and
> then cleaning up when you return.  Is the idea then that one should only
> draw within the drawFrame: method of NSView, and only from the main thread
> (when Cocoa calls it)?  I.e., there is no multi-threaded drawing in Cocoa?
>
> Thanks,
> Jack
>
>
___

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


Why is "set" a class method of NSColor?

2009-12-03 Thread Jack Boyce
I'm learning Cocoa, trying to understand certain "magical" features where it
isn't obvious how things work under the hood.  (KVO and isa-swizzling is
another prime example.)

Can someone kindly explain, or point me to an explanation for, what's really
happening with:
[[NSColor blueColor] set];

In other APIs one commonly sees methods on the target view for setting
things like pen color and transformations.  I.e., why is it not:
 [myView setPenColor:[NSColor blueColor]];

In particular, how does the NSColor object know which NSView you're talking
about when you send it the 'set' message?  My current hypothesis is that
information like pen color is recorded somehow in the [NSGraphicsContext
currentContext] object for the current thread, but I can't confirm this in
the docs.  This would imply Cocoa is doing work behind the scenes to set up
the NSGraphicsContext before it calls your view's drawFrame: method, and
then cleaning up when you return.  Is the idea then that one should only
draw within the drawFrame: method of NSView, and only from the main thread
(when Cocoa calls it)?  I.e., there is no multi-threaded drawing in Cocoa?

Thanks,
Jack
___

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


Fwd: applicationShouldTerminate problem

2009-12-03 Thread proger proger
Hello,

I'm making little cocoa application. After the application will be closed i
need to show alert. So i created applicationShouldTerminate delegate:

 - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication*)app {

 if (textChanged == 1)

{

int ret = NSRunAlertPanel(@"Save the work?", @"Do you want save the work?",
@"Yes", @"Cancel", @"No" ) ;

if (ret == NSAlertDefaultReturn)

{

if (save == 0)

{

NSSavePanel *saveDlg = [NSSavePanel savePanel] ;

if ([saveDlg runModal] == NSOKButton)

{

NSString *filename = [saveDlg filename] ;

save = 1 ;

 NSString *saveFileName = filename ;

 NSError *error;

NSString *text = [[textView textStorage] string] ;

BOOL ok = [text writeToFile:saveFileName atomically:YES

   encoding:NSUnicodeStringEncoding error:&error];

if (!ok)

 {

NSRunAlertPanel(@"File haven't saved", @"File haven't saved", @"OK", nil,
nil) ;

NSLog(@"Can't save file %@", saveFileName) ;

}

}

}

return NSTerminateNow ;

}

if (ret == NSAlertAlternateReturn)

{

return NSTerminateCancel ;

}

if (ret == NSAlertOtherReturn)

{

return NSTerminateNow ;

}

}

return NSTerminateNow ;

}
I used Interface Builder to delegate NSApplication with my delegate
controller. But don't see any results. But i investigated if i'm also add
this delegate method:

-(BOOL) applicationShouldTerminateAfterLastWindowClosed:(NSApplication
*)theApplication
{
return YES;
}

So applicationShouldTerminate is called. But i'm still have problem because
then NSAlert is shown(i don't see my application window, it hides) and if i
press Cancel button NSAlert still shown again. I want to see my application
window then i see NSAlert and Cancel NSAlert button is needed to to work
correctly.
___

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: Best way to hook into the run loop?

2009-12-03 Thread Jason Foreman

On Dec 3, 2009, at 10:17 PM, Graham Cox wrote:

> One thing I'd like to do is to match NSUndoManager's ability to automatically 
> open and close groups as the run loop cycles. What's the best way to do this?

Possibly by using a CFRunLoopObserver.  You can look into 
CFRunLoopObserverCreate and the related documentation.  This will allow you to 
observe various stages of the run loop cycle.


> I notice that NSUndoManager has a 'run loop modes' property but it's unclear 
> where and how that is used.

The modes are basically filters for which input sources get processed by a run 
loop cycle.  There is a run loop mode used by modal panels and another for 
mouse tracking.  An undo manager could use this mode to avoid (or explicitly 
allow) registering undos during a mouse drag, for example.


Jason




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: Outline View.

2009-12-03 Thread Sandro Noël
On 2009-12-03, at 11:07 PM, Graham Cox wrote:
> 
> http://apptree.net/gcfolderbrowser.htm
> 
> 
> hth,
> 
> --Graham
> 
Graham thanks for the link, 
the component is deprecated thow.
but it's a good enough example.

___

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


Best way to hook into the run loop?

2009-12-03 Thread Graham Cox
As my undo woes continue and multiply, I'm working on my own undo 
implementation, as least as a back-up strategy.

One thing I'd like to do is to match NSUndoManager's ability to automatically 
open and close groups as the run loop cycles. What's the best way to do this?

What's needed is a way to call a class method of my undo manager at the start 
and end of the every cycle of the main run loop, before any events are 
dispatched.

I notice that NSUndoManager has a 'run loop modes' property but it's unclear 
where and how that is used.

Thanks for any help,

--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: Text insertion point not blinking

2009-12-03 Thread Kyle Sluder
On Thu, Dec 3, 2009 at 7:39 PM, Gideon King  wrote:
> It is a very simple subclass of NSTextView. It is not in a scrollview, but is 
> added as a subview of another view.

IB makes it very difficult to put a standalone text view anywhere,
since they belong in scroll views unless they're the field editor.
Please double-check that.

--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: Outline View.

2009-12-03 Thread Graham Cox

On 04/12/2009, at 2:59 PM, Sandro Noël wrote:

> I was wondering if anyone had a good example or post for the Dreaded Outline 
> View.
> I'm trying to list the content of a directory but i'm having problems 
> understanding the model.
> i have to feed the view.
> 
> I've ran across a couple of examples but they all mix up my mind.
> there all adding extra features like drag and drop and source view custom
> cell view's ...
> 
> i need a plain and simple explanation on the model i have to produce
> to get it to list the content of a folder, using bindings or not.


http://apptree.net/gcfolderbrowser.htm


hth,

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


Outline View.

2009-12-03 Thread Sandro Noël
Greetings.

I was wondering if anyone had a good example or post for the Dreaded Outline 
View.
I'm trying to list the content of a directory but i'm having problems 
understanding the model.
i have to feed the view.

I've ran across a couple of examples but they all mix up my mind.
there all adding extra features like drag and drop and source view custom
cell view's ...

i need a plain and simple explanation on the model i have to produce
to get it to list the content of a folder, using bindings or not.

thank!
Sandro Noel.___

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: Text insertion point not blinking

2009-12-03 Thread Gideon King
It is a very simple subclass of NSTextView. It is not in a scrollview, but is 
added as a subview of another view.

On 04/12/2009, at 1:27 PM, Kyle Sluder wrote:

> On Thu, Dec 3, 2009 at 9:17 AM, Gideon King  wrote:
>> I have a text view which has the drawsBackground: set to NO, and now the 
>> insertion point is not blinking - it's just a solid line. If I turn the 
>> drawsBackground: on, it does blink as expected.
> 
> Check the properties of the enclosing NSScrollView, make sure it has
> drawsBackground and copiesOnScroll turned off.
> 
> --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: [iphone] Libxml2 with a wrapper to NSArray

2009-12-03 Thread Fritz Anderson
On 3 Dec 2009, at 5:40 PM, Philip Vallone wrote:

>   NSString *filePath = [[NSBundle mainBundle] pathForResource:@"manifest" 
> ofType:@"xml"]; 
>   NSData* xmlData = [filePath dataUsingEncoding:NSUTF8StringEncoding];

Separate from Sean's help, sending dataUsingEncoding: to an NSString gets you 
an NSData that wraps the binary representation of the characters of the string 
itself. You want something like

NSData * xmlData = [NSData dataWithContentsOfFile: filePath];

Also:
>   NSArray *resultNodes = [NSArray array];

This points the variable resultNodes at an empty NSArray, which you will not be 
able to change.

> warning: implicit declaration of function 'PerformXPathQuery'

This indicates that you use of PerformXPathQuery was the first time the 
compiler has ever seen that function. It is universal practice to declare 
functions in advance, usually in a header (.h) file imported into the source 
file. It helps the compiler generate correct code and warn you about potential 
errors.

This last point is kind of basic to C. If you're not used to C, you shouldn't 
be starting with Objective-C, Cocoa, and libxml. Take a couple of weeks, back 
off, and learn C and its standard libraries first.

— F

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: Text insertion point not blinking

2009-12-03 Thread Kyle Sluder
On Thu, Dec 3, 2009 at 9:17 AM, Gideon King  wrote:
> I have a text view which has the drawsBackground: set to NO, and now the 
> insertion point is not blinking - it's just a solid line. If I turn the 
> drawsBackground: on, it does blink as expected.

Check the properties of the enclosing NSScrollView, make sure it has
drawsBackground and copiesOnScroll turned off.

--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: Text insertion point not blinking

2009-12-03 Thread Rob Keniger

On 04/12/2009, at 12:51 PM, Gideon King wrote:

> Thanks for the suggestion, but that made no difference.

Weird. Is this a custom subclass of NSTextView or a vanilla one? If I create a 
new project, drag a text view into a window and turn off Draws Background for 
the scroll view and text view, the cursor displays normally.

--
Rob Keniger



___

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: Text insertion point not blinking

2009-12-03 Thread Gideon King
Thanks for the suggestion, but that made no difference.

Gideon

> 
>> I have a text view which has the drawsBackground: set to NO, and now the 
>> insertion point is not blinking - it's just a solid line. If I turn the 
>> drawsBackground: on, it does blink as expected.
>> 
>> Any suggestions as to why this could be happening?
> 
> 
> It's possible you might need to subclass NSTextView and return NO from 
> -isOpaque, that's bitten me a few times when subclassing Apple controls.
> 

___

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: NSSlider's setAltIncrementValue: broken?

2009-12-03 Thread Gregory Weston
Sean McBride wrote:

> The docs for NSSlider's setAltIncrementValue: say "Sets the amount by
> which the receiver modifies its value when the knob is Option-dragged". 
> It does not.
> 
> Anyone using this successfully?

Didn't work for me when I tried it just now. Two interesting behaviors observed.

If you are already dragging and press the option key, the knob stops where it 
is until you release the key again. At that point it jumps to where the mouse 
currently is.

If you hold down option and click somewhere on the slider (but not on the knob) 
the slider will move toward the click by the alternate increment about instead 
of jumping to the point of the click.

___

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: NSSlider's setAltIncrementValue: broken?

2009-12-03 Thread Matt Neuburg
On Thu, 3 Dec 2009 18:29:49 -0500, "Sean McBride" 
said:
>Hi all,
>
>The docs for NSSlider's setAltIncrementValue: say "Sets the amount by
>which the receiver modifies its value when the knob is Option-dragged".
>It does not.
>
>Anyone using this successfully?
>
>This was asked 4 years ago, almost to the day.  No replies:
>
>
>I've noticed that since that post, IB no longer allows setting the value.
>
>My goal is to have a slider that can set values with some precision
>regardless of the on-screen size of the slider.  setAltIncrementValue
>would have helped (though it's not a very discoverable UI).

Isn't the problem just a documentation bug? setAltIncrementValue does work,
but it is about what happens when you option-click in the slider area, not
what happens when you drag the knob. Normally when you click in the slider
area, the slider jumps to where you clicked; with setAltIncrementValue, it
jumps the amount you set as the value (when you hold down the Option key and
click in the slider area). 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: Text insertion point not blinking

2009-12-03 Thread Rob Keniger

On 04/12/2009, at 3:17 AM, Gideon King wrote:

> I have a text view which has the drawsBackground: set to NO, and now the 
> insertion point is not blinking - it's just a solid line. If I turn the 
> drawsBackground: on, it does blink as expected.
> 
> Any suggestions as to why this could be happening?


It's possible you might need to subclass NSTextView and return NO from 
-isOpaque, that's bitten me a few times when subclassing Apple controls.

--
Rob Keniger



___

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


Why this NSUndoManager strange behaviour?

2009-12-03 Thread Graham Cox
I've noticed that under some, as yet to be determined, conditions, 
[NSUndoManager endUndoGrouping]; does not decrement the groupingLevel. Could 
someone with access to the sources tell me how this could be?

Before I call -endUndoGrouping, the level is 1. Afterwards, the level is still 
1. I've turned off -setGroupsByEvent and am handling all the grouping manually.

Normally the level does get decremented from 1 to 0 as expected, but sometimes 
it does not. This appears to be in some way related to whether it is being 
called from an exception handler (catch block) or not, though I'm unsure. 

When this happens, I end up with the NSUndoManager in the dreaded 'invalid 
state' whereby it just stops working. Since all parts of my app use Undo, this 
fragility is extremely detrimental to my app's functionality.

I just need to know what is the condition that causes -endUndoGrouping not to 
have any effect, so I can avoid that condition.

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


Answered: How do I bind ManagedObject's relationships to a view?

2009-12-03 Thread Daniel Wambold
I'm posting this simply because I *thought* I had looked through all  
of Apple's "bindings for beginners"-style documentation, but hadn't  
seen this sort of dependent controller setup described. Sorry if it's  
obvious or redundant


In the spirit of (finally) answering my own question (and in case  
anyone else was baffled by this), I was able to bind successfully the  
"dependent" list of "authorized users" (authUsers), which are person  
entities to an NSTableView by creating a new NSArrayController in IB,  
setting its Mode to Entity, its Entity Name to the entity that it  
would display (in this case, for example, my person entity), then  
setting the Content SET binding to the NSArrayController that managed  
the complete account entity, with the Controller Key set to selection,  
and the model path to authUsers, which was a relationship that is the  
inverse of a person's account relationship. Then, I could bind the  
NSTableViewColumn to the new controller by selecting the  
NSTableViewColumn and setting its Value binding to the new controller,  
its Controller Key to arrangedObjects, and the model key path to the  
read-only (synthesized on the fly through code) key path, nameAndID. I  
haven't tried to use the Content Set binding without creating the  
dependent controller, so I don't know if that would work in some way  
by using just the "main account" controller I have


Best Regards,
Dan
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: [iphone] Libxml2 with a wrapper to NSArray

2009-12-03 Thread Sean McBride
On 12/3/09 6:40 PM, Philip Vallone said:

>However, I am not sure how to call this :
>
>NSArray *PerformHTMLXPathQuery(NSData *document, NSString *query)
>
>
>Here is my code:
>
>   NSString *filePath = [[NSBundle mainBundle] pathForResource:@"manifest"
>ofType:@"xml"];
>   NSData* xmlData = [filePath dataUsingEncoding:NSUTF8StringEncoding];
>   NSArray *resultNodes = [NSArray array]; 
>   resultNodes = PerformXPathQuery(xmlData, "//mynode");
>
>Here is my error:
>
>warning: implicit declaration of function 'PerformXPathQuery'

"//mynode" is not an NSString.  You want @"//mynode".  The @ makes it an
NSString.

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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


[iphone] Libxml2 with a wrapper to NSArray

2009-12-03 Thread Philip Vallone

Hi,

I hope I am posting this to the write list. 

I am trying to parse an xml file with libxml2 and xpath. I am still learning 
objective c and Cocoa. I found this very useful wrapper for libxml:

http://cocoawithlove.com/2008/10/using-libxml2-for-parsing-and-xpath.html

However, I am not sure how to call this :

NSArray *PerformHTMLXPathQuery(NSData *document, NSString *query)


Here is my code:

NSString *filePath = [[NSBundle mainBundle] pathForResource:@"manifest" 
ofType:@"xml"]; 
NSData* xmlData = [filePath dataUsingEncoding:NSUTF8StringEncoding];
NSArray *resultNodes = [NSArray array]; 
resultNodes = PerformXPathQuery(xmlData, "//mynode");

Here is my error:

warning: implicit declaration of function 'PerformXPathQuery'


Thanks for the help.

Phil


___

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


NSSlider's setAltIncrementValue: broken?

2009-12-03 Thread Sean McBride
Hi all,

The docs for NSSlider's setAltIncrementValue: say "Sets the amount by
which the receiver modifies its value when the knob is Option-dragged".
It does not.

Anyone using this successfully?

This was asked 4 years ago, almost to the day.  No replies:


I've noticed that since that post, IB no longer allows setting the value.

My goal is to have a slider that can set values with some precision
regardless of the on-screen size of the slider.  setAltIncrementValue
would have helped (though it's not a very discoverable UI).

Thanks,

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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: MacResearch Tutorial on beginning a Cocoa/iPhone app.

2009-12-03 Thread Brian Dittmer
If you need graphing/charting on either iPhone or OSX then checkout
CorePlot, it's a rather impressive and mature library for generating
graphs and charts.

http://code.google.com/p/core-plot/

Cheers,
Brian


On Thu, Dec 3, 2009 at 4:38 PM, Karolis Ramanauskas  wrote:
> Agreed, no network connection no graph! ;) What if I need to update my graph
> live?
>
> On Thu, Dec 3, 2009 at 2:48 PM, Philip Vallone
> wrote:
>
>> This post is very misleading. The tutorial is called "Using VVI for
>> Graphing on iPhone" however there is no graphing. The graph is pulled in
>> from the website and viewed through the UIWebView.
>>
>> Just my thoughts...
>>
>>
>>
>>
>> On Dec 3, 2009, at 12:09 PM, lbland wrote:
>>
>> > hi-
>> >
>> > Occasionally I see a trouble-getting-started post on this list. There is
>> a great Cocoa/Xcode/iPhone tutorial on MacResearch:
>> >
>> > Using VVI for Graphing on iPhone
>> > http://www.macresearch.org/using-vvi-graphing-iphone
>> >
>> > Explaining in precise detail how to make a simple iPhone app. I may be a
>> bit partial to the writing style though :-)
>> >
>> > thanks!-
>> >
>> > -lance
>> >
>> >
>> > ___
>> >
>> > 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/philip.vallone%40verizon.net
>> >
>> > This email sent to philip.vall...@verizon.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/karolisr%40gmail.com
>>
>> This email sent to karol...@gmail.com
>>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/brian.t.dittmer%40gmail.com
>
> This email sent to brian.t.ditt...@gmail.com
>
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: MacResearch Tutorial on beginning a Cocoa/iPhone app.

2009-12-03 Thread Karolis Ramanauskas
Agreed, no network connection no graph! ;) What if I need to update my graph
live?

On Thu, Dec 3, 2009 at 2:48 PM, Philip Vallone
wrote:

> This post is very misleading. The tutorial is called "Using VVI for
> Graphing on iPhone" however there is no graphing. The graph is pulled in
> from the website and viewed through the UIWebView.
>
> Just my thoughts...
>
>
>
>
> On Dec 3, 2009, at 12:09 PM, lbland wrote:
>
> > hi-
> >
> > Occasionally I see a trouble-getting-started post on this list. There is
> a great Cocoa/Xcode/iPhone tutorial on MacResearch:
> >
> > Using VVI for Graphing on iPhone
> > http://www.macresearch.org/using-vvi-graphing-iphone
> >
> > Explaining in precise detail how to make a simple iPhone app. I may be a
> bit partial to the writing style though :-)
> >
> > thanks!-
> >
> > -lance
> >
> >
> > ___
> >
> > 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/philip.vallone%40verizon.net
> >
> > This email sent to philip.vall...@verizon.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/karolisr%40gmail.com
>
> This email sent to karol...@gmail.com
>
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Making NSFetchedResultsController register changes to the entity's relationship, not just attributes

2009-12-03 Thread Karolis Ramanauskas
Good day,

I have an NSFetchedResultsController set up with an entity, ENTITY. ENTITY
has a to-one relationship called REL. Now, in my table view, cells display
some data that are the attributes of ENTITY and some data that are the
attributes of REL. When I change the values of the attributes of ENTITY,
everything works great, e.g., the delegate receives a notification and
controller:didChangeObject:... method fires. However when I change the
attributes of ITEM, the change notification does not fire. I do realize this
is not necessarily a bug since I did not update the ENTITY's attributes,
however my table view cells now appear out of sync. To overcome this
problem, I do this whenever I update REL's attributes:

[self.ENTITY willChangeValueForKey:@"REL"];
[self.ENTITY didChangeValueForKey:@"REL"];

This causes the change notification to fire. I was wondering, if there is a
better way to make NSFetchedResultsController know that it should update in
this case.

Thank you very much,
Karolis R.
___

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


Making NSFetchedResultsController register changes to the entity's relationship, not just attributes

2009-12-03 Thread Karolis Ramanauskas
Good day,

I have an NSFetchedResultsController set up with an entity, ENTITY. ENTITY
has a to-one relationship called REL. Now, in my table view, cells display
some data that are the attributes of ENTITY and some data that are the
attributes of REL. When I change the values of the attributes of ENTITY,
everything works great, e.g., the delegate receives a notification and
controller:didChangeObject:...
method fires. However when I change the attributes of ITEM, the change
notification does not fire. I do realize this is not necessarily a bug since
I did not update the ENTITY's attributes, however my table view cells now
appear out of sync. To overcome this problem, I do this whenever I update
REL's attributes:

[self.ENTITY willChangeValueForKey:@"REL"];

[self.ENTITY didChangeValueForKey:@"REL"];

This causes the change notification to fire. I was wondering, if there is a
better way to make NSFetchedResultsController know that it should update in
this case.

Thank you very much,
Karolis R.
___

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: Core Data: insertNewObjectForEntityForName doesn't return my custom subclass during migration

2009-12-03 Thread Melissa J. Turner

On Dec 3, 2009, at 09:08, Sean McBride wrote:

> Hi all,
> 
> The docs for NSEntityDescription say
> "initWithEntity:insertIntoManagedObjectContext: returns an instance of
> the appropriate class for the entity".
> 
> This seems to be mostly true.  Yet when I do:
> 
> [NSEntityDescription insertNewObjectForEntityForName:@"FooBar"
> inManagedObjectContext:moc];  
> 
> 
> it's giving me an NSManagedObject not an RRFooBar.  I've confirmed that
> by sending the class method and also sending message that only my
> subclass responds to.  I've confirmed that my xcdatamodel has specified
> the right subclass (RRFooBar).
> 
> This happens only during migration (the same code gives RRFooBar if
> migration is not involved).  Specifically during this partial backtrace:
> 
> ...
> -[NSEntityMigrationPolicy createRelat
> ionshipsForDestinationInstance:entityMapping:manager:error:]
> -[NSMigrationManager(InternalMethods) _doSecondPassForMapping:error:]
> -[NSMigrationManager migrateStoreFrom
> URL:type:options:withMappingModel:toD
> estinationURL:destinationType:destinationOptions:error:]
> ...
> 
> Is this expected?
> 

This is expected. 

During migration, Core Data uses NSManagedObject instead of custom subclasses 
to contain object data. This is to avoid triggering application logic and/or 
validation rules in the classes during what should be a pure data 
transformation step.  Any logic you need during migration should be encoded 
into the mapping model.

+Melissa

___

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: NSSpellChecker and checkSpellingOfString problems

2009-12-03 Thread Keith Blount
Hi,

Thanks for the reply. That's a good suggestion, but unfortunately it doesn't 
work. I tried:

[spellChecker checkSpellingOfString:[NSString stringWithFormat:@" %@ ", 
theWord] startAT:0]

and that returned NSNotFound too. Very strange. "accade" is clearly marked as a 
misspelling but for some reason -checkSpellingOfString: thinks it's fine; I can 
only think that Apple are using some other method internally to check 
spellings, but that seems odd.

Thanks again and all the best,
Keith

--- On Thu, 12/3/09, kvic...@pobox.com  wrote:

> From: kvic...@pobox.com 
> Subject: re: NSSpellChecker and checkSpellingOfString problems
> To: cocoa-dev@lists.apple.com, keithblo...@yahoo.com
> Date: Thursday, December 3, 2009, 7:40 PM
> i don't know if this is your problem
> or not, but i don't see the red underline when i "accade"
> until i type a word delimeter (e.g. a space or comma) after
> it. do u perhaps need to make sure the string u r passing to
> the spell checker has appropriate beginning and ending
> delimeters?
> 
> ken
> 
> 
> At 11:22 AM -0800 12/3/09, keithblo...@yahoo.com
> wrote:
> > Try typing "accade" into TextEdit (I'm assuming
> English as the language here, of course). It is underlined
> in red, and ctrl-clicking on it brings up a list of
> suggestions. So the system recognises it as a misspelling, a
> word that it doesn't know.
> 


  
___

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: MacResearch Tutorial on beginning a Cocoa/iPhone app.

2009-12-03 Thread Philip Vallone
This post is very misleading. The tutorial is called "Using VVI for Graphing on 
iPhone" however there is no graphing. The graph is pulled in from the website 
and viewed through the UIWebView.

Just my thoughts...




On Dec 3, 2009, at 12:09 PM, lbland wrote:

> hi-
> 
> Occasionally I see a trouble-getting-started post on this list. There is a 
> great Cocoa/Xcode/iPhone tutorial on MacResearch:
> 
> Using VVI for Graphing on iPhone
> http://www.macresearch.org/using-vvi-graphing-iphone
> 
> Explaining in precise detail how to make a simple iPhone app. I may be a bit 
> partial to the writing style though :-)
> 
> thanks!-
> 
> -lance
> 
> 
> ___
> 
> 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/philip.vallone%40verizon.net
> 
> This email sent to philip.vall...@verizon.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: Question about aliasing (analog clock hands)

2009-12-03 Thread Eric E. Dolecki
My rootLayer was using the view's bounds, etc. so this works now:

rootLayer = [CALayer layer];

rootLayer.frame = CGRectMake(240, 160, 240, 160) ;*//self.view.bounds;*

[self.view.layer addSublayer:rootLayer];


boxPath = CGPathCreateMutable();

CGPoint center = CGPointMake(0,0);*//self.view.center;*

*
*

*...*

*
*

**
*

CABasicAnimation *rotationAnimation;

rotationAnimation =[CABasicAnimation animationWithKeyPath:@
"transform.rotation.z"];

[rotationAnimation setFromValue:DegreesToNumber(0)];

[rotationAnimation setToValue:DegreesToNumber(360)];

[rotationAnimation setDuration:2.0f];

[rotationAnimation setRepeatCount:1];

[shapeLayer addAnimation:rotationAnimation forKey:@"rotate"];
*


This stuff is awesome - it's good that my PNG solution didn't look very good
which led me down this path of which I am learning now.

Thanks,
Eric



On Thu, Dec 3, 2009 at 3:40 PM, David Duncan  wrote:

> On Dec 3, 2009, at 12:34 PM, Eric E. Dolecki wrote:
>
> > [shapeLayer setAnchorPoint:CGPointMake(240, 160)];
> >
> > It just rotates around the top left corner (meaning it comes into and out
> of
> > view)... I am looking to simply spin the shape where it sits from it's
> > center.
>
> The anchorPoint is in a unit coordinate system. When you specify a point
> outside of that system, the results are undefined.
>
> Specify something between 0,0 and 1,1.
> --
> David Duncan
> Apple DTS Animation and Printing
>
>


-- 
http://ericd.net
Interactive design and development
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: Question about aliasing (analog clock hands)

2009-12-03 Thread David Duncan
On Dec 3, 2009, at 12:34 PM, Eric E. Dolecki wrote:

> [shapeLayer setAnchorPoint:CGPointMake(240, 160)];
> 
> It just rotates around the top left corner (meaning it comes into and out of
> view)... I am looking to simply spin the shape where it sits from it's
> center.

The anchorPoint is in a unit coordinate system. When you specify a point 
outside of that system, the results are undefined.

Specify something between 0,0 and 1,1.
--
David Duncan
Apple DTS Animation and Printing

___

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: Question about aliasing (analog clock hands)

2009-12-03 Thread Eric E. Dolecki
Will do. One question - when I am rotating around z - it's using the top
left of the shapeLayer as the anchor point. Trying to set it differently
isn't changing the anchor point...

CABasicAnimation *rotationAnimation;

rotationAnimation =[CABasicAnimation animationWithKeyPath:@
"transform.rotation.z"];

[rotationAnimation setFromValue:DegreesToNumber(0)];

[rotationAnimation setToValue:DegreesToNumber(360)];

[rotationAnimation setDuration:2.0f];

[rotationAnimation setRepeatCount:1];

[shapeLayer setAnchorPoint:CGPointMake(240, 160)];

[shapeLayer addAnimation:rotationAnimation forKey:@"rotate"];

It just rotates around the top left corner (meaning it comes into and out of
view)... I am looking to simply spin the shape where it sits from it's
center.



On Thu, Dec 3, 2009 at 3:17 PM, Kyle Sluder  wrote:

> On Thu, Dec 3, 2009 at 12:07 PM, Eric E. Dolecki 
> wrote:
> > If I use CAShapeLayer, can I use CGAffineTransform on it? I need to pour
> > through the docs now I guess.
>
> Yes, please brush up on Core Animation.  You can apply arbitrary
> transformations to a layer, or you can use the rotation/position
> properties of the layer itself and let CA take care of all the nested
> coordinate systems for you.  Since the iPhone uses layers for pretty
> much all drawing, you're going to need to get a handle on Core
> Animation sooner rather than later.
>
> --Kyle Sluder
>



-- 
http://ericd.net
Interactive design and development
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


Re: Question about aliasing (analog clock hands)

2009-12-03 Thread Kyle Sluder
On Thu, Dec 3, 2009 at 12:07 PM, Eric E. Dolecki  wrote:
> If I use CAShapeLayer, can I use CGAffineTransform on it? I need to pour
> through the docs now I guess.

Yes, please brush up on Core Animation.  You can apply arbitrary
transformations to a layer, or you can use the rotation/position
properties of the layer itself and let CA take care of all the nested
coordinate systems for you.  Since the iPhone uses layers for pretty
much all drawing, you're going to need to get a handle on Core
Animation sooner rather than later.

--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: Question about aliasing (analog clock hands)

2009-12-03 Thread Eric E. Dolecki
Cool - thanks for that heads up.

If I use CAShapeLayer, can I use CGAffineTransform on it? I need to pour
through the docs now I guess.



On Thu, Dec 3, 2009 at 2:40 PM, Kyle Sluder  wrote:

> On Thu, Dec 3, 2009 at 11:24 AM, Eric E. Dolecki 
> wrote:
> > I really don't know if this is the correct approach - should I be using
> some
> > more complex way of displaying and rotating hands on an analog clock?
>
> Yes, use vector-based drawing with CAShapeLayer.
>
> --Kyle Sluder
>



-- 
http://ericd.net
Interactive design and development
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

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

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


re: NSSpellChecker and checkSpellingOfString problems

2009-12-03 Thread kvic...@pobox.com
i don't know if this is your problem or not, but i don't see the red 
underline when i "accade" until i type a word delimeter (e.g. a space 
or comma) after it. do u perhaps need to make sure the string u r 
passing to the spell checker has appropriate beginning and ending 
delimeters?


ken


At 11:22 AM -0800 12/3/09, keithblo...@yahoo.com wrote:
Try typing "accade" into TextEdit (I'm assuming English as the 
language here, of course). It is underlined in red, and 
ctrl-clicking on it brings up a list of suggestions. So the system 
recognises it as a misspelling, a word that it doesn't know.

___

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: Question about aliasing (analog clock hands)

2009-12-03 Thread Kyle Sluder
On Thu, Dec 3, 2009 at 11:24 AM, Eric E. Dolecki  wrote:
> I really don't know if this is the correct approach - should I be using some
> more complex way of displaying and rotating hands on an analog clock?

Yes, use vector-based drawing with CAShapeLayer.

--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: Does initWithCoder re-create observers made with addObserver?

2009-12-03 Thread Quincey Morris
On Dec 3, 2009, at 09:21, David Hirsch wrote:

> I'm trying to track down a bug.  The subject says it all:  If I've created an 
> observer programatically, then saved both the observed and observer objects 
> with encodeObject:forKey:, will decodeObjectForKey recreate that observer for 
> me, or do I need to do it myself?

No, you have to do it yourself.

Incidentally, I assume you're talking about the observation -- the term 
"observer" generally means the observing object. *That* object gets recreated 
by unarchiving, of course, but the observation (set up with 
'addObserver:forKeyPath"...') isn't persistent.


___

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


Question about aliasing (analog clock hands)

2009-12-03 Thread Eric E. Dolecki
I have 2 UIImageView, each containing a PNG (about 2 pixels wide for the
images). When I rotate these around, the edges of the PNGs look terrible and
I was trying to get MORE anti-aliasing to happen to smooth out the jaggies.


hourHand.layer.anchorPoint   = CGPointMake( 0.0, 0.9 );

*//TOTAL GUESS, no idea, trying to get one hand to look good:*

hourHand.layer.edgeAntialiasingMask = 0xf;


NSCalendar *gregorian = [[NSCalendar alloc]
initWithCalendarIdentifier:NSGregorianCalendar];

unsigned unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit |
NSDayCalendarUnit | NSHourCalendarUnit| NSMinuteCalendarUnit
|NSSecondCalendarUnit;

NSDate *date = [NSDate date];

NSDateComponents *comps = [gregorian components:unitFlags fromDate:date];

int h = [comps hour];

int m = [comps minute];

int s = [comps second];

CGAffineTransform cgaRotateHr =
CGAffineTransformMakeRotation(DEGREES_TO_RADIANS( h*30+m/2 ));

CGAffineTransform cgaRotateMin =
CGAffineTransformMakeRotation(DEGREES_TO_RADIANS( m*6+s/10 ));

[hourHand setTransform:cgaRotateHr];

[minuteHand setTransform:cgaRotateMin];;

I have seen plenty of analog clocks on the iPhone that look great - since
I'm pretty new to dev on the platform I'm wondering if I am missing a simple
one-liner someplace.




I really don't know if this is the correct approach - should I be using some
more complex way of displaying and rotating hands on an analog clock?


- Eric
___

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: Lan/Airport Notification

2009-12-03 Thread Jens Alfke


On Dec 3, 2009, at 9:02 AM, Stefan Lehrner wrote:

is it possible to get notified when Airport or Lan is available? I  
wonder how I
can be notified by the system whenever my Airport goes online or  
when my

Lan Connection will be established?


SystemConfiguration.framework. Check the documentation in Xcode.
(It's not a Cocoa API, so follow-up should go somewhere like  
macnetworkprog.)


—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: Application crashing on iPod Touch, not on iPhone

2009-12-03 Thread Kyle Sluder
2009/12/3 Sébastien Stormacq :
> Frame 15 is the last line from my code, it calls [NSURL urlWithString] (frame 
> 14)

Then we need to see the code for -loadStreamingURL, and you need to
make sure that the argument to -URLWithString: is a valid NSString
instance.  That means using the debugger.

--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: Application crashing on iPod Touch, not on iPhone

2009-12-03 Thread Jens Alfke


On Dec 3, 2009, at 11:14 AM, Sébastien Stormacq wrote:


I totally agree with you
Here is my stack trace

Frame 15 is the last line from my code, it calls [NSURL  
urlWithString] (frame 14)


9   libobjc.A.dylib   	0x6e54 objc_exception_throw +  
104
10  CoreFoundation	0x00026b2c +[NSException  
raise:format:arguments:] + 76
11  CoreFoundation	0x00026acc +[NSException  
raise:format:] + 24
12  Foundation	0x0005a2d6 -[NSURL  
initWithString:relativeToURL:] + 246
13  Foundation	0x0005a154 +[NSURL  
URLWithString:relativeToURL:] + 28
14  Foundation	0x0005a12a +[NSURL  
URLWithString:] + 10
15  Maxi80	0x45a4 -[Maxi80ViewController  
loadStreamingURL]


You're passing nil to URLWithString:, due to some underlying bug in  
your program. That is the only case where that method will throw an  
exception.


You're also crashing because you haven't set up an exception handler  
on this thread. Any time you implement an NSThread entry point you  
should wrap the outer method in an @try{ ... }...@catch(...) { } so that  
exceptions don't go uncaught and crash your app. (The handler should  
notify the user of the exception -- on the main thread! -- and offer  
to quit the app.)


—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: image not found

2009-12-03 Thread Kyle Sluder
On Thu, Dec 3, 2009 at 11:19 AM, Torsten Curdt  wrote:
> But that means the difference should not really matter here then.

You are correct.  The problem here is not because of using
@executable_path instead of @loader_path.  The problem is because the
binary was moved outside of Contents/MacOS where it belongs.

--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: Reboot? Slow First Run

2009-12-03 Thread Jens Alfke


On Dec 3, 2009, at 9:55 AM, gMail.com wrote:

I can't really know whether I can modify that schema and unify those  
10,000
files in one. I will ask the supervisor. Those files contain UT8  
text and

other data like images...


You don't have to modify any schema. Just build an index file, e.g. as  
a sqlite database, and use that as much as possible for speed- 
intensive tasks.


(This gets a little more difficult if the 10,000 underlying files can  
be changed without warning; but I believe that testing the mod dates  
of the files will be a lot faster than having to read their contents.  
After launch, you can use FSEvents to detect you need to rescan.)


As far as the speed at listing a folder content, I mean that despite  
to the
various improvements in the technology, I can't yet see the speed I  
expect

from a machine today when I open a folder.


As Bill said: "the technology" involved is hard disks. These have  
gotten faster in the past 20 years, but the worst-case aspect (the  
seek time) has only increased by something like a factor of *two*.  
Whereas everything non-mechanical has sped up by a million or more.



However, since the old disk technology
is still largely used on Mac and this technology is still slow, I  
shouldn't

have designed the Finder that way.


Please don't make naive comments like this; it just makes you look  
foolish. I know we engineers all have a natural tendency to assume any  
problem we haven't personally worked on is trivial, but you really  
have to keep that in check.


You're talking about an extremely involved stack of code going from  
the Finder through CarbonCore, BSD system calls, the HFS+ filesystem  
code, the HFS+ on-disk format, the Darwin unified buffer cache, the  
device drivers for the disks, and finally the firmware on the disk  
controllers (yes this makes a difference.) All of which has been  
obsessively pounded on for years to make it work faster.


Saying out of nowhere that you could design this better is absurd.  
Check out the Darwin sources, get Singh's "Mac OS X Internals", look  
up some docs on filesystem design and the characteristics of hard  
disks, and study all this for a few months before you decide you're  
smarter than the people who wrote that stuff.


(Yes, this is a pet peeve of mine. I have not worked on the Finder or  
filesystem, but if you want to tell me how trivial it is to parse RSS  
feeds or write an XMPP client, then give me a whiteboard and an hour  
and I can dissuade you of that.)


—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: image not found

2009-12-03 Thread Torsten Curdt
On Thu, Dec 3, 2009 at 18:15, Nick Zitzmann  wrote:
>
> On Dec 3, 2009, at 3:33 AM, Torsten Curdt wrote:
>
>> The Sparkle frameworks uses @loader_path while the FeedbackReporter
>> uses @executable_path instead.
>>
>> What's the difference?
>
> @executable_path is a macro pointing to the path of the executable binary, 
> and nothing else. @loader_path is a macro pointing to whatever binary has 
> instructions to load the library, which can be the application, or a 
> library/framework, or a loadable bundle. @loader_path is more powerful and 
> allows you to easily embed frameworks inside loadable bundles, which is 
> impossible to do with @executable_path unless the framework in question is 
> bundled with the executable.

I see. Thanks!

But that means the difference should not really matter here then.
I would think...

cheers
--
Torsten
___

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: Application crashing on iPod Touch, not on iPhone

2009-12-03 Thread Sébastien Stormacq
I totally agree with you 
Here is my stack trace

Frame 15 is the last line from my code, it calls [NSURL urlWithString] (frame 
14)

0   libSystem.B.dylib   0x0008e7e0 __semwait_signal_nocancel + 
24
1   libSystem.B.dylib   0x0008e128 nanosleep$NOCANCEL + 100
2   libSystem.B.dylib   0x0007d200 usleep$NOCANCEL + 36
3   libSystem.B.dylib   0x000a7e68 abort + 40
4   libstdc++.6.dylib   0x00066390 
__gnu_cxx::__verbose_terminate_handler() + 588
5   libobjc.A.dylib 0x8898 _objc_terminate + 160
6   libstdc++.6.dylib   0x00063a84 __cxxabiv1::__terminate(void 
(*)()) + 76
7   libstdc++.6.dylib   0x00063afc std::terminate() + 16
8   libstdc++.6.dylib   0x00063c24 __cxa_throw + 100
9   libobjc.A.dylib 0x6e54 objc_exception_throw + 104
10  CoreFoundation  0x00026b2c +[NSException 
raise:format:arguments:] + 76
11  CoreFoundation  0x00026acc +[NSException raise:format:] 
+ 24
12  Foundation  0x0005a2d6 -[NSURL 
initWithString:relativeToURL:] + 246
13  Foundation  0x0005a154 +[NSURL 
URLWithString:relativeToURL:] + 28
14  Foundation  0x0005a12a +[NSURL URLWithString:] + 10
15  Maxi80  0x45a4 -[Maxi80ViewController 
loadStreamingURL] (Maxi80ViewController.m:140)
16  Foundation  0x00053ac6 -[NSThread main] + 42
17  Foundation  0x1d0e __NSThread__main__ + 852
18  libSystem.B.dylib   0x0002b7b0 _pthread_body + 20

--Seb




On 03 Dec 2009, at 17:59, Matt Neuburg wrote:

> On Thu, 03 Dec 2009 13:37:32 +0100, S?bastien Stormacq 
> said:
>> For your curiosity : [NSURL urlWithString] is the culprit : it throws a
> NSException on the Touch when there is no network, not on the iPhone ;-)
> 
> That's hard to believe. To transform a string into a URL should have no
> dependency on whether there's a network. The dependency on the network
> should come later, like when you actually try to download something! And
> Apple's own examples do no exception checking around [NSURL urlWithString].
> So if you're certain this is the problem, I would suggest filing a
> bugreporter bug. 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: totally baffled by "odoc" apple event failing on launch

2009-12-03 Thread David M. Cotter
>>> there is a component we must load (a plugin) that is outside of our control

>> that runs an event loop, before we have our NSApp initialized (therefore it 
>> is
>> unable to handle the :openDocuments call)

> So, just to clarify - the "odoc" apple event is NOT failing on launch. It's
> just that you are getting it sooner (or later?) than you are hoping for it.
> Is that right? Thx - m.

that is correct.  it is being received by a plugin that runs an event loop 
while it's loading.  but the plugin drops it on the floor.

___

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 Continuous Feedback and Duration For UISlider:setValue:animated

2009-12-03 Thread Chunk 1978
i would like to slow down the setValue:animated animation duration
from it's default (which i assume is 0.25f) to about 2 seconds.
additionally, i need to have continuous feedback of the slider's value
while it is animating.  how can this be accomplished?  i assume i'll
have to write my own method to achieve this behavior, but i'm a bit
fuzzy on the logic behind this.  any guides or suggestions?
___

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: Reboot? Slow First Run

2009-12-03 Thread gMail.com
Thank you Bill,
I can't really know whether I can modify that schema and unify those 10,000
files in one. I will ask the supervisor. Those files contain UT8 text and
other data like images... I know spotlight is fast enough, but here we need
to read the content of the files and process it.

As far as the speed at listing a folder content, I mean that despite to the
various improvements in the technology, I can't yet see the speed I expect
from a machine today when I open a folder. I can quite play a 3D game at
1200 fps with shaders and such (thanks to the GPU) but I have to wait
minutes or hours when I need to copy some GB between 2 disks. I know SSD is
much faster than old disk technology. However, since the old disk technology
is still largely used on Mac and this technology is still slow, I shouldn't
have designed the Finder that way. The machine looks unbalanced: you go like
a rocket when playing a game then you go like a turtle when displaying a
simple list of files in the Finder. It's just a personal opinion. Nothing so
damn important anyway.

--
Leonardo

> Da: Bill Bumgarner 
> Data: Thu, 03 Dec 2009 08:30:37 -0800
> A: "gMail.com" 
> Cc: Shawn Erickson , 
> Oggetto: Re: Reboot? Slow First Run
> 
> 
> On Dec 3, 2009, at 8:10 AM, gMail.com wrote:
> 
>> Thanks. I supposed that I was loading from the cache. It's a pity.
>> It was too nice to load 10,000 files x 4KB each, in only 1.2 secs.
>> Maybe one day, when I will be not longer on this planet :-)
>> Just to mention I run MacOSX 10.6.2 and I build against 10.5 (32 bit).
> 
> Well 10,000 x 4KB files sounds like an excellent design for the benefit of
> spotlight [which needs individual files for each data item it indexes] but is
> a very poor design for reading all that data at once.  Prior to the disk cache
> being warmed up, reading those 10,000 files requires a boatload of I/O of the
> worst kind in that the data is unlikely to be contiguous.
> 
> If you want to speed up the initial read, cache the contents of the 10,000
> files into a single file.  Even those 10,000 files laid out contiguously and
> memory mapped is going to be faster, but you can do much better by effectively
> 'compiling' the data into some form that is much more convenient to read.
> 
> This is *exactly* what Address Book, Mail and other applications do.  In the
> case of AB and Mail, they are using CoreData and SQLite directly respectively
> to store the data into a single file.  Perhaps CoreData would fit your needs
> as well (you haven't said what the 10,000 files contain).
> 
>> Anyway I would like to say a thing that I wanted to say for years.
>> Despite to the faster and faster processors and machines, the better and
>> better OSs... still today with a Core 2 Duo Intel 2.4GHz and MacOS X 10.6.2
>> at 64 bits (which is considered mainly as an improvement of the stability
>> and speed), when I open my /Applications folder, I have to wait for 3, 4 or
>> 5 seconds to see the contents of the folder. I recall that my Mac II with
>> the System Mac 1.0 (in 1988) was faster. Think over ;-)
> 
> Yes, but the one thing that *hasn't* changed in all those years is that hard
> drives have *not* gotten ~150x faster [CPU speed] and zillions of times faster
> on the memory speed front.
> 
> Hard drives are slow, slow, slow.   Yet, the metadata being read to -- say --
> display that folder full o' applications is considerably larger.  Heck;  The
> recommended icon size on Mac OS X Snow Leopard -- 512x512x4 -- is *larger than
> the total resolution of the original Macintosh's screen*.   Even more amusing;
> a modern icon fully decompressed will take up 1MB of RAM -- it wasn't until
> the Mac II that a Macintosh had enough memory to even load such a beast!
> 
> And that is just the icons.  You also have the full blown localization support
> and permissions metadata, too.  The first read is several orders of magnitude
> more data, all spread around the disk, than that Mac II and from a device--
> the hard drive-- that is *not* several orders of magnitude.
> 
> Now, if you want an eye opener, test your 10,000 x 4KB file read w/cold disk
> cache on a decent SSD drive...
> 
> b.bum
> 


___

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: Debugging stack traces

2009-12-03 Thread Sean McBride
On 12/3/09 11:55 AM, Graham Cox said:

>When I get a stack trace in a crash report, as exampled below, can I use
>the offsets (+71, +50) to locate the relevant line in the source code?
>What do these numbers actually mean?
>
>1   com.apptree.drawkit0x001c7bb9 -[DKDrawableObject
>encodeWithCoder:] + 71
>2   com.mapdiva.ortelius   0x0003c81d -[DKOSymbol
>encodeWithCoder:] + 50

In case you haven't see it, this has good info too:


And this tool is helpful:


--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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: Reboot? Slow First Run

2009-12-03 Thread Greg Guerin

Shawn Erickson wrote:


The OS maintains a cache of data in RAM as much as it can while
running. This "universal buffer cache" caches pages of data from
loaded files, applications, etc.



With Xcode dev tools installed, a 'purge' command is added.  It will  
purge this cache, making it easier to test.


If Activity Monitor.app is running, you'll see the change in its  
System Memory pane.


  -- GG

___

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: Lan/Airport Notification

2009-12-03 Thread Nick Zitzmann

On Dec 3, 2009, at 10:02 AM, Stefan Lehrner wrote:

> is it possible to get notified when Airport or Lan is available?

It's possible.

> I wonder how I 
> can be notified by the system whenever my Airport goes online or when my
> Lan Connection will be established?

There are IOKit notifications for this. Try searching around or asking on the 
darwin-dev list, since IOKit is out of the scope of this list.

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


Text insertion point not blinking

2009-12-03 Thread Gideon King
Hi all

I have a text view which has the drawsBackground: set to NO, and now the 
insertion point is not blinking - it's just a solid line. If I turn the 
drawsBackground: on, it does blink as expected.

Any suggestions as to why this could be happening?

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


Does initWithCoder re-create observers made with addObserver?

2009-12-03 Thread David Hirsch
I'm trying to track down a bug.  The subject says it all:  If I've  
created an observer programatically, then saved both the observed and  
observer objects with encodeObject:forKey:, will decodeObjectForKey  
recreate that observer for me, or do I need to do it myself?

___

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: image not found

2009-12-03 Thread Nick Zitzmann

On Dec 3, 2009, at 3:33 AM, Torsten Curdt wrote:

> The Sparkle frameworks uses @loader_path while the FeedbackReporter
> uses @executable_path instead.
> 
> What's the difference?

@executable_path is a macro pointing to the path of the executable binary, and 
nothing else. @loader_path is a macro pointing to whatever binary has 
instructions to load the library, which can be the application, or a 
library/framework, or a loadable bundle. @loader_path is more powerful and 
allows you to easily embed frameworks inside loadable bundles, which is 
impossible to do with @executable_path unless the framework in question is 
bundled with the executable.

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: NSSpellChecker and checkSpellingOfString problems

2009-12-03 Thread Knut Lorenzen

Am 03.12.2009 um 17:55 schrieb Keith Blount:

> I have an NSTextView subclass that provides a custom contextual menu by 
> overriding -menuForEvent:. Because I override this, I have to provide any 
> menu items I want to retain from the original menu myself.

Can't you simply use something like
NSMenu *theMenu = [super menuForEvent:theEvent];
early in your code and let the system do the heavy lifting?

Cheers,

Knut





___

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


MacResearch Tutorial on beginning a Cocoa/iPhone app.

2009-12-03 Thread lbland
hi-

Occasionally I see a trouble-getting-started post on this list. There is a 
great Cocoa/Xcode/iPhone tutorial on MacResearch:

Using VVI for Graphing on iPhone
http://www.macresearch.org/using-vvi-graphing-iphone

Explaining in precise detail how to make a simple iPhone app. I may be a bit 
partial to the writing style though :-)

thanks!-

-lance


___

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: insertNewObjectForEntityForName doesn't return my custom subclass during migration

2009-12-03 Thread Sean McBride
Hi all,

The docs for NSEntityDescription say
"initWithEntity:insertIntoManagedObjectContext: returns an instance of
the appropriate class for the entity".

This seems to be mostly true.  Yet when I do:

[NSEntityDescription insertNewObjectForEntityForName:@"FooBar"
inManagedObjectContext:moc];


it's giving me an NSManagedObject not an RRFooBar.  I've confirmed that
by sending the class method and also sending message that only my
subclass responds to.  I've confirmed that my xcdatamodel has specified
the right subclass (RRFooBar).

This happens only during migration (the same code gives RRFooBar if
migration is not involved).  Specifically during this partial backtrace:

...
-[NSEntityMigrationPolicy createRelat
ionshipsForDestinationInstance:entityMapping:manager:error:]
-[NSMigrationManager(InternalMethods) _doSecondPassForMapping:error:]
-[NSMigrationManager migrateStoreFrom
URL:type:options:withMappingModel:toD
estinationURL:destinationType:destinationOptions:error:]
...

Is this expected?

Thanks,

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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


Lan/Airport Notification

2009-12-03 Thread Stefan Lehrner
Hi,

is it possible to get notified when Airport or Lan is available? I wonder how I 
can be notified by the system whenever my Airport goes online or when my
Lan Connection will be established?

Thanks for any hints and tipps...

BR,

Stefan
___

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: Application crashing on iPod Touch, not on iPhone

2009-12-03 Thread Matt Neuburg
On Thu, 03 Dec 2009 13:37:32 +0100, S?bastien Stormacq 
said:
>For your curiosity : [NSURL urlWithString] is the culprit : it throws a
NSException on the Touch when there is no network, not on the iPhone ;-)

That's hard to believe. To transform a string into a URL should have no
dependency on whether there's a network. The dependency on the network
should come later, like when you actually try to download something! And
Apple's own examples do no exception checking around [NSURL urlWithString].
So if you're certain this is the problem, I would suggest filing a
bugreporter bug. 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


NSSpellChecker and checkSpellingOfString problems

2009-12-03 Thread Keith Blount
Hello,

I have an NSTextView subclass that provides a custom contextual menu by 
overriding -menuForEvent:. Because I override this, I have to provide any menu 
items I want to retain from the original menu myself. Mostly, that's not a 
problem, but I want to keep the spell checking options at the top of the menu 
as well. I thought I had this covered. This is what I'm doing:


// Is there a selection?
if (selRange.length > 0 && selRange.location < [text length])
{
// If so, check to see if the selected range constitutes a misspelled 
word.
NSSpellChecker *spellChecker = [NSSpellChecker sharedSpellChecker];
NSRange misspelledRange = [spellChecker checkSpellingOfString:[[text 
string] substringWithRange:selRange] startingAt:0];

// Detected misspelled word?
if (misspelledRange.length == selRange.length)
{
// Get suggestions.
NSArray *suggestions = [spellChecker guessesForWord:[[text 
string] substringWithRange:selRange]];

// Are there any suggestions?
if ([suggestions count] > 0)
{
// If so, add them to the menu with an appropriate 
action.
}
else
{
// Otherwise insert the "No Guesses Found" item.
}
}

I thought all of this was working fine. However, a user has just pointed out to 
me that it doesn't work for all misspellings... Which is very strange. The 
problem comes down to NSSpellChecker's -checkSpellingOfString:. This returns an 
NSNotFound range for certain misspellings.

For instance:

Try typing "accade" into TextEdit (I'm assuming English as the language here, 
of course). It is underlined in red, and ctrl-clicking on it brings up a list 
of suggestions. So the system recognises it as a misspelling, a word that it 
doesn't know.

Now try this in any test app:

NSRange range = [[NSSpellChecker sharedSpellChecker] 
checkSpellingOfString:@"accade" startingAt:0];
NSLog (@"NSStringFromRange(range));

range will be (NSNotFound,0).

I don't understand why, though. Why isn't NSSpellChecker returning this as a 
misspelling? Am I missing something obvious? Is there a better way to insert 
the spelling suggestions at the top of the menu?

Thanks and all the best,
Keith


  
___

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: Finding a word from a character position

2009-12-03 Thread Gideon King
Perfect, thanks Douglas.

> On Dec 3, 2009, at 1:57 AM, Gideon King wrote:
> 
>> I'm trying to emulate the double-click behavior of an NSTextView where it 
>> selects the word under your mouse.
>> 
>> I am able to set the insertion point on a single click using the 
>> characterIndexForPoint: method.
>> 
>> What's the best way to go from there to selecting the word (or space) where 
>> they have clicked?
> 
> NSTextView's method for this is -selectionRangeForProposedRange:granularity:. 
>  If you're doing this without a text view, the underlying implementation is 
> in NSAttributedString's -doubleClickAtIndex:.
> 
> Note that -characterIndexForPoint: is intended for input methods, not for 
> setting the insertion point.  Try -characterIndexForInsertionAtPoint: instead.
> 
> Douglas Davidson
> 

___

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: Finding a word from a character position

2009-12-03 Thread Douglas Davidson


On Dec 3, 2009, at 1:57 AM, Gideon King wrote:

I'm trying to emulate the double-click behavior of an NSTextView  
where it selects the word under your mouse.


I am able to set the insertion point on a single click using the  
characterIndexForPoint: method.


What's the best way to go from there to selecting the word (or  
space) where they have clicked?


NSTextView's method for this is - 
selectionRangeForProposedRange:granularity:.  If you're doing this  
without a text view, the underlying implementation is in  
NSAttributedString's -doubleClickAtIndex:.


Note that -characterIndexForPoint: is intended for input methods, not  
for setting the insertion point.  Try - 
characterIndexForInsertionAtPoint: instead.


Douglas Davidson

___

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: Reboot? Slow First Run

2009-12-03 Thread Bill Bumgarner

On Dec 3, 2009, at 8:10 AM, gMail.com wrote:

> Thanks. I supposed that I was loading from the cache. It's a pity.
> It was too nice to load 10,000 files x 4KB each, in only 1.2 secs.
> Maybe one day, when I will be not longer on this planet :-)
> Just to mention I run MacOSX 10.6.2 and I build against 10.5 (32 bit).

Well 10,000 x 4KB files sounds like an excellent design for the benefit of 
spotlight [which needs individual files for each data item it indexes] but is a 
very poor design for reading all that data at once.  Prior to the disk cache 
being warmed up, reading those 10,000 files requires a boatload of I/O of the 
worst kind in that the data is unlikely to be contiguous.

If you want to speed up the initial read, cache the contents of the 10,000 
files into a single file.  Even those 10,000 files laid out contiguously and 
memory mapped is going to be faster, but you can do much better by effectively 
'compiling' the data into some form that is much more convenient to read.

This is *exactly* what Address Book, Mail and other applications do.  In the 
case of AB and Mail, they are using CoreData and SQLite directly respectively 
to store the data into a single file.  Perhaps CoreData would fit your needs as 
well (you haven't said what the 10,000 files contain).

> Anyway I would like to say a thing that I wanted to say for years.
> Despite to the faster and faster processors and machines, the better and
> better OSs... still today with a Core 2 Duo Intel 2.4GHz and MacOS X 10.6.2
> at 64 bits (which is considered mainly as an improvement of the stability
> and speed), when I open my /Applications folder, I have to wait for 3, 4 or
> 5 seconds to see the contents of the folder. I recall that my Mac II with
> the System Mac 1.0 (in 1988) was faster. Think over ;-)

Yes, but the one thing that *hasn't* changed in all those years is that hard 
drives have *not* gotten ~150x faster [CPU speed] and zillions of times faster 
on the memory speed front.

Hard drives are slow, slow, slow.   Yet, the metadata being read to -- say -- 
display that folder full o' applications is considerably larger.  Heck;  The 
recommended icon size on Mac OS X Snow Leopard -- 512x512x4 -- is *larger than 
the total resolution of the original Macintosh's screen*.   Even more amusing; 
a modern icon fully decompressed will take up 1MB of RAM -- it wasn't until the 
Mac II that a Macintosh had enough memory to even load such a beast!

And that is just the icons.  You also have the full blown localization support 
and permissions metadata, too.  The first read is several orders of magnitude 
more data, all spread around the disk, than that Mac II and from a device-- the 
hard drive-- that is *not* several orders of magnitude.

Now, if you want an eye opener, test your 10,000 x 4KB file read w/cold disk 
cache on a decent SSD drive...

b.bum

___

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: Reboot? Slow First Run

2009-12-03 Thread gMail.com
Thanks. I supposed that I was loading from the cache. It's a pity.
It was too nice to load 10,000 files x 4KB each, in only 1.2 secs.
Maybe one day, when I will be not longer on this planet :-)
Just to mention I run MacOSX 10.6.2 and I build against 10.5 (32 bit).

Anyway I would like to say a thing that I wanted to say for years.
Despite to the faster and faster processors and machines, the better and
better OSs... still today with a Core 2 Duo Intel 2.4GHz and MacOS X 10.6.2
at 64 bits (which is considered mainly as an improvement of the stability
and speed), when I open my /Applications folder, I have to wait for 3, 4 or
5 seconds to see the contents of the folder. I recall that my Mac II with
the System Mac 1.0 (in 1988) was faster. Think over ;-)


Regards
--
Leonardo

> Da: Shawn Erickson 
> Data: Thu, 3 Dec 2009 07:38:11 -0800
> A: "gMail.com" 
> Cc: 
> Oggetto: Re: Reboot? Slow First Run
> 
> On Thu, Dec 3, 2009 at 3:47 AM, gMail.com  wrote:
>> Hi,
>> my app executes a given task in 1.2 seconds, all the time. I can quit the
>> application, relaunch it, run the same task several times and it always
>> takes 1.2 seconds.
>> But if I reboot the machine, I launch the application and run the same task
>> for the first time, it takes 13 seconds! This problem occurs at any reboot.
>> Then if I run the task again it always takes 1.2 seconds.
> 
> The OS maintains a cache of data in RAM as much as it can while
> running. This "universal buffer cache" caches pages of data from
> loaded files, applications, etc.
> 
> So the long initial load time is likely a result of having to load the
> data you need from disk (and possibly bringing online services your
> application needs that haven't yet been needed by other applications).
> The later load times are loading data from cache hence much much
> faster.
> 
> -Shawn


___

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: totally baffled by "odoc" apple event failing on launch

2009-12-03 Thread Matt Neuburg
On Wed, 2 Dec 2009 16:14:30 -0800, "David M. Cotter" 
said:
>there is a component we must load (a plugin) that is outside of our control
that runs an event loop, before we have our NSApp initialized (therefore it is
unable to handle the :openDocuments call)

So, just to clarify - the "odoc" apple event is NOT failing on launch. It's
just that you are getting it sooner (or later?) than you are hoping for it.
Is that right? Thx - m.

>
>On Dec 2, 2009, at 11:06 AM, Matt Neuburg wrote:
>
>> On Tue, 1 Dec 2009 15:05:19 -0800, "David M. Cotter" 
>> said:
>>> i've "fixed" this by installing an AE handler before startup, trapping the
>> dropped events, then re-sending them to the NSApp after startup has completed
>> (and removing the intrim handler, since NSApp is up and handling them by
then)
>> 
>> Are you doing something else odd at startup which might require this
>> workaround? 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: Reboot? Slow First Run

2009-12-03 Thread Shawn Erickson
On Thu, Dec 3, 2009 at 3:47 AM, gMail.com  wrote:
> Hi,
> my app executes a given task in 1.2 seconds, all the time. I can quit the
> application, relaunch it, run the same task several times and it always
> takes 1.2 seconds.
> But if I reboot the machine, I launch the application and run the same task
> for the first time, it takes 13 seconds! This problem occurs at any reboot.
> Then if I run the task again it always takes 1.2 seconds.

The OS maintains a cache of data in RAM as much as it can while
running. This "universal buffer cache" caches pages of data from
loaded files, applications, etc.

So the long initial load time is likely a result of having to load the
data you need from disk (and possibly bringing online services your
application needs that haven't yet been needed by other applications).
The later load times are loading data from cache hence much much
faster.

-Shawn
___

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: Reboot? Slow First Run

2009-12-03 Thread Jerry Krinock

On 2009 Dec 03, at 04:45, gMail.com wrote:

> I add some important info:
> I have now duplicated the folder containing the 10,000 files and even if I
> don't reboot, the first scan over this new folder takes 13 seconds too. So,
> I guess the OS caches some info about the files I have already read. Is
> anyone who can explain that better? Can I avoid this long time?

Not me, but yes it is caching of some kind.  I've seen this behavior in other 
apps, though not to the 10x degree that you are seeing, and have always assumed 
that this is one of the tricks Apple is using to compensate for the fact that 
processor speeds are not increasing as fast as they were 10 years ago.  
Traversing the filesystem obviously involves much disk access and is therefore 
slow, so it is reasonable that your app would be more affected than others.  
I'd say it's normal, expected behavior and there's not much you can do about it.

___

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: Reboot? Slow First Run

2009-12-03 Thread Luca Ciciriello

Hi Leonardo.

Which version of OS are you using? Which architecture (32/64 bit), Which 
version of compiler? I don't know if this matter, but is useful for me in order 
to try to reproduce your behaviour.

 

Luca.  
 
> Date: Thu, 3 Dec 2009 12:47:27 +0100
> From: mac.iphone@gmail.com
> To: cocoa-dev@lists.apple.com
> Subject: Reboot? Slow First Run
> 
> Hi,
> my app executes a given task in 1.2 seconds, all the time. I can quit the
> application, relaunch it, run the same task several times and it always
> takes 1.2 seconds.
> But if I reboot the machine, I launch the application and run the same task
> for the first time, it takes 13 seconds! This problem occurs at any reboot.
> Then if I run the task again it always takes 1.2 seconds.
> 
> What do I miss?
> The task simply calls contentsOfDirectoryAtPath then reads all the 10,000
> files (<=2 kb each) and put the contents into an array.
> I can show my code, if necessary.
> 
> Regards
> --
> Leonardo
> 
> 
> 
> 
> ___
> 
> 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/luca_ciciriello%40hotmail.com
> 
> This email sent to luca_cicirie...@hotmail.com
  
_
Have more than one Hotmail account? Link them together to easily access both
 
http://clk.atdmt.com/UKM/go/186394591/direct/01/___

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


Reboot? Slow First Run

2009-12-03 Thread gMail.com
I add some important info:
I have now duplicated the folder containing the 10,000 files and even if I
don't reboot, the first scan over this new folder takes 13 seconds too. So,
I guess the OS caches some info about the files I have already read. Is
anyone who can explain that better? Can I avoid this long time?


Hi,
my app executes a given task in 1.2 seconds, all the time. I can quit the
application, relaunch it, run the same task several times and it always
takes 1.2 seconds.
But if I reboot the machine, I launch the application and run the same task
for the first time, it takes 13 seconds! This problem occurs at any reboot.
Then if I run the task again it always takes 1.2 seconds.

What do I miss?
The task simply calls contentsOfDirectoryAtPath then reads all the 10,000
files (<=2 kb each) and put the contents into an array.
I can show my code, if necessary.

Regards
--
Leonardo




___

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: Application crashing on iPod Touch, not on iPhone

2009-12-03 Thread Sébastien Stormacq
Actually the crash log is very weird.  But I managed to find an iPod and to 
reproduce the problem.  The end of the story - Apple is right : application 
crashes on iPod and not iPhone when there is no network connectivity.

The crash log they provided me is totally different from what I get but  the 
crash is there.

For your curiosity : [NSURL urlWithString] is the culprit : it throws a 
NSException on the Touch when there is no network, not on the iPhone ;-)

Thanks for your excellent suggestions and your time.  Now, I am back in 
"waiting for approval" mode for a couple of weeks :-)

--Seb




On 03 Dec 2009, at 08:11, Glenn L. Austin wrote:

> Double-check that what they tell you matches the log files or images they 
> sent you.
> 
> I once had a rejection due to network connectivity issues, but the 
> description and the logs told different stories.
> 
> On Dec 2, 2009, at 11:42 AM, Sébastien Stormacq wrote:
> 
>> I just borrowed an iPod Touch from a friend and tested my app on it.
>> It works as expected.  I can not reproduce the steps Apple said it crashed.
>> 
>> What's the procedure when we don't reproduce a crash at startup that caused 
>> Apple to reject the app ?
>> 
>> Thanks for your help
>> 
>> --Seb
> 
> -- 
> Glenn L. Austin, Computer Wizard and Race Car Driver <><
> 
> 
> 
> 

___

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: Reboot? Slow First Run

2009-12-03 Thread Mike Abdullah

On 3 Dec 2009, at 11:47, gMail.com wrote:

> Hi,
> my app executes a given task in 1.2 seconds, all the time. I can quit the
> application, relaunch it, run the same task several times and it always
> takes 1.2 seconds.
> But if I reboot the machine, I launch the application and run the same task
> for the first time, it takes 13 seconds! This problem occurs at any reboot.
> Then if I run the task again it always takes 1.2 seconds.
> 
> What do I miss?
> The task simply calls contentsOfDirectoryAtPath then reads all the 10,000
> files (<=2 kb each) and put the contents into an array.
> I can show my code, if necessary.

Have you done any performance profiling yet? Instruments is your friend.
___

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


Reboot? Slow First Run

2009-12-03 Thread gMail.com
Hi,
my app executes a given task in 1.2 seconds, all the time. I can quit the
application, relaunch it, run the same task several times and it always
takes 1.2 seconds.
But if I reboot the machine, I launch the application and run the same task
for the first time, it takes 13 seconds! This problem occurs at any reboot.
Then if I run the task again it always takes 1.2 seconds.

What do I miss?
The task simply calls contentsOfDirectoryAtPath then reads all the 10,000
files (<=2 kb each) and put the contents into an array.
I can show my code, if necessary.

Regards
--
Leonardo




___

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: Getting reference to NSWindowController from subviews

2009-12-03 Thread Mike Abdullah
Bear in mind that if one of your views needs to know about the window 
controller, it's a good sign of a poor design. You're probably better off 
giving the view in question its own -delegate or -dataSource property which can 
be set to the window controller.

On 3 Dec 2009, at 02:09, PCWiz wrote:

> Thanks, worked great.
> 
> On 2009-12-02, at 6:37 PM, Graham Cox wrote:
> 
>> 
>> On 03/12/2009, at 12:26 PM, PCWiz wrote:
>> 
>>> What is the best way to get a reference to my NSWindowController object 
>>> from subviews of its window?
>> 
>> 
>> [[theView window] windowController];
>> 
>> --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/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: image not found

2009-12-03 Thread Torsten Curdt
Hm...

The Sparkle frameworks uses @loader_path while the FeedbackReporter
uses @executable_path instead.

What's the difference?

Reading 
http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/dyld.1.html
it looks like FeedbackReporter should also use @loader_path but why
would this work for some and for some not?

I am confused.

$ otool -L uif2iso4mac
uif2iso4mac:
/usr/lib/libcrypto.0.9.7.dylib (compatibility version 0.9.7, current
version 0.9.7)
/usr/lib/libssl.0.9.7.dylib (compatibility version 0.9.7, current
version 0.9.7)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 
1.2.3)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
(compatibility version 1.0.0, current version 12.0.0)
@loader_path/../Frameworks/Sparkle.framework/Versions/A/Sparkle
(compatibility version 1.5.0, current version 1.5.0)

@executable_path/../Frameworks/FeedbackReporter.framework/Versions/A/FeedbackReporter
(compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 
1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 111.1.4)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 
227.0.0)

/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
(compatibility version 150.0.0, current version 476.18.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
(compatibility version 300.0.0, current version 677.24.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
(compatibility version 45.0.0, current version 949.46.0)
___

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


Finding a word from a character position

2009-12-03 Thread Gideon King
Hi

I'm trying to emulate the double-click behavior of an NSTextView where it 
selects the word under your mouse. 

I am able to set the insertion point on a single click using the 
characterIndexForPoint: method. 

What's the best way to go from there to selecting the word (or space) where 
they have clicked?

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


ParseKit BNF grammar

2009-12-03 Thread Mikkel Eriksen
Hi all

I'm working on a ParseKit parser for GEDCOM, but I'm having a weird issue.

My very simple preliminary grammar looks like this (similar to Backus-Naur):

@start  = record+;

record  = level ( tag value | xref tag ) crlf;

level   = /^\d/;
tag = /[A-Z]{3,4}/;
value   = Empty | /[^\r\n]*$/;
xref= /@[A-Z]\d+@/;

crlf= /[\r\n]+/;


My assembler class has the callbacks implemented for all productions,
right now they are just as follows:

- (void)didMatchRecord:(PKAssembly *)a //also didMatchLevel,
didMatchTag, didMatchValue, didMatchXref, didMatchCrlf
{
PKToken *tok = [a pop];
NSLog(@"didMatchRecord: %@", tok);
}


I'm testing it against this file:

0 HEAD
1 SOUR GEDitCOM
2 NAME GEDitCOM
2 VERS 3.71
1 GEDC
2 VERS 5.5
2 FORM LINEAGE_LINKED
1 LANG English
...etc


But for some reason, it seems to match the level of line 2 as the
value of line 1, even though it already matched the (null) as it
should?

2009-12-03 07:59:09.726 GCParseKitTest[13735:10b] didMatchLevel: 0
2009-12-03 07:59:09.756 GCParseKitTest[13735:10b] didMatchTag: HEAD
2009-12-03 07:59:09.785 GCParseKitTest[13735:10b] didMatchValue: (null)
2009-12-03 07:59:09.809 GCParseKitTest[13735:10b] didMatchValue: 1

It then never gets further, I assume because (level tag value value)
is not a valid record. Any insights?

Regards,
Mikkel
___

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: Retrieving informations about Network Interfaces

2009-12-03 Thread Jean-Daniel Dupas

Le 3 déc. 2009 à 09:55, Zephyroth Akash a écrit :

> Hi,
> 
> I need to extract some informations about Network Interfaces, like getting 
> IOInterfaceExtraFlags , IOInterfaceFlags ... etc.
> 
> After some search I've found that the related values are defined in 
> bsd/net/if.h ... but where is this file ?
> I
> can't find the framework that contains these definitions.
> 
> Am I missing something ?

Yes. You're missing the fact that this question is not related to Cocoa and 
should be ask on an other list.


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


Retrieving informations about Network Interfaces

2009-12-03 Thread Zephyroth Akash

Hi,

I need to extract some informations about Network Interfaces, like  
getting IOInterfaceExtraFlags , IOInterfaceFlags ... etc.


After some search I've found that the related values are defined in  
bsd/net/if.h ... but where is this file ?

I
 can't find the framework that contains these definitions.

Am I missing something ?
___

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