Re: Custom sheet question - which variable?

2010-01-11 Thread Jenny M
> Learning your way around the documentation takes awhile, but do it whenever
> you can.  In your Xcode documentation window, in the search field at the top
> right, type "Sheet Programming Topics".  You'll get a wonderful document
> which will explain many things you can't figure out by following sample
> code.
>

I've seen the Sheet Programming Topics on the Macdev center, that's where I
saw that sample code. (For some reason, I can't search the XCode
Documentation for the programming guides; it's loaded, but nothing shows in
search; the API searches fine.) I do find their guides pretty helpful.

One of the things you will find in that document is that cascading sheets
> are not supported or desirable.  We had a discussion on an alternative to
> this, presenting sheets serially, a few days ago.  Read the thread "wait for
> sheet result" on this page:
> http://lists.apple.com/archives/cocoa-dev/2010/Jan/thrd4.html#00366
>

Hmm. Good points. I thought of a better way to do it in my application. But
I'm still interested in how to do the below for another task (not
cascading).

Yes, you can load a window from any xib you want to, or even create one in
> code, and then attach it to a window as a sheet.
>

That's what I can't get to work, that's where I'm still confused. This piece
of code here:

-
if (!myCustomSheet)
[NSBundle loadNibNamed: @"MyCustomSheet" owner: self];

[NSApp beginSheet: myCustomSheet
   modalForWindow: window
   modalDelegate: self
   didEndSelector: @selector(didEndSheet:returnCode:contextInfo:)
   contextInfo: nil];


I get that "myCustomSheet" is an NSWindow reference, but how does it know to
be the particular window I want to show? When the nib is loaded, where does
it go (in code)? How do I connect the window in the MyCustomSheet XIB to an
outlet in the AppDeletegate file? I am stuck there...

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


Re: Custom sheet question - which variable?

2010-01-11 Thread Roland King



That's what I can't get to work, that's where I'm still confused. This piece
of code here:

-
if (!myCustomSheet)
[NSBundle loadNibNamed: @"MyCustomSheet" owner: self];

[NSApp beginSheet: myCustomSheet
   modalForWindow: window
   modalDelegate: self
   didEndSelector: @selector(didEndSheet:returnCode:contextInfo:)
   contextInfo: nil];


I get that "myCustomSheet" is an NSWindow reference, but how does it know to
be the particular window I want to show? When the nib is loaded, where does
it go (in code)? How do I connect the window in the MyCustomSheet XIB to an
outlet in the AppDeletegate file? I am stuck there...



In your [ NSBundle loadNibNamed .. ] what's 'self' the owner you've 
given it, is that your AppDelegate subclass? That's how you hook this up.


In IB you have 'Files Owner' which is going to be whatever object you 
pass into the loadNibNamed call. So add an outlet to that (IBOutlet 
property of type NSWindow* or similar called whatever makes sense to 
you), then hook up the window in your XIB to that property of File's Owner.


Now the window is in [ self whateverPropertyYouCalledIt ] after the NIB 
has loaded.

___

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

Please do not post admin requests or moderator comments to the list.
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 know whether property in Cocoa class is KVO-compliant?

2010-01-11 Thread Scott Anguish

On Jan 10, 2010, at 11:18 PM, Dave Fernandes wrote:

> Look for "Cocoa Bindings Guide" in the docs. It would be nice if it were 
> cross-referenced in every class description.

Please file a bug about that.

Class methods that are KVO compatible are stated as such in the reference. They 
aren’t pervasive at this point, but many more became KVO compatible in Snow 
Leopard. 

I think it’s safe to expect more methods will become KVO compliant in the 
future. And the reference will be updated to reflect those that are.


___

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

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

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

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


Re: Custom sheet question - which variable?

2010-01-11 Thread Jenny M
Oooh... okay, that helps... I haven't loaded yet, so I'm not sure what to
put in it. In the MyObject XIB file, I manually set File's Owner to be the
custom NSWindowController subclass, not AppDelegate. But, I'm trying to open
the sheet from the AppDelegate class. Is that possible?

It's possible I shouldn't separate this, at least to do what I want to be
able to do with sheet.s In the books I've read, that's the way they've set
up objects and controllers for MVC... I'm still learning, I'm in the middle
(somewhere, on and off) of Hillegass and Anderson's books, but they don't
answer everything. :) Thanks for the help here, guys, much appreciated.


On Mon, Jan 11, 2010 at 12:37 AM, Roland King  wrote:

>
>
> In your [ NSBundle loadNibNamed .. ] what's 'self' the owner you've given
> it, is that your AppDelegate subclass? That's how you hook this up.
>
> In IB you have 'Files Owner' which is going to be whatever object you pass
> into the loadNibNamed call. So add an outlet to that (IBOutlet property of
> type NSWindow* or similar called whatever makes sense to you), then hook up
> the window in your XIB to that property of File's Owner.
>
> Now the window is in [ self whateverPropertyYouCalledIt ] after the NIB has
> loaded.
>
___

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

Please do not post admin requests or moderator comments to the list.
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: Differentiate FAT16 and FAT32

2010-01-11 Thread Alastair Houghton
On 10 Jan 2010, at 21:05, Matthias Arndt wrote:

>> According to the sources for the FAT filesystem driver (which you can get 
>> from ), you can look at f_fssubtype in the 
>> statfs structure, which you can retrieve using statfs() or similar.  See man 
>> 2 statfs.
>> 
>> This isn't exactly a Cocoa question, BTW...  you should probably have asked 
>> on darwin-dev or one of the other lists.
> 
> Thanks for the hint, I will definitely look into statfs and its structure. 
> When posting the question I wasn't aware that it's not related to Cocoa: I 
> assumed that I may have missed the right framework / class / method ... Sorry!

No, I was in the wrong here.  I read back through your e-mail; the *answer* has 
nothing to do with Cocoa, but you were asking about a Cocoa class.  You would 
have needed to know that the issue wasn't Cocoa-related in order to be able to 
tell.  My apologies.

Kind regards,

Alastair.

--
http://alastairs-place.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


[MEET] Amsterdam CocoaHeads this Wednesday (Jan 13th) 7-9PM

2010-01-11 Thread Cathy Shive
Hello Amsterdam CocoaHeads,

There will be a meeting this Wednesday, January 13th.  More info and a
map to the Sofa office can be found on the meeting page.

http://groups.google.com/group/cocoaheads-amsterdam/web/next-meeting---wednesday-jan-13?hl=en

See you then!
Cathy


___

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

Please do not post admin requests or moderator comments to the list.
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


pointer being freed was not allocated when rotating an iPhone

2010-01-11 Thread Gerriet M. Denkmann
When I rotate my iPhone in the Simulator, I get:

... malloc: *** error for object 0x1091000: pointer being freed was not 
allocated
*** set a breakpoint in malloc_error_break to debug
(gdb) bt
#0  0x980d2072 in malloc_error_break ()
#1  0x97fe1303 in free ()
#2  0x0015ce49 in dataReleaseInfo ()
#3  0x001481d9 in data_provider_finalize ()
#4  0x30204421 in _CFRelease ()
#5  0x00147fa2 in image_finalize ()
#6  0x30204421 in _CFRelease ()
#7  0x00c12ded in CALayerStateRelease ()
#8  0x00c18290 in -[CALayer dealloc] ()
#9  0x00c0a00e in CALayerRelease ()
#10 0x00c0b265 in CA::release_root_if_unused ()
#11 0x00c0b1ef in x_hash_table_remove_if ()
#12 0x00c0afd4 in CA::Transaction::commit ()
#13 0x00c132e0 in CA::Transaction::observer_callback ()
#14 0x30245c32 in __CFRunLoopDoObservers ()
#15 0x3024503f in CFRunLoopRunSpecific ()
#16 0x30244628 in CFRunLoopRunInMode ()
#17 0x32044c31 in GSEventRunModal ()
#18 0x32044cf6 in GSEventRun ()
#19 0x309021ee in UIApplicationMain ()
#20 0x291c in main (argc=1, argv=0xb06c) at /Volumes/เม่น
(gdb) 

As there seems to be none of my code involved, I am a bit puzzled how to debug 
this.
My subclass of UIViewController is initialized from a nib and only contains a 
UITextView.

 
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: How to know whether property in Cocoa class is KVO-compliant?

2010-01-11 Thread Quincey Morris
On Jan 10, 2010, at 19:58, Jerry Krinock wrote:

> After studying some about bindings during the last week, I decided that, just 
> for fun, I would bind an NSSegmentedControl to its window controller using a 
> binding instead of target/action.  I thought that selectedSegment might be a 
> KVO-compliant property of NSSegmentedControl because it has a 
> -selectedSegment and -setSelectedSegment: method.
> 
> So I exposed a binding named @"foo" in my window controller's +initialize, in 
> -awakeFromNib I added this:
> 
>  [windowController bind:@"foo"
>toObject:segmentedControl
> withKeyPath:@"selectedSegment"
>options:0] ;

Adding on to mmalc's response, to make this explicit:

You *didn't* "bind an NSSegmentedControl to its window controller", you 
actually bound a window controller['s "foo" binding] to [the "selectedSegment" 
property of] a NSSegmentedControl.

IIRC the bindings documentation isn't clear which direction "is bound to" 
refers to and/or it gives the impression that a binding is symmetric (which it 
may effectively be at the level of notifications, but it isn't at the level of 
establishing bindings between objects).


___

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

Please do not post admin requests or moderator comments to the list.
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: pointer being freed was not allocated when rotating an iPhone

2010-01-11 Thread Jonathan del Strother
2010/1/11 Gerriet M. Denkmann :
> When I rotate my iPhone in the Simulator, I get:
>
> ... malloc: *** error for object 0x1091000: pointer being freed was not 
> allocated
> *** set a breakpoint in malloc_error_break to debug
> (gdb) bt
> #0  0x980d2072 in malloc_error_break ()
> #1  0x97fe1303 in free ()
> #2  0x0015ce49 in dataReleaseInfo ()
> #3  0x001481d9 in data_provider_finalize ()
> #4  0x30204421 in _CFRelease ()
> #5  0x00147fa2 in image_finalize ()
> #6  0x30204421 in _CFRelease ()
> #7  0x00c12ded in CALayerStateRelease ()
> #8  0x00c18290 in -[CALayer dealloc] ()
> #9  0x00c0a00e in CALayerRelease ()
> #10 0x00c0b265 in CA::release_root_if_unused ()
> #11 0x00c0b1ef in x_hash_table_remove_if ()
> #12 0x00c0afd4 in CA::Transaction::commit ()
> #13 0x00c132e0 in CA::Transaction::observer_callback ()
> #14 0x30245c32 in __CFRunLoopDoObservers ()
> #15 0x3024503f in CFRunLoopRunSpecific ()
> #16 0x30244628 in CFRunLoopRunInMode ()
> #17 0x32044c31 in GSEventRunModal ()
> #18 0x32044cf6 in GSEventRun ()
> #19 0x309021ee in UIApplicationMain ()
> #20 0x291c in main (argc=1, argv=0xb06c) at /Volumes/เม่น
> (gdb)
>
> As there seems to be none of my code involved, I am a bit puzzled how to 
> debug this.
> My subclass of UIViewController is initialized from a nib and only contains a 
> UITextView.
>

Is this on the 3.0 simulator?  I had a similar problem when creating
CGImages, and it was fixed by running the simulator with the 3.1 SDK.
As far as I can tell, the problem is completely absent on the actual
hardware, with or without 3.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


Re: Custom sheet question - which variable?

2010-01-11 Thread Roland King

On 11-Jan-2010, at 4:53 PM, Jenny M wrote:

> Oooh... okay, that helps... I haven't loaded yet, so I'm not sure what to put 
> in it. In the MyObject XIB file, I manually set File's Owner to be the custom 
> NSWindowController subclass, not AppDelegate. But, I'm trying to open the 
> sheet from the AppDelegate class. Is that possible?
> 

You can do whichever you like. I tend to wander objects up and down my various 
controller and delegate chains as I write code because where I think I want it, 
I sometimes don't want it. Ask yourself this, what is this sheet most closely 
tied to? Is it something which is going to be used in the delegate on some kind 
of delegate callback? If so, you probably want the delegate to own it. Or is it 
something the WindowController really wants to 'own'? If that's the case then 
let it own it. 

If (in the code you posted) you're at that point in your AppDelegate then 
'self', the thing you pass as owner, is the wrong type for the way you say you 
have your XIB configured. You need to make sure that the 'owner' is an object 
of the class you've told the XIB that File's Owner is; it can be what you like, 
but you have to be consistent. If you want it to be in your NSWindowController 
subclass, then for 'owner' you need to pass that window controller subclass 
object and the window you require will end up bound to some properly (you 
define) of that, then you pass [ yourWindowController thePropertyYouChose ] as 
the window to your sheet method. 

And don't forget, in your XIB .. you need to make the connection to the 
property in File's Owner. Oh yes it's easily said but so easily overlooked and 
you'll be asking why your sheet doesn't come up after you loaded the NIB and it 
will be because the outlet is nil because you didn't actually hook it up 
graphically in IB. 

> It's possible I shouldn't separate this, at least to do what I want to be 
> able to do with sheet.s In the books I've read, that's the way they've set up 
> objects and controllers for MVC... I'm still learning, I'm in the middle 
> (somewhere, on and off) of Hillegass and Anderson's books, but they don't 
> answer everything. :) Thanks for the help here, guys, much appreciated.
> 
> 
> On Mon, Jan 11, 2010 at 12:37 AM, Roland King  wrote:
> 
> 
> In your [ NSBundle loadNibNamed .. ] what's 'self' the owner you've given it, 
> is that your AppDelegate subclass? That's how you hook this up.
> 
> In IB you have 'Files Owner' which is going to be whatever object you pass 
> into the loadNibNamed call. So add an outlet to that (IBOutlet property of 
> type NSWindow* or similar called whatever makes sense to you), then hook up 
> the window in your XIB to that property of File's Owner.
> 
> Now the window is in [ self whateverPropertyYouCalledIt ] after the NIB has 
> loaded.
> 

___

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

Please do not post admin requests or moderator comments to the list.
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 endInterruption delegate method killing OpenAL

2010-01-11 Thread Chunk 1978
i can't figure out what it wrong with my code (attached .m file).  i'm
playing a looping sound with OpenAL, which becomes interrupted by an
alarm.  when i quit the alarm, my endInterruption delegate method is
activated, and a new OpenAL session is started but i can no longer
play sounds.  i've also tested other games i've downloaded from the
app store and their sound is also killed after an interruption from
the alarm.  what is wrong with my code?


SoundManagerMethods.m
Description: Binary data
___

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

Please do not post admin requests or moderator comments to the list.
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

Open new document from within another document.

2010-01-11 Thread Jeffrey Andrews
I am stumped.  I am trying to open another document from within a  
document.  My AppController implements the delegate method


-(BOOL) application:(NSApplication*) sender openFile:(NSString*)path
{
NSLog(@"AppController - application:openFile - %@", path);
	NSDocumentController* dc = [NSDocumentController  
sharedDocumentController];
	id doc = [dc openDocumentWithContentsOfURL:[NSURL URLWithString:path]  
display:YES];

return (doc != nil);
}


From within MyDocument.m
I have a method like below

-(void)openSelectedFile
{
// if nothing selected, return
if([tableView numberOfSelectedRows] != 1)
return;

NSLog(@"openSelectedFile");
NSDictionary* dict = [entries objectAtIndex:[tableView selectedRow]];
NSString* tempDirectory = NSTemporaryDirectory();
NSLog(@"temp directory = %@", tempDirectory);
	NSMutableArray* filenames = [[NSMutableArray alloc] initWithObjects: 
[dict valueForKey:@"filename"], nil];

if([self fileIsSupported:[dict valueForKey:@"filename"]])
{
[extractor extractFiles:filenames toDirectory:tempDirectory];
		NSString* tmpFilename = [tempDirectory  
stringByAppendingPathComponent:[dict valueForKey:@"filename"]];

NSApplication* app = [NSApplication sharedApplication];
[[app delegate] application:app openFile:tmpFilename];
}
[filenames release];
}

How else should I handle opening another window with the file specified?
BTW:  I can drag and drop onto my icon.  I can Open and Open Recent  
from the Menu just fine.
This is the only issue I have trying to open a document.  Oh, and just  
to cover my bases, I did make sure

that the file exists and is accessible.

Thanks,

Jeff
___

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

Please do not post admin requests or moderator comments to the list.
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: diagnose crashes

2010-01-11 Thread Eric E. Dolecki
I have an app that I am trying to debug. When I run in Simulator I have no
problems. When I am tethered to my dev machine with a device I see no
problems. When I'm out and about I'll get crashes when I click into a
UITextField in a view I flip to I'll get the crashes (sometimes)

Using Organizer I'll check into the crashes and I don't understand them:

Exception Type:  EXC_BAD_ACCESS (SIGBUS)

Exception Codes: KERN_PROTECTION_FAILURE at 0x000e

Crashed Thread:  0


Thread 0 Crashed:

0   libobjc.A.dylib   0x3ebc objc_msgSend + 20

1   ZipWeather0x3ace -[MainViewController
updateClock] (MainViewController.m:113)

2   Foundation0xdd94 __NSFireTimer + 136

3   CoreFoundation0x000574bc CFRunLoopRunSpecific + 2192

4   CoreFoundation0x00056c18 CFRunLoopRunInMode + 44

5   GraphicsServices  0x436c GSEventRunModal + 188

6   UIKit 0x3c28 -[UIApplication _run] + 552

7   UIKit 0x2228 UIApplicationMain + 960

8   MyApp 0x2c76 main (main.m:14)

9   MyApp   0x2c0c start + 44


Thread 0 crashed with ARM Thread State:

r0: 0x0017bb60r1: 0x33843fc8  r2: 0x3dd612f7  r3: 0xbf7e98fd

r4: 0x0006r5: 0x0038  r6: 0x0017bb60  r7: 0x24c0

r8: 0x33843fc8r9: 0x001fc098 r10: 0x00105bf0 r11: 0x00105ce0

ip: 0xa07csp: 0x2370  lr: 0x3ad5  pc: 0x3090febc

  cpsr: 0x000f0010


Any ideas based on the above?
___

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

Please do not post admin requests or moderator comments to the list.
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 defaults and toolbar items

2010-01-11 Thread Graham Cox

On 11/01/2010, at 5:46 AM, Martin Hewitson wrote:

> Now, if I issue a new version of the application with a new feature that 
> comes with a new toolbar button, this button doesn't appear when the new 
> version is launched. In some way this makes sense, but in another way it 
> doesn't. 
> 
> Is there a recommended way to handle this situation? Should I just tell the 
> user that they should edit the toolbar to add the new button? Can I do 
> something programatically to add the new button? Advice is very much welcome.


Do nothing.

The users preferences are how they like their app, or if they've never changed 
it from the defaults you originally gave them, presumably they are happy with 
that. Just make the button available and mention it in your release notes - if 
they want it, they can easily add it. Changing the UI programatically is just 
not worth the trouble, and you probably want to minimise surprises, even if you 
think your new button is the greatest thing ever, and want to have it used.

--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: pointer being freed was not allocated when rotating an iPhone

2010-01-11 Thread Gerriet M. Denkmann

On 11 Jan 2010, at 19:24, Jonathan del Strother wrote:

> 2010/1/11 Gerriet M. Denkmann :
>> When I rotate my iPhone in the Simulator, I get:
>> 
>> ... malloc: *** error for object 0x1091000: pointer being freed was not 
>> allocated
>> *** set a breakpoint in malloc_error_break to debug
>> (gdb) bt
>> #0  0x980d2072 in malloc_error_break ()
>> #1  0x97fe1303 in free ()
>> #2  0x0015ce49 in dataReleaseInfo ()
>> #3  0x001481d9 in data_provider_finalize ()
>> #4  0x30204421 in _CFRelease ()
>> #5  0x00147fa2 in image_finalize ()
>> #6  0x30204421 in _CFRelease ()
>> #7  0x00c12ded in CALayerStateRelease ()
>> #8  0x00c18290 in -[CALayer dealloc] ()
>> #9  0x00c0a00e in CALayerRelease ()
>> #10 0x00c0b265 in CA::release_root_if_unused ()
>> #11 0x00c0b1ef in x_hash_table_remove_if ()
>> #12 0x00c0afd4 in CA::Transaction::commit ()
>> #13 0x00c132e0 in CA::Transaction::observer_callback ()
>> #14 0x30245c32 in __CFRunLoopDoObservers ()
>> #15 0x3024503f in CFRunLoopRunSpecific ()
>> #16 0x30244628 in CFRunLoopRunInMode ()
>> #17 0x32044c31 in GSEventRunModal ()
>> #18 0x32044cf6 in GSEventRun ()
>> #19 0x309021ee in UIApplicationMain ()
>> #20 0x291c in main (argc=1, argv=0xb06c) at /Volumes/เม่น
>> (gdb)
>> 
>> As there seems to be none of my code involved, I am a bit puzzled how to 
>> debug this.
>> My subclass of UIViewController is initialized from a nib and only contains 
>> a UITextView.
>> 
> 
> Is this on the 3.0 simulator?  
The simulator says: Version 3.1 (139.1)

Xcode says: iPhone Simulator 3.1.2

> I had a similar problem when creating
> CGImages, and it was fixed by running the simulator with the 3.1 SDK.
> As far as I can tell, the problem is completely absent on the actual
> hardware, with or without 3.0.

RIght now I cannot test the stuff on my iPhone. 

___

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

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

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

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


[MEET] Toronto Cocoaheads / tacow - January 26

2010-01-11 Thread Karl Moskowski
The next meeting of tacow/Toronto CocoaHeads will be held on Tuesday, January 
26 at 6:30 PM at Ryerson University. Note that this meeting is two weeks later 
than our regular date.

Also, we'll be meeting in the Ryerson comp. sci. department's new location at 
Yonge & Dundas. Up-to-date agenda & directions are available at:



Karl Moskowski 
Voodoo Ergonomics Inc. 

___

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

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

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

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


[MEET] Columbia, MD CocoaHeads - Tuesday, Jan 12th

2010-01-11 Thread Eric Gorr
The next meeting of the Columbia, MD CocoaHeads group will be held on Tuesday, 
Jan 12th at Nemetschek North America, Inc. at 7pm.

For more details on this meeting,  please check out:

http://cocoaheads.org/us/ColumbiaMaryland/index.html


___

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

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

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

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


ConvertCocoa64: spaces in filename problem

2010-01-11 Thread A.M.
On this page:

http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/Cocoa64BitGuide/ConvertingExistingApp/ConvertingExistingApp.html#//apple_ref/doc/uid/TP40004247-CH5-SW5

Apple suggests using:

/Developer/Extras/64BitConversion/ConvertCocoa64 `find . -name '*.[hm]' | xargs`

However, that combination of "xargs" and "find" fails to account for filenames 
with elements that need to be escaped, such as spaces. You may not notice that 
the utility didn't process such files because the ruby script prints a line for 
each file, effectively hiding the errors.

A better incantation is:

find . -name '*.[hm]' -print0| xargs -0 
/Developer/Extras/64BitConversion/ConvertCocoa64

Cheers,
M___

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

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

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

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


Re: if statement causing 32 Byte leak?

2010-01-11 Thread Dave Camp
On Jan 10, 2010, at 6:51 PM, Scott Ribe wrote:

>> Just a quick note: one problem with this is false positives; you don't
>> necessarily control all the code that handles the object in question.
> 
> I think perhaps you didn't notice that he said "at -dealloc time". There is
> no case in which an autorelease pool should have a reference to an object
> when the object is being dealloc'd. At all other times of course, there may
> be references in autorelease pools which were correctly put there by library
> code after a retain.

That's just a specific instance of a stale pointer (or over-release) problem. 
If I was going to ask Apple for help here, I'd ask for a debug API that uses 
the Leaks engine to find things that still have pointers to my object at 
dealloc time. That would be a huge help sometimes.

Dave

___

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

Please do not post admin requests or moderator comments to the list.
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: if statement causing 32 Byte leak?

2010-01-11 Thread Scott Ribe
> If I was going to ask Apple for help here, I'd ask for a debug API that uses
> the Leaks engine to find things that still have pointers to my object at
> dealloc time.

Good idea.

-- 
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice


___

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

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

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

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


Re: A password strength checker

2010-01-11 Thread Jim Turner
Awesome find, Howard. I've needed a password strength algorithm in the
past and never could find one.  Plus, the strength computed by the
Password Assistant is questionable at best.  Given a password of
'' (20 lowercase 'a'), the assistant scores it
about a 20%. Add one more 'a' though and it jumps to 80%. I'm not sure
how that one extra 'a'  is worth a 60% increase in strength. I'd be
nice if their implementation was a bit more open for examination.

The algorithm used by KeePass, however, scores both a 20-character 'a'
and 21-character 'a' password as 10 (with 0 being no password or a
worthless password). Seems more accurate.

If anyone's interested in it, I wrote a Cocoa version of their
implementation. I'd be happy to make it available.

Jim

On Thu, Jan 7, 2010 at 2:32 PM, Howard Siegel  wrote:
> Have a look at the source code for KeePass Password Safe (
> http://keepass.info/).  It has a password generator and strength
> computation. Version 1.x is written in C++ for MS Windows (using MFC).
> Version 2.x is a rewrite in C# for .NET.
>
> It has been ported as KeyPassX for Mac OS X and Linux.
>
> - h
>
> On Thu, Jan 7, 2010 at 11:51, Martin Hewitson 
> wrote:
>
>> Dear list,
>>
>> Is anybody aware of a reasonable algorithm or some code that can be used to
>> test/check the strength of a password? I'd like to give a kind of score or a
>> color (red,yellow,green). I've looked at cracklib, but that doesn't give a
>> score, really.
>>
>> Best wishes,
>>
>> Martin
>>
>> 
>> Martin Hewitson
>> Albert-Einstein-Institut
>> Max-Planck-Institut fuer
>>    Gravitationsphysik und Universitaet Hannover
>> Callinstr. 38, 30167 Hannover, Germany
>> Tel: +49-511-762-17121, Fax: +49-511-762-5861
>> E-Mail: martin.hewit...@aei.mpg.de
>> WWW: http://www.aei.mpg.de/~hewitson 
>> 
>>
>>
>>
>>
>>
>> ___
>>
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/hsiegel%40gmail.com
>>
>> This email sent to hsie...@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/jturner.lists%40gmail.com
>
> This email sent to jturner.li...@gmail.com
>
___

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

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

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

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


Re: Differentiate FAT16 and FAT32

2010-01-11 Thread James Bucanek
Alastair Houghton  wrote 
(Monday, January 11, 2010 2:49 AM -):



On 10 Jan 2010, at 21:05, Matthias Arndt wrote:


According to the sources for the FAT filesystem driver (which you can get
from ), you can look at

f_fssubtype in the statfs structure, which you can retrieve using statfs() or
similar.  See man 2 statfs.
  This isn't exactly a Cocoa question, BTW...  you should 
probably have asked

on darwin-dev or one of the other lists.


Thanks for the hint, I will definitely look into statfs and its structure.
When posting the question I wasn't aware that it's not

related to Cocoa: I assumed that I may have missed the right framework / class
/ method ... Sorry!

No, I was in the wrong here.  I read back through your e-mail; the *answer*
has nothing to do with Cocoa, but you were asking about a Cocoa class.  You
would have needed to know that the issue wasn't Cocoa-related in order to be
able to tell.  My apologies.


Another suggestion: ask filesystem questions on the 
filesystem-dev list 
(). The 
people on this list are filesystem geniuses, but some have 
publicly admitted that they can't keep up with Cocoa-dev -- for 
which I sympathize.

--
James Bucanek

___

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

Please do not post admin requests or moderator comments to the list.
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: if statement causing 32 Byte leak?

2010-01-11 Thread Paul Sanders
Might be a bit slow.

Paul Sanders
http://www.alpinesoft.co.uk

- Original Message - 
From: "Scott Ribe" 
To: "Dave Camp" ; "Cocoa Dev" 

Sent: Monday, January 11, 2010 4:02 PM
Subject: Re: if statement causing 32 Byte leak?


> If I was going to ask Apple for help here, I'd ask for a debug 
> API that uses
> the Leaks engine to find things that still have pointers to my 
> object at
> dealloc time.

Good idea.

-- 
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice


___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/p.sanders%40alpinesoft.co.uk

This email sent to p.sand...@alpinesoft.co.uk 



___

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

Please do not post admin requests or moderator comments to the list.
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: ConvertCocoa64: spaces in filename problem

2010-01-11 Thread Sherm Pendley
Completely agree with the problem and your suggested alternative, but
this ain't the place to file bug reports. You should file this at:



sherm--

On Mon, Jan 11, 2010 at 10:56 AM, A.M.  wrote:
> On this page:
>
> http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/Cocoa64BitGuide/ConvertingExistingApp/ConvertingExistingApp.html#//apple_ref/doc/uid/TP40004247-CH5-SW5
>
> Apple suggests using:
>
> /Developer/Extras/64BitConversion/ConvertCocoa64 `find . -name '*.[hm]' | 
> xargs`
>
> However, that combination of "xargs" and "find" fails to account for 
> filenames with elements that need to be escaped, such as spaces. You may not 
> notice that the utility didn't process such files because the ruby script 
> prints a line for each file, effectively hiding the errors.
>
> A better incantation is:
>
> find . -name '*.[hm]' -print0| xargs -0 
> /Developer/Extras/64BitConversion/ConvertCocoa64
>
> Cheers,
> M___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/sherm.pendley%40gmail.com
>
> This email sent to sherm.pend...@gmail.com
>



-- 
Cocoa programming in Perl:
http://www.camelbones.org
___

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

Please do not post admin requests or moderator comments to the list.
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: if statement causing 32 Byte leak?

2010-01-11 Thread Scott Ribe
> Might be a bit slow.

Yes, I would think you'd definitely want to be able to turn it on per-class.

Of course none of this will get you a break on the actual error except
occasionally when you're lucky and it's the last release (not autorelease)
that's wrong--it merely puts the break more or less closer to the bug than
the current NSZombie stuff.

-- 
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice


___

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

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

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

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


Re: if statement causing 32 Byte leak?

2010-01-11 Thread Paul Sanders
I think what Graham originally said was true though - the 
hardest over-release bugs to get to the bottom of are those 
where a 'stale' reference is left behind in an autorelease pool, 
only to blow up at some future point.  That has certainly been 
my experience at least and Graham's suggestion would trap all 
such bugs at the point of last release (which, probably, is the 
cause of the bug anyway).

Paul Sanders
http://www.alpinesoft.co.uk

- Original Message - 
From: "Scott Ribe" 
To: "Paul Sanders" ; "Dave Camp" 
; "Cocoa Dev" 
Sent: Monday, January 11, 2010 4:39 PM
Subject: Re: if statement causing 32 Byte leak?


Of course none of this will get you a break on the actual error 
except
occasionally when you're lucky and it's the last release (not 
autorelease)
that's wrong--it merely puts the break more or less closer to 
the bug than
the current NSZombie stuff.



___

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

Please do not post admin requests or moderator comments to the list.
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: "Bindings"; Was: whether property in Cocoa class is KVO-compliant?

2010-01-11 Thread Jerry Krinock

On 2010 Jan 11, at 03:47, Quincey Morris wrote:

> On Jan 10, 2010, at 19:58, Jerry Krinock wrote:
> 
>>   toObject:segmentedControl
> 
> You *didn't* "bind an NSSegmentedControl to its window controller", you 
> actually bound a window controller['s "foo" binding] to [the 
> "selectedSegment" property of] a NSSegmentedControl.

Oops, you're correct.  Like the method says, bind:*to*:segmentedControl.

> IIRC the bindings documentation isn't clear which direction "is bound to" 
> refers to and/or it gives the impression that a binding is symmetric (which 
> it may effectively be at the level of notifications, but it isn't at the 
> level of establishing bindings between objects).

When I first heard the word "binding", from other uses in English, I assumed 
that it was two-way, and labored under this incorrect assumption for quite 
awhile.  Now I know that a binding is only one way, and further that change 
data flows in the *opposite* direction of the *to*.  That is, if I bind myself 
*to* you, I observe what you do and your changes flow back *to* me.

I wonder why bindings was not as an extension of KVO, instead of as a separate 
sideshow.  The effect is the same as KVO, with the addition that a designated 
setter is automatically invoked in the observer when a change is observed.

And then there's the whole thing about the separate namespaces for "bindings" 
and "properties", not to mention the three definitions of the word binding to 
mean

   1. (verb) the act of binding
   2. (noun) the connection that you get when you make a binding
   3. (noun) the name of the property that gets bound in the receiver

I wrote a little document for myself where I actually use the words binding(1), 
binding(2) and binding(3).

Scott, if I ever get to point that I think I know what I'm talking about, I 
might file a bug to suggest that the whole Cocoa Bindings Reference be 
destroyed and its pages page added as a "Bindings" section to the regular API 
documentation of the "bound" classes.

Thanks for the discussion.  I hope I didn't make any more "bind" mistakes in 
the above!

___

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

Please do not post admin requests or moderator comments to the list.
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: if statement causing 32 Byte leak?

2010-01-11 Thread Scott Ribe
> That has certainly been
> my experience at least and Graham's suggestion would trap all
> such bugs at the point of last release (which, probably, is the
> cause of the bug anyway).

It has been my experience that some of the hardest bugs were stale
references left in autorelease pools. However it has not often been my
experience that the last release is my actual bug.

-- 
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice


___

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

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

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

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


Re: Enabling NSZombieEnabled programatically

2010-01-11 Thread Scott Ribe
> ...but was never able to...

So, would this work?

static int zombiefoo = EnableZombies();

void EnableZombies()
{ NSZombieEnabled  = ... }

That would move it back to before main() is entered, though not necessarily
before various Obj-C classes are loaded.

-- 
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice


___

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

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

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

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


Re: Enabling NSZombieEnabled programatically

2010-01-11 Thread Scott Ribe
Typed too fast, duh, it would obviously have to be:

static int zombiefoo = EnableZombies();

int EnableZombies()
{
NSZombieEnabled  = ...
return 0;
}

-- 
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice


___

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

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

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

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


Re: iPhone: diagnose crashes

2010-01-11 Thread Alexander Spohr
Your App crashes in MainViewController.m line 113.
You send a message to a dead object in there.

atze


Am 11.01.2010 um 14:50 schrieb Eric E. Dolecki:

> I have an app that I am trying to debug. When I run in Simulator I have no
> problems. When I am tethered to my dev machine with a device I see no
> problems. When I'm out and about I'll get crashes when I click into a
> UITextField in a view I flip to I'll get the crashes (sometimes)
> 
> Using Organizer I'll check into the crashes and I don't understand them:
> 
> Exception Type:  EXC_BAD_ACCESS (SIGBUS)
> 
> Exception Codes: KERN_PROTECTION_FAILURE at 0x000e
> 
> Crashed Thread:  0
> 
> 
> Thread 0 Crashed:
> 
> 0   libobjc.A.dylib   0x3ebc objc_msgSend + 20
> 
> 1   ZipWeather0x3ace -[MainViewController
> updateClock] (MainViewController.m:113)
> 
> 2   Foundation0xdd94 __NSFireTimer + 136
> 
> 3   CoreFoundation0x000574bc CFRunLoopRunSpecific + 2192
> 
> 4   CoreFoundation0x00056c18 CFRunLoopRunInMode + 44
> 
> 5   GraphicsServices  0x436c GSEventRunModal + 188
> 
> 6   UIKit 0x3c28 -[UIApplication _run] + 552
> 
> 7   UIKit 0x2228 UIApplicationMain + 960
> 
> 8   MyApp 0x2c76 main (main.m:14)
> 
> 9   MyApp   0x2c0c start + 44
> 
> 
> Thread 0 crashed with ARM Thread State:
> 
>r0: 0x0017bb60r1: 0x33843fc8  r2: 0x3dd612f7  r3: 0xbf7e98fd
> 
>r4: 0x0006r5: 0x0038  r6: 0x0017bb60  r7: 0x24c0
> 
>r8: 0x33843fc8r9: 0x001fc098 r10: 0x00105bf0 r11: 0x00105ce0
> 
>ip: 0xa07csp: 0x2370  lr: 0x3ad5  pc: 0x3090febc
> 
>  cpsr: 0x000f0010
> 
> 
> Any ideas based on the above?
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/atze%40freeport.de
> 
> This email sent to a...@freeport.de

___

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

Please do not post admin requests or moderator comments to the list.
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: Differentiate FAT16 and FAT32

2010-01-11 Thread Matthias Arndt
Am 11.01.2010 um 17:17 schrieb James Bucanek:

> Another suggestion: ask filesystem questions on the filesystem-dev list 
> (). The people on 
> this list are filesystem geniuses, but some have publicly admitted that they 
> can't keep up with Cocoa-dev -- for which I sympathize.

Thanks, guys! I owe you one, because I would have never checked out statfs on 
my own.

Even if not exactly on topic here's my solution after I browsed the source of 
FSFormatName.c at 
 (just for the 
archive):

#include 
struct statfs fsInfo;
int fsSubtype;

if (statfs([path cStringUsingEncoding:NSASCIIStringEncoding], &fsInfo) == 0)
{
#ifdef _DARWIN_FEATURE_64_BIT_INODE
fsSubtype = fsInfo.f_fssubtype;
#else
fsSubtype = fsInfo.f_reserved1;
#endif
...
}

Afterwards I can easily compare fsSubtype:

0 = FAT 12
1 = FAT 16
2 = FAT 32

Thanks again, Matthias
 ___

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

Please do not post admin requests or moderator comments to the list.
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: Drawing A Mutable String

2010-01-11 Thread Michael Craig
Andy: There's nothing drawing over it. I can move that chunk of code to the
end of drawRect: with the same result.

Quincy: rightAligned is a paragraph style object that's defined elsewhere in
drawRect and used in a few different places.

Fritz: All four things you mention are apparently true when I run it through
the debugger, so the if statement must be working. What's more, I can see
that it's working by inserting a printf inside (or after) the if and seeing
the fully appended string there.

How is it possible that I can append the value of infoStr, see that new
value at the console with printf, then draw it and get the old value?

Also, I can appended another string to infoStr after the invalidStack if
statement and it gets drawn (always, since it's not in an if), but the
string appended in the invalidStack if statement still doesn't get drawn.
They both show up in the console when I printf infoStr, but the invalidStack
piece in the middle of the string is left out when infoStr is drawn.

Gah!

Michael S Craig
(908) 328 8030


On Thu, Jan 7, 2010 at 4:18 PM, Fritz Anderson wrote:

> On 7 Jan 2010, at 2:29 PM, Michael Craig wrote:
>
> >if ([theDeck.cardPile count] == 0) {
> >[infoStr appendString: @"\n\nThe deck is empty."];  //
> > *2*
> >}
> >if (gameCon.invalidStack) {
> >[infoStr appendString: @"\n\nThat's an invalid stack."];//
> > *1*
> >}
> >[infoStr drawInRect: infoRect
> >withAttributes: infoAtts];
> ...
> > If I move the line marked *1* to come after the line marked *2*, then
> both
> > messages are drawn when the deck is empty, as one would expect.
> >
> > If I move the line marked *1* one line down (so it's outside of the
> > invalidStack if statement and the if is empty), then invalidStack message
> is
> > drawn at all times, as one would expect.
> >
> > So what is keeping it from drawing the appended text when it happens
> inside
> > the invalidStack if statement? Like I said above, the if statement itself
> > works fine.
>
> I don't understand why you say "the if statement works fine." You say it
> doesn't execute its body when you think its condition is true. That means it
> doesn't work fine, doesn't it?
>
> When you execute this code line-by-line in the debugger, do you see with
> your own eyes:
>
> • gameCon (assuming it is an object pointer) is not nil?
> • gameCon.invalidStack is non-zero?
> • Control ever reaches line 1?
> • infoStr changes content?
>
>— F
>
>
___

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

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

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

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


Re: Custom sheet question - which variable?

2010-01-11 Thread Scott Ribe
You may want the [NSBundle loadNibNamed: @"MyCustomSheet" owner: self] call
in effect made from within the init method of your NSWindowController
subclass. In which case, you may want to use NSWindowController's
initWithWindowNibName method.

-- 
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice


___

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

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

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

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


Re: Differentiate FAT16 and FAT32

2010-01-11 Thread Alastair Houghton
On 11 Jan 2010, at 17:22, Matthias Arndt wrote:

> if (statfs([path cStringUsingEncoding:NSASCIIStringEncoding], &fsInfo) == 0)

[path cStringUsingEncoding:NSASCIIStringEncoding] is wrong.  You want [path 
filesystemRepresentation], otherwise you will have problems if there are any 
non-ASCII characters in the provided path.

Kind regards,

Alastair.

--
http://alastairs-place.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: Open new document from within another document.

2010-01-11 Thread Quincey Morris
On Jan 11, 2010, at 05:43, Jeffrey Andrews wrote:

> I am stumped.  I am trying to open another document from within a document.  
> My AppController implements the delegate method
> 
> -(BOOL) application:(NSApplication*) sender openFile:(NSString*)path
> {
>   NSLog(@"AppController - application:openFile - %@", path);
>   NSDocumentController* dc = [NSDocumentController 
> sharedDocumentController];
>   id doc = [dc openDocumentWithContentsOfURL:[NSURL URLWithString:path] 
> display:YES];
>   return (doc != nil);
> }

...

> How else should I handle opening another window with the file specified?

Yes, but you didn't say what happens. Does the delegate method get invoked? Is 
'doc' nil? What happens if you use the non-deprecated 
'openDocumentWithContentsOfURL:display:error:' instead? Is there an error 
returned? Shouldn't you be using 'fileURLWithPath:' instead of 'URLWithString'? 
Etc, etc.


___

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

Please do not post admin requests or moderator comments to the list.
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: Differentiate FAT16 and FAT32

2010-01-11 Thread Matthias Arndt
Am 11.01.2010 um 18:36 schrieb Alastair Houghton:

> [path cStringUsingEncoding:NSASCIIStringEncoding] is wrong.  You want [path 
> filesystemRepresentation], otherwise you will have problems if there are any 
> non-ASCII characters in the provided path.

"fileSystemRepresentation", but I stand corrected.

Thanks again, Matthias

___

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

Please do not post admin requests or moderator comments to the list.
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: diagnose crashes

2010-01-11 Thread Eric E. Dolecki
Ahhh - thank you. Your help is greatly appreciated.

On Mon, Jan 11, 2010 at 12:21 PM, Alexander Spohr  wrote:

> Your App crashes in MainViewController.m line 113.
> You send a message to a dead object in there.
>
>atze
>
>
> Am 11.01.2010 um 14:50 schrieb Eric E. Dolecki:
>
> > I have an app that I am trying to debug. When I run in Simulator I have
> no
> > problems. When I am tethered to my dev machine with a device I see no
> > problems. When I'm out and about I'll get crashes when I click into a
> > UITextField in a view I flip to I'll get the crashes (sometimes)
> >
> > Using Organizer I'll check into the crashes and I don't understand them:
> >
> > Exception Type:  EXC_BAD_ACCESS (SIGBUS)
> >
> > Exception Codes: KERN_PROTECTION_FAILURE at 0x000e
> >
> > Crashed Thread:  0
> >
> >
> > Thread 0 Crashed:
> >
> > 0   libobjc.A.dylib   0x3ebc objc_msgSend + 20
> >
> > 1   ZipWeather0x3ace -[MainViewController
> > updateClock] (MainViewController.m:113)
> >
> > 2   Foundation0xdd94 __NSFireTimer + 136
> >
> > 3   CoreFoundation0x000574bc CFRunLoopRunSpecific + 2192
> >
> > 4   CoreFoundation0x00056c18 CFRunLoopRunInMode + 44
> >
> > 5   GraphicsServices  0x436c GSEventRunModal + 188
> >
> > 6   UIKit 0x3c28 -[UIApplication _run] + 552
> >
> > 7   UIKit 0x2228 UIApplicationMain + 960
> >
> > 8   MyApp 0x2c76 main (main.m:14)
> >
> > 9   MyApp   0x2c0c start + 44
> >
> >
> > Thread 0 crashed with ARM Thread State:
> >
> >r0: 0x0017bb60r1: 0x33843fc8  r2: 0x3dd612f7  r3:
> 0xbf7e98fd
> >
> >r4: 0x0006r5: 0x0038  r6: 0x0017bb60  r7:
> 0x24c0
> >
> >r8: 0x33843fc8r9: 0x001fc098 r10: 0x00105bf0 r11:
> 0x00105ce0
> >
> >ip: 0xa07csp: 0x2370  lr: 0x3ad5  pc:
> 0x3090febc
> >
> >  cpsr: 0x000f0010
> >
> >
> > Any ideas based on the above?
> > ___
> >
> > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> >
> > Please do not post admin requests or moderator comments to the list.
> > Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> >
> > Help/Unsubscribe/Update your Subscription:
> > http://lists.apple.com/mailman/options/cocoa-dev/atze%40freeport.de
> >
> > This email sent to a...@freeport.de
>
>


-- 
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: "Bindings"; Was: whether property in Cocoa class is KVO-compliant?

2010-01-11 Thread Mike Abdullah

On 11 Jan 2010, at 17:01, Jerry Krinock wrote:

> 
> On 2010 Jan 11, at 03:47, Quincey Morris wrote:
> 
>> On Jan 10, 2010, at 19:58, Jerry Krinock wrote:
>> 
>>>  toObject:segmentedControl
>> 
>> You *didn't* "bind an NSSegmentedControl to its window controller", you 
>> actually bound a window controller['s "foo" binding] to [the 
>> "selectedSegment" property of] a NSSegmentedControl.
> 
> Oops, you're correct.  Like the method says, bind:*to*:segmentedControl.
> 
>> IIRC the bindings documentation isn't clear which direction "is bound to" 
>> refers to and/or it gives the impression that a binding is symmetric (which 
>> it may effectively be at the level of notifications, but it isn't at the 
>> level of establishing bindings between objects).
> 
> When I first heard the word "binding", from other uses in English, I assumed 
> that it was two-way, and labored under this incorrect assumption for quite 
> awhile.  Now I know that a binding is only one way, and further that change 
> data flows in the *opposite* direction of the *to*.  That is, if I bind 
> myself *to* you, I observe what you do and your changes flow back *to* me.
> 
> I wonder why bindings was not as an extension of KVO, instead of as a 
> separate sideshow.  The effect is the same as KVO, with the addition that a 
> designated setter is automatically invoked in the observer when a change is 
> observed.

What makes you say this? Bindings do work by using KVO. The default 
implementation calls -setValue:forKey: when it detects a change, but any object 
is free to handle a binding any way it likes. (Most of AppKit as far as I can 
tell uses a customised process that doesn't retain the target 
object).___

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

Please do not post admin requests or moderator comments to the list.
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


TableView cells refuse to draw white!

2010-01-11 Thread Gerd Knops
I think I am loosing my mind!

In my custom TableView cells I draw the background like so:

[[NSColor xxxColor]set];
NSRectFill(interiorFrame);

It works fine for xxx=red, green etc. But for [NSColor whiteColor] the 
background stays gray (the table views background).

Any ideas?

Thanks

Gerd

___

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

Please do not post admin requests or moderator comments to the list.
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: if statement causing 32 Byte leak?

2010-01-11 Thread Joar Wingfors
...which, again, is why the approach that Instrument takes is such a  
good one.


j o a r



On Jan 11, 2010, at 9:02, Scott Ribe  wrote:


It has been my experience that some of the hardest bugs were stale
references left in autorelease pools. However it has not often been my
experience that the last release is my actual bug.

___

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

Please do not post admin requests or moderator comments to the list.
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: "Bindings"; Was: whether property in Cocoa class is KVO-compliant?

2010-01-11 Thread Jerry Krinock

On 2010 Jan 11, at 09:46, Mike Abdullah wrote:

>> I wonder why bindings was not as an extension of KVO, instead of as a 
>> separate sideshow.  The effect is the same as KVO, with the addition that a 
>> designated setter is automatically invoked in the observer when a change is 
>> observed.
> 
> What makes you say this?

Because when bindings observes a change, it uses KVO *and* invokes a special 
observer method, as you note ...

> Bindings do work by using KVO. The default implementation calls 
> -setValue:forKey: when it detects a change, but any object is free to handle 
> a binding any way it likes.

Well, I guess I'm talking about the default implementation then.  I just mean 
I'd probably have an easier time learning bindings if they were called maybe 
"KVO Plus", and somehow used a class' regular properties on both ends of a 
binding, instead of defining this separate "bindings" namespace with 
definitions that often duplicate the regular properties.

___

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

Please do not post admin requests or moderator comments to the list.
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: "Bindings"; Was: whether property in Cocoa class is KVO-compliant?

2010-01-11 Thread mmalc Crawford

On Jan 11, 2010, at 9:01 am, Jerry Krinock wrote:

> I wonder why bindings was not as an extension of KVO, instead of as a 
> separate sideshow.  The effect is the same as KVO,
> 
It's not at all. Bindings uses KVO to ensure that "things" are kept 
synchronised; KVO is a general mechanism that allows one object to receive a 
notification when the value of a property changes. What it does in response is 
entirely up to it.

mmalc

___

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

Please do not post admin requests or moderator comments to the list.
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: TableView cells refuse to draw white!

2010-01-11 Thread Gerd Knops
Never mind... Someone had switched the BG color from a very light gray to 
white... :-o

On Jan 11, 2010, at 11:46 AM, Gerd Knops wrote:

> I think I am loosing my mind!
> 
> In my custom TableView cells I draw the background like so:
> 
>   [[NSColor xxxColor]set];
>   NSRectFill(interiorFrame);
> 
> It works fine for xxx=red, green etc. But for [NSColor whiteColor] the 
> background stays gray (the table views background).
> 
> Any ideas?
> 
> Thanks
> 
> Gerd
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/gerti-cocoadev%40bitart.com
> 
> This email sent to gerti-cocoa...@bitart.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: Enabling NSZombieEnabled programatically

2010-01-11 Thread Kyle Sluder
On Mon, Jan 11, 2010 at 9:16 AM, Scott Ribe  wrote:
> static int zombiefoo = EnableZombies();

This is not a valid initializer. Initializers must be constant expressions.

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


Core Data Document based app need some help

2010-01-11 Thread Pavel V Subach

How to create Entity with next content:

schema:
Center of telecommunication | City

content:
1 | 1
1 | 2
1 | 3
2 | 4
2 | 5
2 | 6
2 | 7
... | ...

for use in two NSComboBox in next rules:

1) Choose Center of Telecommunication
2) Choose City (restricted list by choosing Center of Telecommunication)

Thank for help
___

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

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

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

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


Hyperlinks in Table Views

2010-01-11 Thread David Doyle
Hi all;

I'm trying to display a list of clickable hyperlinks inside a table view. The 
current approach I'm taking is to use a table column with a NSTextFieldCell 
data cell, with a value attribute that is bound to an attributed string value, 
constructed in a value transformer:

- (id)transformedValue: (id)value
{
NSString *siteURL = @"http://example.org";;
NSString *siteDisplayString = (NSString *)value;


NSMutableAttributedString *hyperlink = [[NSMutableAttributedString alloc] 
initWithString: siteDisplayString];
NSRange range = NSMakeRange(0, [siteDisplayString length]);


[hyperlink beginEditing];
[hyperlink addAttribute: NSLinkAttributeName
  value: [NSURL URLWithString: siteURL]
  range: range];
[hyperlink addAttribute: NSForegroundColorAttributeName
  value: [NSColor blueColor]
  range: range];
[hyperlink addAttribute: NSUnderlineStyleAttributeName
  value: [NSNumber numberWithInt: NSSingleUnderlineStyle]
  range: range];
[hyperlink addAttribute: NSFontAttributeName
  value: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: 
NSSmallControlSize]]
  range: range];
[hyperlink endEditing];
return [[hyperlink copy] autorelease];
}

This value transformer is used to transform an array of strings. This 
particular value transformer works well when transforming a single string for 
use in an NSTextField. My problem is that this hyperlink won't respond to 
mouseDown: events in the table view unless the cell is edited, which isn't the 
behaviour I want (it should open the hyperlink with a single click, and the 
table column shouldn't be editable). Am I missing something from this approach? 
Failing that, is there a different (better?) approach of displaying a list of 
hyperlinks?

Thanks in advance,

David


Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United 
Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.
___

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

Please do not post admin requests or moderator comments to the list.
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: CGPathMutable updating?

2010-01-11 Thread Eric E. Dolecki
I am using a CGPathMutable to draw the hand on an analog clock:

minuteHandPath = CGPathCreateMutable();

CGPathMoveToPoint(minuteHandPath, nil, center.x, center.y);

CGPathAddLineToPoint(minuteHandPath, nil, center.x, center.y - 105);

CGPathCloseSubpath(minuteHandPath);

minuteHandLayer = [CAShapeLayer layer];

minuteHandLayer.path = minuteHandPath;

UIColor *myStrokeColor2 = [UIColor colorWithHue:0.6 saturation:0.24
brightness:0.71 alpha:1.0];

minuteHandLayer.strokeColor = myStrokeColor2.CGColor;

minuteHandLayer.lineWidth = 2.0;

[rootLayer addSublayer:minuteHandLayer];


In another method I would like to update this, say to change the color of
it. How can I do this? Presently I have tried:


- (void) myMethod {

minuteHandPath = CGPathCreateMutable();

//...

}


This gives me an error. I don't see a way yet to clear the path out and
redraw it using CGPathMoveToPoint, etc.


?
___

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

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

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

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


Re: Enabling NSZombieEnabled programatically

2010-01-11 Thread Scott Ribe
> This is not a valid initializer. Initializers must be constant expressions.

Oops, my C++ is showing ;-)

-- 
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice


___

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

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

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

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


What's the right way to make the last (or only) table column fill the width of an NSTableView?

2010-01-11 Thread Charles Jenkins


I'm working on the examples in the (fantastic) Hillegass book.

The ZIP Inspector program works as advertised, but I'm annoyed by the 
fact that the filenames shown in the Table View get truncated due to the 
width of their column, which does not resize no matter how big I make 
the Table View. (The Table View resizes with the window, and I've set 
the column's Max Width to 1.)


In case it matters, I'm running on Snow Leopard.

I'm surprised that when a Table View contains only one column, Apple 
didn't design it to automatically fill the view. I have messed with the 
table's autoresize settings in every way I can think of, but despite 
what the NSTableViewColumnAutoresizingStyle 
 
settings' descriptions say, NONE of them changes the width of the column 
automatically.


I have come up with a solution involving KVO, but it was so difficult 
that I feel it must not be correct.


Anyone know of a combination of IB settings that will really, truly make 
the last (or only) table column really, truly expand to fit the width of 
the table view?

___

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

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

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

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


Re: What's the right way to make the last (or only) table column fill the width of an NSTableView?

2010-01-11 Thread Jerry Krinock

On 2010 Jan 11, at 10:58, Charles Jenkins wrote:

> Anyone know of a combination of IB settings that will really, truly make the 
> last (or only) table column really, truly expand to fit the width of the 
> table view?

You must tell the column also.  Inspect your Table Column in Interface Builder. 
 In the Attributes pane, check the box "Resizes with 
Table".___

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

Please do not post admin requests or moderator comments to the list.
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: Hyperlinks in Table Views

2010-01-11 Thread Jerry Krinock
This might help you:

http://developer.apple.com/mac/library/releasenotes/cocoa/AppKitOlderNotes.html#NSTableView

Note especially the section titled "NSTableView/NSOutlineView - Single click to 
edit"

___

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

Please do not post admin requests or moderator comments to the list.
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: "Bindings"; Was: whether property in Cocoa class is KVO-compliant?

2010-01-11 Thread Quincey Morris
On Jan 11, 2010, at 10:04, Jerry Krinock wrote:

> Well, I guess I'm talking about the default implementation then.  I just mean 
> I'd probably have an easier time learning bindings if they were called maybe 
> "KVO Plus", and somehow used a class' regular properties on both ends of a 
> binding, instead of defining this separate "bindings" namespace with 
> definitions that often duplicate the regular properties.

My *guess* is that bindings were originally intended to use properties on both 
ends (note that the -[NSObject bind: ...] documentation *still* says this), but 
developed from there so that one end was something more general with its own 
namespace. To me, the Cocoa Bindings Reference document reads as if it were 
written under this incorrect assumption, and then not-quite-thoroughly 
corrected later. That's one piece of documentational obscurity.

Binding *are* bi-directional, in the general sense that they're supposed to 
allow a property value to be modified from either end of the binding. However, 
the individual frameworks technology pieces from which bindings are constructed 
are all uni-directional. That's another piece of documentational obscurity.

I only recently figured out that Cocoa binding != binding: although all Cocoa 
bindings are bindings, not all bindings are Cocoa bindings. That's a third 
piece of documentational obscurity -- although the fact that it took me 2 years 
to figure it out possibly reflects badly on me rather than the documentation.

I now believe that Cocoa bindings are distinguished by (amongst other things) 
special (meaning, going beyond KVC) handling for key paths involving 
NSController objects, although this is undocumented apart from the occasional 
hint. More documentational obscurity.


___

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

Please do not post admin requests or moderator comments to the list.
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 Document based app need some help

2010-01-11 Thread Quincey Morris
On Jan 10, 2010, at 16:15, Pavel V Subach wrote:

> How to create Entity with next content:
> 
> schema:
> Center of telecommunication | City
> 
> content:
> 1 | 1
> 1 | 2
> 1 | 3
> 2 | 4
> 2 | 5
> 2 | 6
> 2 | 7
> ... | ...
> 
> for use in two NSComboBox in next rules:
> 
> 1) Choose Center of Telecommunication
> 2) Choose City (restricted list by choosing Center of Telecommunication)

It looks like you should *not* be using NSComboBox for this. A combo box is a 
kind of text field, not a kind of menu. It looks like you want menus.

That implies your entity should have two numeric properties, which represent 
choices from two fixed menus that list the Center of Telecommunication and City 
names that you present to the user.


___

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

Please do not post admin requests or moderator comments to the list.
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: Displaying contents of more than one NSManagedObjectContext?

2010-01-11 Thread Oftenwrong Soong
Hi Rick,

It is my limited understanding of core data that you can load as many managed 
object *models* as you want into a managed object context to obtain the union 
of all those models. You may want to look at the core data command line 
tutorial, which shows how to write a non-gui console-based program that uses 
core data. None of the "magic" is present and everything is done 
programmatically. This tutorial may be of use in showing you how to load 
multiple models.

Hope this is helpful,
Soong



- Original Message 
From: Rick Mann 
To: Cocoa Developer 
Sent: Wed, December 30, 2009 10:54:18 AM
Subject: Displaying contents of more than one NSManagedObjectContext?

Hi. I have an app that has the concept of parts libraries. I would like for my 
app to be able to open any number of library documents, each with its own 
NSManagedObjectContext, but display the parts palette as a single UI showing 
the union of all parts.

Is this possible, or will I have to perform some Core Data gymnastics to load 
everything into a separate, new context for use in display?

TIA,
Rick


  
___

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

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

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

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


Re: receiving events

2010-01-11 Thread Oftenwrong Soong
Hi Ariel,

I'm afraid it's a bit difficult to understand your question. Are you attempting 
to insert a full-screen view into the responder chain?

Thanks,
Soong



- Original Message 
From: Ariel Feinerman 
To: Cocoa Development 
Sent: Mon, December 7, 2009 12:17:57 PM
Subject: receiving events

Hi,
in Apple`s reference library, examples the event stream looks like following:
NSApplication -> NSWindow -> NSView / custom View / OpenGLView or any
NSResponder-inherited class; If a display is captured (for OpenGL)
does view receive any events or not? if not and if app for example
works in fullscreen only mode, can we do not create NSWindow instance
at all?

I cannot find answer in mailing lists or other sources.

--
best regards
Ariel
___

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

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

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

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



  
___

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

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

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

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


Re: Open new document from within another document.

2010-01-11 Thread Jeffrey Andrews
The document doesn't pop up a new window.  The delegate does get  
called, but doc is nil.  But, if I use [[NSWorkspace sharedWorkspace]  
openFile:path withApplication:@"MyAppName"], it works.

I just thought that I shouldn't have to rely on NSWorkspace.

I will try your suggestion of using the newer method.  I thought that  
the fileURLWithPath includes "file://" that I don't want.  Other  
examples show URLWithString, too.


Thanks, Quincey.

On Jan 11, 2010, at 12:41 PM, Quincey Morris wrote:


On Jan 11, 2010, at 05:43, Jeffrey Andrews wrote:

I am stumped.  I am trying to open another document from within a  
document.  My AppController implements the delegate method


-(BOOL) application:(NSApplication*) sender openFile:(NSString*)path
{
NSLog(@"AppController - application:openFile - %@", path);
	NSDocumentController* dc = [NSDocumentController  
sharedDocumentController];
	id doc = [dc openDocumentWithContentsOfURL:[NSURL  
URLWithString:path] display:YES];

return (doc != nil);
}


...

How else should I handle opening another window with the file  
specified?


Yes, but you didn't say what happens. Does the delegate method get  
invoked? Is 'doc' nil? What happens if you use the non-deprecated  
'openDocumentWithContentsOfURL:display:error:' instead? Is there an  
error returned? Shouldn't you be using 'fileURLWithPath:' instead of  
'URLWithString'? Etc, etc.



___

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

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

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

This email sent to jeff...@quackerjack.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


setTailIndent problems

2010-01-11 Thread Fabry, Geza
Hi,

I try to set tailIndent for an NSMutableParagraphStyle attribute of an 
NSMutableAttributedString. The documentation says:
   "If positive, this is the distance from the leading margin (for example, the 
left margin in left-to-right text). That is, it's the absolute line width. If 0 
or negative, it's the distance from the trailing margin-the value is added to 
the line width."
I found however that both positive and negative values are measured from the 
right margin, positive values make the text narrower, negative values make it 
wider. (The same seems to be true for kCTParagraphStyleSpecifierTailIndent in 
CoreText).
Is it a bug in the documentation, in functionality or in my code?
Thanks,
Geza
___

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

Please do not post admin requests or moderator comments to the list.
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: Open new document from within another document.

2010-01-11 Thread Quincey Morris
On Jan 11, 2010, at 12:22, Jeffrey Andrews wrote:

> I thought that the fileURLWithPath includes "file://" that I don't want.  
> Other examples show URLWithString, too.

AFAIK, you use 'fileURLWithPath' when you have a path string with no scheme, 
and URLWithString when you do have a scheme at the start of the string.

So likely what's happening is that in the cases that work, you're being given 
an 'openFile:' parameter that already has the "file:" scheme in 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: Question about garbage collection

2010-01-11 Thread Oftenwrong Soong
I believe it will because there will be no pointer to each allocated string 
after a new one is allocated. Note that it won't be deallocated immediately. It 
will be deallocated when the collector runs.



- Original Message 
From: Michael Abendroth 
To: cocoa-dev@lists.apple.com
Sent: Sun, January 3, 2010 9:59:01 AM
Subject: Question about garbage collection

Hi all,

When I write something like:

while (true) {
   NSString *s = [[NSString alloc] initWithString:@"applejuice"];
}

Will s be garbage collected? If not, how can I make sure it does get
deallocated by garbage collection.
___

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

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

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

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



  
___

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

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

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

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


Re: Core Data Document based app need some help

2010-01-11 Thread Oftenwrong Soong


On Mon, January 11, 2010 12:11:34 PM, Quincey Morris 
 wrote:
> It looks like you should *not* be using NSComboBox for this. A combo box is a
> kind of text field, not a kind of menu. It looks like you want menus.


Yeah. Try using a pop-up button instead. That's a kind of menu.



  
___

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

Please do not post admin requests or moderator comments to the list.
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: Drawing A Mutable String

2010-01-11 Thread Andy Lee
Bizarre.  I love bugs like this that it's easy to prove can't possibly be 
happening. :)

The only desperate, farfetched suggestion I have is that somehow you've 
accidentally created two instances of your GameView, only one of which is 
visible, and for some reason when invalidStack is true, the correct drawing 
*is* happening but in the wrong view.  I would think this would be obvious if 
it were the case, but still, what if you add the following line?

NSLog(@"%@ -- %p", [self className], self);

Do you always see the same pointer value printed?  As I said, farfetched, but I 
see that like me, you like to test the most basic assumptions.

Also, I assume you aren't calling drawRect: directly, right?  Or 
setNeedsDisplay:NO, or any other dirty rect manipulation?

I'd be willing to look at the code, with complete respect for confidentiality, 
if you're trusting enough to send it to me and at liberty to do so.

--Andy


On Monday, January 11, 2010, at 12:25PM, "Michael Craig"  
wrote:
>Andy: There's nothing drawing over it. I can move that chunk of code to the
>end of drawRect: with the same result.
>
>Quincy: rightAligned is a paragraph style object that's defined elsewhere in
>drawRect and used in a few different places.
>
>Fritz: All four things you mention are apparently true when I run it through
>the debugger, so the if statement must be working. What's more, I can see
>that it's working by inserting a printf inside (or after) the if and seeing
>the fully appended string there.
>
>How is it possible that I can append the value of infoStr, see that new
>value at the console with printf, then draw it and get the old value?
>
>Also, I can appended another string to infoStr after the invalidStack if
>statement and it gets drawn (always, since it's not in an if), but the
>string appended in the invalidStack if statement still doesn't get drawn.
>They both show up in the console when I printf infoStr, but the invalidStack
>piece in the middle of the string is left out when infoStr is drawn.
>
>Gah!
>
>Michael S Craig
>(908) 328 8030
>
>
>On Thu, Jan 7, 2010 at 4:18 PM, Fritz Anderson wrote:
>
>> On 7 Jan 2010, at 2:29 PM, Michael Craig wrote:
>>
>> >if ([theDeck.cardPile count] == 0) {
>> >[infoStr appendString: @"\n\nThe deck is empty."];  //
>> > *2*
>> >}
>> >if (gameCon.invalidStack) {
>> >[infoStr appendString: @"\n\nThat's an invalid stack."];//
>> > *1*
>> >}
>> >[infoStr drawInRect: infoRect
>> >withAttributes: infoAtts];
>> ...
>> > If I move the line marked *1* to come after the line marked *2*, then
>> both
>> > messages are drawn when the deck is empty, as one would expect.
>> >
>> > If I move the line marked *1* one line down (so it's outside of the
>> > invalidStack if statement and the if is empty), then invalidStack message
>> is
>> > drawn at all times, as one would expect.
>> >
>> > So what is keeping it from drawing the appended text when it happens
>> inside
>> > the invalidStack if statement? Like I said above, the if statement itself
>> > works fine.
>>
>> I don't understand why you say "the if statement works fine." You say it
>> doesn't execute its body when you think its condition is true. That means it
>> doesn't work fine, doesn't it?
>>
>> When you execute this code line-by-line in the debugger, do you see with
>> your own eyes:
>>
>> • gameCon (assuming it is an object pointer) is not nil?
>> • gameCon.invalidStack is non-zero?
>> • Control ever reaches line 1?
>> • infoStr changes content?
>>
>>— 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/aglee%40mac.com
>
>This email sent to ag...@mac.com
>
>
___

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

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

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

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


Re: iPhone: CGPathMutable updating?

2010-01-11 Thread Eric E. Dolecki
Nevermind - I found out my problem. Sorry for the noise.

On Mon, Jan 11, 2010 at 1:30 PM, Eric E. Dolecki  wrote:

> I am using a CGPathMutable to draw the hand on an analog clock:
>
> minuteHandPath = CGPathCreateMutable();
>
> CGPathMoveToPoint(minuteHandPath, nil, center.x, center.y);
>
> CGPathAddLineToPoint(minuteHandPath, nil, center.x, center.y - 105);
>
> CGPathCloseSubpath(minuteHandPath);
>
> minuteHandLayer = [CAShapeLayer layer];
>
> minuteHandLayer.path = minuteHandPath;
>
> UIColor *myStrokeColor2 = [UIColor colorWithHue:0.6 saturation:0.24
> brightness:0.71 alpha:1.0];
>
> minuteHandLayer.strokeColor = myStrokeColor2.CGColor;
>
> minuteHandLayer.lineWidth = 2.0;
>
> [rootLayer addSublayer:minuteHandLayer];
>
>
> In another method I would like to update this, say to change the color of
> it. How can I do this? Presently I have tried:
>
>
> - (void) myMethod {
>
> minuteHandPath = CGPathCreateMutable();
>
> //...
>
> }
>
>
> This gives me an error. I don't see a way yet to clear the path out and
> redraw it using CGPathMoveToPoint, etc.
>
>
> ?
>



-- 
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: iPhone interruption with OpenAL?

2010-01-11 Thread E. Wing
The quick answer is no. Assuming iPhone OS 3.0+, you must
suspend/disable the OpenAL context by making the current context NULL.
And if you have an iPod Touch, you can use the Clock.app's alarm
feature to help test interruptions.

FYI, I cover iPhone audio and OpenAL in excruciating detail
(attempting to be the authoritative OpenAL ref) in the book I am
co-authoring:
Beginning iPhone Games Development
http://tinyurl.com/beginningiphonegamesdev
(Hope to be finished and shipping very soon now.)

As to not stray too far from the topic of Cocoa, I also have a simple
example with the book that demonstrates how to use NSInvocation to
queue messages sent to play sounds in OpenAL while the interruption is
in progress with the intent to play them when the interruption ends.

Thanks,
Eric



On 1/10/10, Hank Heijink (Mailinglists)  wrote:
> Check the docs:
>
> http://developer.apple.com/iphone/library/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/HandlingAudioInterruptions/HandlingAudioInterruptions.html
>
> There's a section called "OpenAL and Audio Interruptions" that explains it.
>
> Good luck,
> Hank
>
> On Jan 10, 2010, at 4:23 AM, Chunk 1978 wrote:
>
>> i'm using an interruption listener callback with audiotoolbox to shut
>> off music when a call (or something else) comes in to interrupt the
>> app.  however, i'd simply like to remove all AVFoundation from the
>> code and strictly rely on OpenAL for sound.  will OpenAL automatically
>> pause like the rest of the app when a call comes in?  the reason i'm
>> asking this simple question is because i don't have an iPhone for
>> testing.
>> ___
>>
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/hank.list%40runbox.com
>>
>> This email sent to hank.l...@runbox.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/ewmailing%40gmail.com
>
> This email sent to ewmail...@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: iPhone endInterruption delegate method killing OpenAL

2010-01-11 Thread E. Wing
On 1/11/10, Chunk 1978  wrote:
> i can't figure out what it wrong with my code (attached .m file).  i'm
> playing a looping sound with OpenAL, which becomes interrupted by an
> alarm.  when i quit the alarm, my endInterruption delegate method is
> activated, and a new OpenAL session is started but i can no longer
> play sounds.  i've also tested other games i've downloaded from the
> app store and their sound is also killed after an interruption from
> the alarm.  what is wrong with my code?
>

This probably should be moved to the Core Audio list. But, in an
attempt to solve this thread...

First, when you use AudioSessionInitialize, the callback function you
pass as a parameter is the interruption callback, not delegate
methods. You only get delegate callbacks if you use AVAudioSession
and/or AVAudioPlayer. In your code, interruptionListenerCallback() is
the callback function. It happens to call beginInterruption and
endInterruption in your code. You should debug this function to make
sure it is being invoked on the begin and end interruption events.
Make sure your if/else-if logic is correct.

Second, in your beginInterruption method, you have:
AudioSessionSetActive(YES);
in two cases. I'm not sure why this is. And I don't think this is
right. I don't think the AudioSession should be made active while
going into an interruption.

Third, setting AudioSessionSetActive(NO); in beginInterruption I think
is unnecessary. However, I don't expect it to hurt either.

Fourth, you have an error in shutdownOpenAL. You need to call
alcMakeContextCurrent(NULL); before you destroy the context. It is
technically an OpenAL error to destroy an active OpenAL context. This
may also be impacting your startupOpenAL code because I don't know
what will happen when you try to close the device that has an active
context and then try to reopen the device and create a new context
after these errors.

A helpful thing to try is check OpenAL and AudioSession errors to see
what's going on.

As an aside, in iPhone OS 3.0+ doesn't require you to completely
teardown and restart OpenAL. This is in the docs and also my book
mentioned in the other message thread you posted.

Fifth, the isiPodAudioPlaying stuff in beginInterruption and
setupAudioCategorySilenceIpod I find confusing. Particularly, in
beginInterruption I don't think you should be changing the session
categories. Your focus should be solely on suspending audio. I
recommend commenting out those pieces of code while debugging this.
Just focus on one category to start with and don't change it.

Further questions should probably be moved to the Core Audio list.

-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


how do you set the value of a UIPickerView programatically?

2010-01-11 Thread Paul Archibald
I have a couple of pickers in my app, and when they are displayed I  
want them to show their current values. I have tried:


-(IBAction) setThePicker:(id) sender {
[picker selectRow:3 inComponent:0 animated:YES];
}

(hooked to a button, as a test) as well as just calling

[picker selectRow:indexOfCurrentValue inComponent:0 animated:YES];

from within my viewDidLoad method, but the picker does not change. I  
am pretty sure my XIB is set up right and connected to the code.


I have found some sample code that seems like it should work, but it  
doesn't. Anyone know how to make this work?


___

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

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

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

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


Re: how do you set the value of a UIPickerView programatically?

2010-01-11 Thread Dave DeLong
What does NSLog(@"%@", picker); print out?

Dave

On Jan 11, 2010, at 5:14 PM, Paul Archibald wrote:

> I have a couple of pickers in my app, and when they are displayed I want them 
> to show their current values. I have tried:
> 
> -(IBAction) setThePicker:(id) sender {
>   [picker selectRow:3 inComponent:0 animated:YES];
> }
> 
> (hooked to a button, as a test) as well as just calling
> 
>   [picker selectRow:indexOfCurrentValue inComponent:0 animated:YES];
> 
> from within my viewDidLoad method, but the picker does not change. I am 
> pretty sure my XIB is set up right and connected to the code.
> 
> I have found some sample code that seems like it should work, but it doesn't. 
> Anyone know how to make this work?


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: if statement causing 32 Byte leak?

2010-01-11 Thread Paul Sanders
Yes, I think I took a step too far there.

Paul Sanders.

On Jan 11, 2010, at 9:02, Scott Ribe 
 wrote:

> It has been my experience that some of the hardest bugs were 
> stale
> references left in autorelease pools. However it has not often 
> been my
> experience that the last release is my actual bug.



___

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

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

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

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


Re: What's the right way to make the last (or only) table column fill the width of an NSTableView?

2010-01-11 Thread Charles Jenkins
"Resizes with Table" does not help. I knew there'd be no chance of getting the 
behavior I want without that, so I never unchecked it. I'm sorry I forgot to 
mention that in my original post.

> 
> On 2010 Jan 11, at 10:58, Charles Jenkins wrote:
> 
> > Anyone know of a combination of IB settings that will really, truly > make 
> > the last (or only) table column really, truly expand to fit the > width of 
> > the table view?
> 
> You must tell the column also.  Inspect your Table Column in Interface > 
> Builder.  In the Attributes pane, check the box "Resizes with Table".> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/cjenkins%40tec-usa.com
> 
> This email sent to cjenk...@tec-usa.com

___

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

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

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

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


Re: iPhone endInterruption delegate method killing OpenAL

2010-01-11 Thread Chunk 1978
thanks for the reply, eric.

i've been sorting thru apple's sample code and other snippets online
to try and make this work.  i've noticed that apple doesn't set the
current context to null before destroying it in their sample code for
"MusicCube". however, i will trust your insight.

also, i just pre-ordered your book from amazon - lord knows i need it!  lol

thanks again


On Mon, Jan 11, 2010 at 5:26 PM, E. Wing  wrote:
> On 1/11/10, Chunk 1978  wrote:
>> i can't figure out what it wrong with my code (attached .m file).  i'm
>> playing a looping sound with OpenAL, which becomes interrupted by an
>> alarm.  when i quit the alarm, my endInterruption delegate method is
>> activated, and a new OpenAL session is started but i can no longer
>> play sounds.  i've also tested other games i've downloaded from the
>> app store and their sound is also killed after an interruption from
>> the alarm.  what is wrong with my code?
>>
>
> This probably should be moved to the Core Audio list. But, in an
> attempt to solve this thread...
>
> First, when you use AudioSessionInitialize, the callback function you
> pass as a parameter is the interruption callback, not delegate
> methods. You only get delegate callbacks if you use AVAudioSession
> and/or AVAudioPlayer. In your code, interruptionListenerCallback() is
> the callback function. It happens to call beginInterruption and
> endInterruption in your code. You should debug this function to make
> sure it is being invoked on the begin and end interruption events.
> Make sure your if/else-if logic is correct.
>
> Second, in your beginInterruption method, you have:
> AudioSessionSetActive(YES);
> in two cases. I'm not sure why this is. And I don't think this is
> right. I don't think the AudioSession should be made active while
> going into an interruption.
>
> Third, setting AudioSessionSetActive(NO); in beginInterruption I think
> is unnecessary. However, I don't expect it to hurt either.
>
> Fourth, you have an error in shutdownOpenAL. You need to call
> alcMakeContextCurrent(NULL); before you destroy the context. It is
> technically an OpenAL error to destroy an active OpenAL context. This
> may also be impacting your startupOpenAL code because I don't know
> what will happen when you try to close the device that has an active
> context and then try to reopen the device and create a new context
> after these errors.
>
> A helpful thing to try is check OpenAL and AudioSession errors to see
> what's going on.
>
> As an aside, in iPhone OS 3.0+ doesn't require you to completely
> teardown and restart OpenAL. This is in the docs and also my book
> mentioned in the other message thread you posted.
>
> Fifth, the isiPodAudioPlaying stuff in beginInterruption and
> setupAudioCategorySilenceIpod I find confusing. Particularly, in
> beginInterruption I don't think you should be changing the session
> categories. Your focus should be solely on suspending audio. I
> recommend commenting out those pieces of code while debugging this.
> Just focus on one category to start with and don't change it.
>
> Further questions should probably be moved to the Core Audio list.
>
> -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:Re: Core Data Document based app need some help

2010-01-11 Thread Pavel V Subach

Quincey Morris wrote:
It looks like you should *not* be using NSComboBox for this. A combo  
box is a kind of text field, not a kind of menu. It looks like you  
want menus.


That implies your entity should have two numeric properties, which  
represent choices from two fixed menus that list the Center of  
Telecommunication and City names that you present to the user.



No, i want this:
1) User choose in ComboBox their CT such as "Kemerovskoye" and in the  
City Combo Box i need see example two city "Topki" and "Kemerovo"
2) User choose in CT "Yuzhnoye" and in City they can choose only  
"Miski" or "Tashtagol"


how it done ? help please... i'm newbe in XCode and CoreData :)
--
Pavel V Subach
http://forum.koug.org




___

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

Please do not post admin requests or moderator comments to the list.
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 garbage collection

2010-01-11 Thread John Engelhart
On Sun, Jan 3, 2010 at 1:40 PM, Bill Bumgarner  wrote:

>
> The stack has to be conservatively scanned because the C ABI makes no
> guarantee about stack layout and the compiler is free to put values wherever
> it sees fit,


Strictly speaking, the "C" ABI does not require that a function use "the
stack" to hold temporary values (or, in C terms, variables that have an
automatic storage duration / 'auto' storage class).  In fact, the C language
does not even require the use of a stack- the word "stack" does not even
appear in the standard(s).


> including overwriting values with other values as a part of optimization
> (which is the same reason why you sometimes can't print local variable's
> values when debugging optimized code).
>

This, on the other hand, is simply not true.  While the "C" ABI does not
cover this, the C language standard is very specific about such things.
 Section 5.1.2.3 from the C89 (ISO/IEC 9899:1990) standard states the
following:

"An instance of each object with automatic storage duration is associated
with each entry into its block. Such an object exists and retains its
last-stored value during the execution of the block and while the block is
suspended (by a call of a function or receipt of a signal)."

The C99 standard says essentially the same thing in section 6.2.4.

Optimization walks a fine line between "strict compliance with the abstract
machine semantics specified in the C language standard" and "the actual
semantics of the optimized code".  Or, in the words of the C89 standard:

"An implementation might define a one-to-one correspondence between abstract
and actual semantics: at every sequence point, the values of the actual
objects would agree with those specified by the abstract semantics. The
keyword volatile would then be redundant.

Alternatively, an implementation might perform various optimizations within
each translation unit, such that the actual semantics would agree with the
abstract semantics only when making function calls across translation unit
boundaries. In such an implementation, at the time of each function entry
and function return where the calling function and the called function are
in different translation units, the values of all externally linked objects
and of all objects accessible via pointers therein would agree with the
abstract semantics. Furthermore, at the time of each such function entry the
values of the parameters of the called function and of all objects
accessible via pointers therein would agree with the abstract semantics."

It's fair to say that the majority of worthwhile optimizations result in
some amount of "strict abstract machine semantics", and so an awful lot of
effort goes in to determining whether or not such an optimization can be
done "safely".  It's not uncommon for a potential optimization to be culled
from consideration because there exists an extremely remote possibility that
such an optimization could cause the effects of the abstract machine
semantics violation to become "visible" to the program.  That's why function
calls are the usual demarcation point- the compiler has complete control of
the visible state (or, abstract machine semantics compliance) up to that
point, but often can't control it past the function call.

This is why the Cocoa GC system is broken when you turn the optimizer on.
 The gcc optimizer has decades worth of assumptions that it is "in complete
control" of when the violations of "strict abstract machine semantics"
become 'visible' to code that is out of its control (i.e., across a function
call boundary). In a nutshell, it has a mental model that the code it's
generating operates in something akin to "single threaded mode". The GC
collector runs asynchronously (at least, for most uses of the Cocoa
collector) relative to the flow of execution for the code that the compiler
is generating / optimizing.  In short, the worst case scenario is that the
collector runs after every single instruction of the optimized code emitted
by the compiler.  Unless, of course, sufficient analysis by the optimizer
can /prove/ that the abstract machine violation caused by the optimization
(i.e., "reusing a stack slot") is indistinguishable in execution from the
strictly conforming version of the code.  Since the collector runs
completely asynchronously relative to the "current thread" that the
generated code will be executing in, this is essentially impossible (short
of inserting some kind of GC mutex barrier or "compiler assisted safe points
(http://www.hpl.hp.com/personal/Hans_Boehm/gc/conservative.html ,
http://llvm.org/docs/GarbageCollection.html )").

For all practical purposes, this means that all __strong and __weak
qualified variables really should be "automagically promoted" to volatile
qualified (i.e, NSString * volatile myString = ...).  In fact, footnote 116
of the C99 (WG14/N1256 ISO/IEC 9899:TC3) is particularly apropos with
"accessed by an asynchronously interrupting function" - '116: A volatile

Re: What's the right way to make the last (or only) table column fill the width of an NSTableView?

2010-01-11 Thread Graham Cox

On 12/01/2010, at 12:20 PM, Charles Jenkins wrote:

> "Resizes with Table" does not help. I knew there'd be no chance of getting 
> the behavior I want without that, so I never unchecked it. I'm sorry I forgot 
> to mention that in my original post.


For me I find that a column sizing "sequential" works to size only a particular 
column as the table view expands. All my columns are set to "resize with 
table", but some have the min and max limits set the same so that they are 
effectively not resizable. The column I do want resized has sensible and 
different minimum/maximum values. Bear in mind that the user can reorder 
columns, but only some of them are resizable. If a resizable column ends up on 
the right, it resizes as it should.

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


NSExtraMIData?

2010-01-11 Thread Graham Cox
Anyone got any idea what NSExtraMIData is?

I'm getting a "unrecognized selector" error logged on this class, but I've 
never heard of it.

--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: Cocoa-dev Digest, Vol 7, Issue 52

2010-01-11 Thread Paul Archibald


On Jan 11, 2010, at 4:19 PM, cocoa-dev-requ...@lists.apple.com wrote:


What does NSLog(@"%@", picker); print out?



0x138cf30>>


Does that tell you anything? It looks okay to me. At least its not  
deadbeef or nil, and the frame makes sense.

___

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

Please do not post admin requests or moderator comments to the list.
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: A password strength checker

2010-01-11 Thread Howard Siegel
If you would, please post your code some place and let us know the URL to
it.

There is supposed to be an iPhone version coming out, but I suspect that
it will be done using MonoDevelop (C#.NET for non-Windows platforms)
rather than being written in ObjC/Cocoa.

- h

On Mon, Jan 11, 2010 at 08:12, Jim Turner  wrote:

> Awesome find, Howard. I've needed a password strength algorithm in the
> past and never could find one.  Plus, the strength computed by the
> Password Assistant is questionable at best.  Given a password of
> '' (20 lowercase 'a'), the assistant scores it
> about a 20%. Add one more 'a' though and it jumps to 80%. I'm not sure
> how that one extra 'a'  is worth a 60% increase in strength. I'd be
> nice if their implementation was a bit more open for examination.
>
> The algorithm used by KeePass, however, scores both a 20-character 'a'
> and 21-character 'a' password as 10 (with 0 being no password or a
> worthless password). Seems more accurate.
>
> If anyone's interested in it, I wrote a Cocoa version of their
> implementation. I'd be happy to make it available.
>
> Jim
>
> On Thu, Jan 7, 2010 at 2:32 PM, Howard Siegel  wrote:
> > Have a look at the source code for KeePass Password Safe (
> > http://keepass.info/).  It has a password generator and strength
> > computation. Version 1.x is written in C++ for MS Windows (using MFC).
> > Version 2.x is a rewrite in C# for .NET.
> >
> > It has been ported as KeyPassX for Mac OS X and Linux.
> >
> > - h
> >
> > On Thu, Jan 7, 2010 at 11:51, Martin Hewitson <
> martin.hewit...@aei.mpg.de>wrote:
> >
> >> Dear list,
> >>
> >> Is anybody aware of a reasonable algorithm or some code that can be used
> to
> >> test/check the strength of a password? I'd like to give a kind of score
> or a
> >> color (red,yellow,green). I've looked at cracklib, but that doesn't give
> a
> >> score, really.
> >>
> >> Best wishes,
> >>
> >> Martin
> >>
> >> 
> >> Martin Hewitson
> >> Albert-Einstein-Institut
> >> Max-Planck-Institut fuer
> >>Gravitationsphysik und Universitaet Hannover
> >> Callinstr. 38, 30167 Hannover, Germany
> >> Tel: +49-511-762-17121, Fax: +49-511-762-5861
> >> E-Mail: martin.hewit...@aei.mpg.de
> >> WWW: http://www.aei.mpg.de/~hewitson<
> http://www.aei.mpg.de/%7Ehewitson>
> >> 
> >>
> >>
> >>
> >>
> >>
> >> ___
> >>
> >> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> >>
> >> Please do not post admin requests or moderator comments to the list.
> >> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> >>
> >> Help/Unsubscribe/Update your Subscription:
> >> http://lists.apple.com/mailman/options/cocoa-dev/hsiegel%40gmail.com
> >>
> >> This email sent to hsie...@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/jturner.lists%40gmail.com
> >
> > This email sent to jturner.li...@gmail.com
> >
>
___

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

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

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

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


Re: NSExtraMIData?

2010-01-11 Thread Michael Davey
I googled and found this, I hope it helps:

http://imlocation.wordpress.com/2007/09/13/strange-objects-nscftype-indicate-memory-management-bugs/


On 12 Jan 2010, at 14:54, Graham Cox wrote:

> Anyone got any idea what NSExtraMIData is?
> 
> I'm getting a "unrecognized selector" error logged on this class, but I've 
> never heard of it.
> 
> --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/frak.off%40gmail.com
> 
> This email sent to frak@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: NSExtraMIData?

2010-01-11 Thread Greg Parker
On Jan 11, 2010, at 7:54 PM, Graham Cox wrote:
> Anyone got any idea what NSExtraMIData is?
> 
> I'm getting a "unrecognized selector" error logged on this class, but I've 
> never heard of it.

It's part of NSMenu's internal implementation. 

Most likely, you over-released some other object and then an NSExtraMIData was 
allocated at the same address. When you later try to use the dead over-released 
object, the message is sent to the NSExtraMIData object.


-- 
Greg Parker gpar...@apple.com Runtime Wrangler


___

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

Please do not post admin requests or moderator comments to the list.
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: NSExtraMIData?

2010-01-11 Thread Graham Cox

On 12/01/2010, at 3:10 PM, Greg Parker wrote:

> Most likely, you over-released some other object and then an NSExtraMIData 
> was allocated at the same address. When you later try to use the dead 
> over-released object, the message is sent to the NSExtraMIData object.


OK, guessed it might be. Thanks *glum* - another MM bug to find...

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

2010-01-11 Thread Kyle Sluder
On Mon, Jan 11, 2010 at 8:13 PM, Graham Cox  wrote:
> OK, guessed it might be. Thanks *glum* - another MM bug to find...

The static analyzer is very good at what it does. Are you remembering
to Build and Analyze?

--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: What's the right way to make the last (or only) table column fill the width of an NSTableView?

2010-01-11 Thread Kyle Sluder
On Mon, Jan 11, 2010 at 10:58 AM, Charles Jenkins  wrote:
> The ZIP Inspector program works as advertised, but I'm annoyed by the fact
> that the filenames shown in the Table View get truncated due to the width of
> their column, which does not resize no matter how big I make the Table View.
> (The Table View resizes with the window, and I've set the column's Max Width
> to 1.)

I'm confused. This works out of the box for me on Snow Leopard. Drop
an NSTableView in a window, set the autoresize mask, removed the
second column, made the remaining column the width of the table view.
Works like a charm. Perhaps you aren't aware that a column will only
resize if it is already the width of the view?

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

2010-01-11 Thread Graham Cox

On 12/01/2010, at 3:50 PM, Kyle Sluder wrote:

> The static analyzer is very good at what it does. Are you remembering
> to Build and Analyze?


I sure am - that's what's such a pain, my app passes with no issues but I get 
these occasional reports from the field, but very unrepeatably.

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

2010-01-11 Thread Kyle Sluder
On Mon, Jan 11, 2010 at 8:58 PM, Graham Cox  wrote:
> I sure am - that's what's such a pain, my app passes with no issues but I get 
> these occasional reports from the field, but very unrepeatably.

That's a shame. I only mentioned it because I have a tendency to
forget to run the analyzer, only to have to commit an embarrassing
"oops" five minutes later. There's a build setting which will turn the
static analyzer on for all builds (RUN_CLANG_STATIC_ANALYZER=YES), and
that has me covered now.

--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: Custom sheet question - which variable?

2010-01-11 Thread Jenny M
Thanks guys, I think I am understanding this more now. A few more
questions...


You can do whichever you like. I tend to wander objects up and down my
> various controller and delegate chains as I write code because where I think
> I want it, I sometimes don't want it. Ask yourself this, what is this sheet
> most closely tied to? Is it something which is going to be used in the
> delegate on some kind of delegate callback? If so, you probably want the
> delegate to own it. Or is it something the WindowController really wants to
> 'own'? If that's the case then let it own it.
>

It's going to be possible to call the window from a menu selection, and not
as a sheet under the main window, so at least for now, I'd like to keep the
xib and window controller separated from the main AppDelegate. AppDelegate
is going to control the main flow, but each NSWindowController is going to
handle their own objects.



> If (in the code you posted) you're at that point in your AppDelegate then
> 'self', the thing you pass as owner, is the wrong type for the way you say
> you have your XIB configured. You need to make sure that the 'owner' is an
> object of the class you've told the XIB that File's Owner is; it can be what
> you like, but you have to be consistent. If you want it to be in your
> NSWindowController subclass, then for 'owner' you need to pass that window
> controller subclass object and the window you require will end up bound to
> some properly (you define) of that, then you pass [ yourWindowController
> thePropertyYouChose ] as the window to your sheet method.
>
>
So I do want the NSWindowController subclass as File's Owner, which means I
need a reference to the NSWindowController in the AppDelegate class. So, in
the AppDelegate.h file, I have MyNSWindowControllerSubclass
*objectWindowController, and in AppDelegate.m, I initialize it, right?

*objectWindowController = [[MyNSWindowControllerSubclass alloc]
initWithWindowNibName:@"MyObject"];

In what AppDelegate method do I need to run that code?
applicationDidFinishLaunching? init?




And don't forget, in your XIB .. you need to make the connection to the
> property in File's Owner. Oh yes it's easily said but so easily overlooked
> and you'll be asking why your sheet doesn't come up after you loaded the NIB
> and it will be because the outlet is nil because you didn't actually hook it
> up graphically in IB.
>


Haha, been there, done that! I was clicking the Close button I'd hooked up
and wondering why the function was calling but the window wasn't closing. ;)
___

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

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

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

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


Re: Custom sheet question - which variable?

2010-01-11 Thread Scott Ribe
> In what AppDelegate method do I need to run that code?
> applicationDidFinishLaunching? init?

You don't need to do that before the window is needed; you can do it from
the menu item, or from a method of the controller of the window on which the
sheet will be shown.

-- 
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice


___

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

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

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

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


Blurry UILabel text as programmatic subview of UITableViewCell's contentView

2010-01-11 Thread Alex Reynolds
I am adding a UILabel instance as a subview of my custom UITableViewCell 
instance's contentView property.

When I select the cell, the row is highlighted blue, except for the background 
of the label. The label text is sharp, but the background is white for the 
bounds of the contentView.

When I set the label and contentView backgroundColor property to "[UIColor 
clearColor]", the UILabel text becomes blurry.

How do I set the label and/or contentView background color to be clear, to 
allow the row highlight color to come through, while still keeping the label 
text sharp?

One suggestion I read elsewhere was to round() the label's frame struct values, 
but this did not have any effect.

Thanks for any advice.___

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

Please do not post admin requests or moderator comments to the list.
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


prepareSavePanel - save as or save to?

2010-01-11 Thread jeffs87

Hi,

Is there a way to tell in prepareSavePanel if the save operation is an 
NSSaveAsOperation or an NSSaveToOperation?


thanks
Jeff

___

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

Please do not post admin requests or moderator comments to the list.
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


Table object not selected on launch

2010-01-11 Thread Jenny M
When my application launches, I have a custom BackgroundView that takes the
role of first responder. Within the main window, I have a NSScrollView that
contains core data objects in an NSArrayController. I want the objects to
load in the table on launch, but I don't want any objects to be *selected*
upon launch. I've looked in IB and the docs and can't figure out which
attribute to set to make this possible. Thoughts?

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