Re: Font Panel and storing font user default

2009-06-15 Thread Stuart Malin


On Jun 15, 2009, at 6:31 PM, Stuart Malin wrote:

I am replying to my own posting with updated info, for the archives...


I would like for my app to enable the user to set a user default for a
Font to be used in a certain part of the application. I have a
preferences panel, and within that am able to open the NSFontPanel.
However, I can't figure out how to capture the setting that is made:
must I actually have some text (say in a Text View) that is edited?


I had been invoking the NSFontManager from outside the App delegate,  
which was the final place I managed to intercept the changeFont: call  
(as it rode up the Responder chain). Alas, I had tried setting the  
delegate for the Font Manager to call the object that needed the  
result of the Font Panel settings made by the user. I then had my  
"aha" when I found the -setAction and -setTarget methods; setting  
these solved that problem.


Also, I had been separately invoking the NSFontManager and the  
NSFontPanel. Rather than open an instance of the Font Panel directly,  
I have the Font Manger do it:  [fontManager orderFrontFontPanel:nil];


With these changes, my app can open the Font Panel from some  
controller other than the App delegate, and capture the settings made  
by the user.


For completeness, the invoking method code is (of course this has  
details specific to my app):


NSFontManager *fontManager = [NSFontManager sharedFontManager];
[fontManager setTarget: self];
[fontManager setAction:@selector(changeFontForInfoText:)];
[fontManager setSelectedFont:mInfoTextFont isMultiple: NO];
[fontManager orderFrontFontPanel:nil];

The method that is informed of the font changes made in the Font Panel  
is simple:


- (void) changeFontForInfoText:(id)sender
{
NSFontManager *fontManager = [NSFontManager sharedFontManager];
NSFont *font = [fontManager convertFont:[fontManager selectedFont]];
// do whatever else needs to be done with the new font
}


Also, is it possible to save an NSFont as an object in user
preferences? Or must I save off the parts of the font specification
separately: font name, size, attributes.


I tried various approaches, including storing and loading the  
attributes dictionary of the NSFontDescriptor for the font. In the  
end, I just save two fields, the font name and the point size. While  
this doesn't allow for saving and restoring detailed tweaks to the  
font, my app doesn't need such, and the two field approach requires  
less manipulation of intermediary objects, so I opted for that approach.


~~~

hope this info is useful to someone someday



___

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

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

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

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


Re: get ref to instance from IB

2009-06-15 Thread Graham Cox


On 16/06/2009, at 4:00 PM, Ken Thomases wrote:

Actually, I believe a data source has stricter requirements on it  
than merely following the memory management rules.


From :


Ah, OK, this is trickier than I thought. Thanks for the correction.

I think there's no getting away from the need for the data source to  
maintain all of the objects it vends.  It can allocate them lazily,  
on demand.  The object can be owned by the C++ object, or there can  
be a mapping from each C++ object to the corresponding Objective-C  
object, or you can maintain an Objective-C data structure that  
parallels the C++ data structure.


Yes - I imagined you could probably create an autoreleased wrapper on  
the fly for each item requested by the outline view, but it looks like  
it's not going to work, more's the pity.


--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: get ref to instance from IB

2009-06-15 Thread Ken Thomases

On Jun 15, 2009, at 11:28 PM, Graham Cox wrote:


On 16/06/2009, at 1:55 PM, Paul M wrote:

Also: do I need to track and clean up all these wrapper instanes?  
I'm assuming I dont - I hope I dont otherwise it'll be a complete  
nightmare.


You need to follow normal, standard memory management and object  
ownership rules. That doesn't necessarily involve "tracking" all the  
wrapper instances, but it doesn't let you off following the rules  
correctly. In this case, autoreleasing the objects when they are  
created is probably all you need to do (and +[NSValue  
valueWihtPointer:] does this anyway).


Actually, I believe a data source has stricter requirements on it than  
merely following the memory management rules.


From :


"Similarly, [the outline view] does not own the objects it gets from  
the data source—if they are released your application is likely to  
crash unless you tell the outline view to reload its data.  ...  The  
data source is ... responsible for retaining all of the objects it  
provides to an outline view, and updating the outline view when  
there’s a change to the model. It is therefore not safe to release  
the root item—or any children—until you’re no longer displaying  
it in the outline view. If you need to dispose of the root item, then  
you should ensure that references to it are nullified, and that the  
outline view is updated to ensure that no attempt is made to display  
other items that may also have been disposed of ... ."



Also, note the following from the description of - 
outlineView:child:ofItem:


"In order for the collapsed state of the outline view to remain  
consistent when it is reloaded you must always return the same object  
for a specified child and item. "


And similarly, from the description of - 
outlineView:objectValueForTableColumn:byItem:


"In order for the collapsed state of the outline view to remain  
consistent when it is reloaded you must always return the same object  
for the specified item."



I think there's no getting away from the need for the data source to  
maintain all of the objects it vends.  It can allocate them lazily, on  
demand.  The object can be owned by the C++ object, or there can be a  
mapping from each C++ object to the corresponding Objective-C object,  
or you can maintain an Objective-C data structure that parallels the C+ 
+ data structure.


Regards,
Ken

___

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

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

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

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


Re: Open a file when Application launch

2009-06-15 Thread Graham Cox


On 16/06/2009, at 4:09 AM, Greg Guerin wrote:


rethish wrote:

I created a plist file  to launch my application at the scheduled  
time and
and its working well. But I need to load the saved project file,   
when the

application launches.

How can I do it?
What are the procedures to do it?


This isn't a Cocoa question.



To be fair I think the OP means "one of my app's own data files" when  
he says "Project file".


To do that, take a look at the methods of NSDocumentController,  
specifically - (id)openDocumentWithContentsOfURL:(NSURL *)absoluteURL  
display:(BOOL)displayDocument error:(NSError **)outError


If the app isn't document based, try overriding the application  
delegate's -applicationDidFinishLaunching: for example.


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


Drawing selection handles

2009-06-15 Thread Mahaboob

Hi,

I can apply filter effects to all the selected graphics in my canvas using
CIFilter class. It is working fine but the selection handles remain in the
same position because I'm not setting the bounds of the graphics after
applying the filter to it.
 
Now I need to draw the selection handles in the bound of my graphics after
applying filter effects to it.

So I sets the new bound to the graphics after applying filter effects in
the drawRect: method. Now the selection handles are showing in the exact
bounds. But when I'm trying to resize the graphics with selection handles,
It is not sizing correctly. When I'm trying to extract the circle to right
side, it goes to allover the screen or not coming to right size.

Could you help me to rectify this problem?

Thanking you in advance,
Mahaboob





___

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

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

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

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


Re: Any Good Core Animation Tutorials?

2009-06-15 Thread Kiel Gillard
Bill Dudney's Core Animation book is the best, high quality and  
inexpensive resource for any Core Animation developer .


Matt Gallagher's four part Core Animation powered Asteroids tutorials  
are pretty good, too .


In other related documentation: .


Hope this helps,

Kiel

On 16/06/2009, at 2:22 PM, Chunk 1978 wrote:


does anyone know off hand any good online tutorials using Core
Animation?  ideally, i'd like to see animation grouping, so one single
method calling a group that rotates (with specifically set anchor
point), and moves from one origin to another.  i'm pretty sure i can
figure the rest out on my own (opacity, scale, etc.) but first i would
like to see how 2 animations are configured and grouped as a guide.
___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/kiel.gillard%40gmail.com

This email sent to kiel.gill...@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: get ref to instance from IB

2009-06-15 Thread Graham Cox


On 16/06/2009, at 2:28 PM, Graham Cox wrote:

This seems horribly inefficient to me, I have thousands of items in  
my data trees.


Just to say something about this also - the outline view will only ask  
for as many items as it needs to actually display. So it need not be  
inefficient unless you design it badly. So, with a sensible design,  
worst case you're only going to have a few dozen wrapper objects in  
existence at once, and best case, just one - the one that the outline  
view is drawing right now. The outline view does not cache its data  
content in any way, as far as I know.


--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: get ref to instance from IB

2009-06-15 Thread Graham Cox


On 16/06/2009, at 1:55 PM, Paul M wrote:

First off, I'm new to IB and cocoa, so these questions should be  
taken in that context.
Also, This is a port of an existing X/C++ app. The internals are  
tried and true, all I'm doing is adding a new UI.


How do I obtain a reference to an object instanciated in IB?
I have 2 outline views and 2 instances of my datasource class, but  
I'm not clear how I can contact each instance separately from my  
code. I need to set a pointer in the datasource pointing to my  
internal (C++) data structures so that the right data goes to the  
right view.
I can think of a few ways to do this, but none that are robust or  
clean.


What is "File's Owner"? Whatever object that is, add IBOutlets to it  
and wire them to the objects of interest in the nib. The outlets are  
just ordinary ivars to the object that is "File's Owner".



\On a barely related note -
I thought that the 'item' passed from the datasource to the  
outlineview (returned by outlineView:child:ofItem:) should be opaque  
to the outlineview, so I was passing a reference to a C++ object.  
This however crashed my app whenever the disclosure triangle was  
clicked. It seems that the runtime system was monkeying with my  
data, expecting it to be am obj-c entity when it wasnt. I got round  
it by creating an obj-c wrapper class and wrapping each C++ item  
before passing it to the outlineview. This seems horribly  
inefficient to me, I have thousands of items in my data trees.


Since item is typed as an id, it must be an Objective-C object. The  
outline view may quite reasonably need to retain/release it for  
example. It's not "monkeying with your data", you broke your contract  
with it by not passing an object of type id.


So you do need a wrapper. But look at NSValue - it can wrap up an  
arbitrary pointer, so you don't need to roll your own unless there is  
extra functionality that would be worth having in the wrapper.


Also: do I need to track and clean up all these wrapper instanes?  
I'm assuming I dont - I hope I dont otherwise it'll be a complete  
nightmare.



You need to follow normal, standard memory management and object  
ownership rules. That doesn't necessarily involve "tracking" all the  
wrapper instances, but it doesn't let you off following the rules  
correctly. In this case, autoreleasing the objects when they are  
created is probably all you need to do (and +[NSValue  
valueWihtPointer:] does this anyway). If you are storing the wrappers  
in an array or tree structure built from NSArray and friends, these  
will do the right thing, but you'll have to correctly manage the  
ownership of these. There's no such thing as a free lunch, but it's  
much cheaper than you think ;-)


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


Any Good Core Animation Tutorials?

2009-06-15 Thread Chunk 1978
does anyone know off hand any good online tutorials using Core
Animation?  ideally, i'd like to see animation grouping, so one single
method calling a group that rotates (with specifically set anchor
point), and moves from one origin to another.  i'm pretty sure i can
figure the rest out on my own (opacity, scale, etc.) but first i would
like to see how 2 animations are configured and grouped as a guide.
___

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

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

Help/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: Serial port access from C / Objective C

2009-06-15 Thread Andrew Farmer

On 15 Jun 2009, at 15:10, Vansickle, Greg wrote:
With the write / read in place, although the write appears to work  
(numbytes returns 5),  the photometer does not respond (I get no  
"REMOTE" indication on the instrument panel. The subsequent read  
fails (returns -1).


This indicates that an error is occurring when you try to read from  
the device. What shows up in errno when this occurs?

___

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

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

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

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


get ref to instance from IB

2009-06-15 Thread Paul M
First off, I'm new to IB and cocoa, so these questions should be taken 
in that context.
Also, This is a port of an existing X/C++ app. The internals are tried 
and true, all I'm doing is adding a new UI.


How do I obtain a reference to an object instanciated in IB?
I have 2 outline views and 2 instances of my datasource class, but I'm 
not clear how I can contact each instance separately from my code. I 
need to set a pointer in the datasource pointing to my internal (C++) 
data structures so that the right data goes to the right view.

I can think of a few ways to do this, but none that are robust or clean.

On a barely related note -
I thought that the 'item' passed from the datasource to the outlineview 
(returned by outlineView:child:ofItem:) should be opaque to the 
outlineview, so I was passing a reference to a C++ object. This however 
crashed my app whenever the disclosure triangle was clicked. It seems 
that the runtime system was monkeying with my data, expecting it to be 
am obj-c entity when it wasnt. I got round it by creating an obj-c 
wrapper class and wrapping each C++ item before passing it to the 
outlineview. This seems horribly inefficient to me, I have thousands of 
items in my data trees.


Also: do I need to track and clean up all these wrapper instanes? I'm 
assuming I dont - I hope I dont otherwise it'll be a complete 
nightmare.



Many thanks for any help or insight.


paulm

___

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

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

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

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


CFAttributedStringGetMutableString returning null value

2009-06-15 Thread Travis Kirton
I have a method, where I need to append to a MutableAttributedString
Here is the method...

- (void)appendStringFromSelf:(CFMutableAttributedStringRef)theString with:(
CFIndex)numberOfGlyphs

{

CFMutableStringRef mutableString = CFAttributedStringGetMutableString
(theString);

CFAttributedStringRef appendableString =
CFAttributedStringCreateWithSubstring(...);

CFStringAppend(mutableString,CFAttributedStringGetString(appendableString));

return;

}


What is strange is that the first line in this method:


CFMutableStringRef mutableString = CFAttributedStringGetMutableString
(theString);


mutableString is NULL even though variable-> theString is a non-null
MutableAttributedString


Does anyone know why this might be happening?


Cheers,

Travis
___

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

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

Help/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: Serial port access from C / Objective C

2009-06-15 Thread Vansickle, Greg


I'm trying to communicate with a Photo Research Spectral photometer via USB. 
The device responds to simple ascii commands via a terminal program.

I have no problem accessing this via the screen command from Terminal. I need 
to get to the same capability from a Cocoa project.

>From terminal I'd enter:
> screen /dev/cu.usbmodem1a21

Once the screen utility starts, I simply type PHOTO (no carriage return) and 
the device would respond "REMOTE MODE" (no carriage return) and the spectro 
photometer displays "REMOTE" on it's panel.

Here's the C code I'm trying to make work. It's Apples SerialPortSample, 
stripped to it's minimum (so I understand what's important and what's fluff ...)

#include 
#include 
#include 

int main(void)
{
intfileDescriptor;
const char *bsdPath = "/dev/cu.usbmodem1a21";
const char *cmdString = "PHOTO";
inthandshake, numBytes;
int result;
char buffer[256];
char *bufPtr;

fileDescriptor = open(bsdPath, O_RDWR | O_NOCTTY | O_NONBLOCK); // 
returns 3
   if (fileDescriptor == -1) { return -1;}

result = ioctl(fileDescriptor, TIOCEXCL);
if (result == -1) { return -1; }// 
returns 0

result = ioctl(fileDescriptor, TIOCMGET, &handshake);   // 
returns 0, handshake is 0x26
   numBytes = write(fileDescriptor, cmdString, strlen(cmdString)); // 
returns 5

bufPtr = buffer;
numBytes = read(fileDescriptor, bufPtr, 15); // returns -1

close(fileDescriptor);

return 0;
}

If I remove the read and write, the USB device opens and closes properly, i.e. 
I can access the device successfully using the screen command again.

With the write / read in place, although the write appears to work (numbytes 
returns 5),  the photometer does not respond (I get no "REMOTE" indication on 
the instrument panel. The subsequent read fails (returns -1).

I've never programmed at the device level like this, so please confirm my 
assumption - I do not need to set the baud rate, parity and all that as the 
device appears to default to a sane state. (Screen utility doesn't set it, I 
assume the default values are set in the device it self.)

FWIW, the complete SerialPortSample code, complete with setting up the 
terminal, baud, parity, ... and changing the command strings, behaved the same 
way. I stripped all this out in case the problem was setting this stuff up.

Any pointers appreciated.

Greg
___

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

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

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

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


[Q] NSPopupButton: always show entire menu

2009-06-15 Thread Eric Gorr

I have a popup button on a NSPanel with several items in it.

When the NSPanel is close enough to the bottom of the screen, the menu  
pops up above the control and all of the menu items appear. If the  
NSPanel is far enough away from the bottom of the screen, the menu  
pops up below the control and all of the menu items appear.


So far, so good.

However, if the NSPanel is just close enough to the bottom of the  
screen, the menu pops up below the control and you get the scroll  
arrow telling you there are more items available. Now, if the menu has  
popped up above the control, all of the menu items could have appeared.


Is there a way to tell a NSPopupButton to display all of the menus  
items if they will fit on the screen?




___

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

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

Help/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: Adding actions to undo manager

2009-06-15 Thread Kyle Sluder
I don't know where your -doCustomThing: method lives, what it does, or
how it's invoked.  All I know is that it manipulated an NSTextStorage.

In NSTextView land, the topmost methods that manipulate text storages
are things like -cut: or -insertText:.  They know what undo actions to
register with the NSUndoManager.  Likewise, your code needs to
register the appropriate counter-method with the undo manager.  There
should be no assuming going on.  The NSTextStorage is precisely what
it claims to be; it stores text.  You've built a layer on top of
NSTextStorage that you need to add undo support to; only this code can
know what to register with the undo manager in order to counteract its
actions.

IOW, don't listen for changes to the text storage and register undo
actions based on your best guess.  Rather, register your undo actions
in the higher-level methods, alongside your modifications to the text
storage.

--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: Adding actions to undo manager

2009-06-15 Thread Ryan Joseph


On Jun 16, 2009, at 8:34 AM, Kyle Sluder wrote:

On Mon, Jun 15, 2009 at 6:18 PM, Ryan Joseph> wrote:
I'm not sure I follow you. How do I know the user wants to undo and  
that it
was in response to my change of the NSTextStorage? It seems like  
one way or
another I need to keep a stack of changes with information on what  
operation

they performed to the NSTextStorage. Thanks.


You already can.

Undo and Redo are typically view-centered operations.  That is, they
perform actions in response to things the user does with your views.
If they type into an NSTextView, the NSTextView ensures that, in
response to their typing, the undo stack is updated.

You're essentially assuming the role of NSTextView here.  Instead of
providing methods like -cut:, you're providing some method
-doCustomThing:.  -doCustomThing:, like -cut:, operates on the
NSTextStorage instance.  And just like Apple had to when they wrote
-cut:, you need to provide undo/redo support in your implementation of
-doCustomThing:.

So I define my new "action" and within that method I need to call  
registerUndoWithTarget:selector:object: to record the action with  
NSUndoManager? I assume then when the user undos is clear the text and  
when redo it will call that method which is my "action". Does that  
sound correct? Thanks for helping.



--Kyle Sluder


Regards,
Josef

___

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

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

Help/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: Adding actions to undo manager

2009-06-15 Thread Kyle Sluder
On Mon, Jun 15, 2009 at 6:18 PM, Ryan Joseph wrote:
> I'm not sure I follow you. How do I know the user wants to undo and that it
> was in response to my change of the NSTextStorage? It seems like one way or
> another I need to keep a stack of changes with information on what operation
> they performed to the NSTextStorage. Thanks.

You already can.

Undo and Redo are typically view-centered operations.  That is, they
perform actions in response to things the user does with your views.
If they type into an NSTextView, the NSTextView ensures that, in
response to their typing, the undo stack is updated.

You're essentially assuming the role of NSTextView here.  Instead of
providing methods like -cut:, you're providing some method
-doCustomThing:.  -doCustomThing:, like -cut:, operates on the
NSTextStorage instance.  And just like Apple had to when they wrote
-cut:, you need to provide undo/redo support in your implementation of
-doCustomThing:.

--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: Adding actions to undo manager

2009-06-15 Thread Ryan Joseph


On Jun 15, 2009, at 10:16 PM, I. Savant wrote:

Thanks. What a challenge just for some basic undo support, there  
really should be something simpler than this.


 There is, and it's already been suggested.

 If you want higher-level functionality, use the higher-level  
facilities of the text system (such as NSTextView's own convenience  
methods like -changeColor:, -insertText:, or -alignJustified:). Or  
use the methods inherited by NSTextView from NSText and on up the  
lineage (such as -cut:/-copy:/-paste:, -changeFont:, -underline:, - 
capitalizeWord:, -yank:, and so on).



I'm not sure I follow you. How do I know the user wants to undo and  
that it was in response to my change of the NSTextStorage? It seems  
like one way or another I need to keep a stack of changes with  
information on what operation they performed to the NSTextStorage.  
Thanks.


Regards,
Josef

___

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

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

Help/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: view drawing differences between Tiger and Leopard ?

2009-06-15 Thread vinai

Hi All,

This did not seem to help the issue with my software running under Tiger.

If I have to provide back compatibility support, I'll look into another
view type and see if that works ...

cheers
vinai

--- On Fri, 6/12/09, vinai  wrote:

>> This was a problem with NSImageView on Tiger. My workaround is to call
>> [imageView setImage:nil] and then [imageView setImage:myImage].  This
>> will cause a flicker, but your image will be redrawn.  Not sure if
>> anyone else has a better workaround.
>>
>> 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


sdp header generation fails for microsoft word 2008

2009-06-15 Thread Gokul Krishna
Hi,

I am trying to use scripting bridge to create some documents using microsoft
word 2008 from within my cocoa application.

I use the following command to generate the glue code header for word

sdef /Applications/Microsoft\ Office\ 2008/Microsoft\ Word.app/ | sdp -fh
--basename MicrosoftWord

sdp fails and prints the error message

sdp: /dictionary[1]/suite[4]/enumeration[90]/enumerator[50]: missing
required "name" attribute

the generated header file is also incomplete and cannot be used .

Any pointers on why this is happening and how to rectify it?


Cheers,
Gokul





-- 
Better to get up late and be wide awake than to get up early and be asleep
all day.
___

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

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

Help/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, to-many relationships, and object graph consistency

2009-06-15 Thread Sebastian Celis
On Mon, Jun 15, 2009 at 12:58 PM, Quincey
Morris wrote:
>
> If the comma-separated list is just for display in the user interface, you
> could generate it on the fly. Use 'keyPathsForValuesAffectingTagList' (or
> whatever) to ensure that the proper KVO notifications get sent when the
> underlying bookTag objects change.
>
> If you really want to store the comma-separated list, you can write your own
> set accessor overrides (addTagsObject, removeTagsObject, addTags,
> removeTags) and rebuild the string in the accessors. The only trick here
> (apart from following the documented pattern for writing the accessors) is
> to realize that the accessors are also called at undo time, so accessors
> with a side effect of updating a different property can be problematical
> unless you're careful.

Thanks for all of your help. For now I think I will stop caching the
comma-separated list. I was also caching a sorted array of the tags,
but I think I can just compute those whenever they are requested,
which should not be that often, anyway. If I run into a performance
issue with this code later, I can look at it then. Just seems strange
that I can't have my managed object observe itself for changes to a
particular attribute / relationship.

- Sebastian
___

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

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

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

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


Font Panel and storing font user default

2009-06-15 Thread Stuart Malin
I would like for my app to enable the user to set a user default for a  
Font to be used in a certain part of the application. I have a  
preferences panel, and within that am able to open the NSFontPanel.  
However, I can't figure out how to capture the setting that is made:  
must I actually have some text (say in a Text View) that is edited?


Also, is it possible to save an NSFont as an object in user  
preferences? Or must I save off the parts of the font specification  
separately: font name, size, attributes.


I have tried searching the usual places for info, but can't seem to  
find anything that helps me directly, so am querying the list. TIA.



___

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

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

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

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


Re: advice on background process

2009-06-15 Thread Rick C.
thank you both for the input.  yes i just need leopard and later support.  i 
will look into your suggestions and post back after i've had some time to work 
on it.  thanks again for pointing me in the right direction.

rick






From: Jerry Krinock 
To: cocoa-dev 
Sent: Monday, June 15, 2009 9:01:06 AM
Subject: Re: advice on background process


On 2009 Jun 14, at 09:48, Michael Ash wrote:

> On Sun, Jun 14, 2009 at 7:19 AM, Rick C. wrote:

>> my project is fairly small and it monitors via notification certain 
>> directories for changes.
> 
> The most obvious way to do this would be to just have two
> applications. One is an LSUIElement which does the monitoring and any
> UI type stuff that's done during that, and the other is a regular
> application which talks to it.

Yes, split it into two as Mike recommends, but if that monitoring app's sole 
function is to watch certain directories for changes and you're requiring Mac 
OS 10.4 or later, you're in luck.  "Monitoring ... certain directories for 
changes" can be performed by installing a launchd task.  So you only need one 
app.  Read:

http://developer.apple.com/MacOsX/launchd.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/jo_phls%40yahoo.com

This email sent to jo_p...@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 a file when Application launch

2009-06-15 Thread Greg Guerin

rethish wrote:

I created a plist file  to launch my application at the scheduled  
time and
and its working well. But I need to load the saved project file,   
when the

application launches.

How can I do it?
What are the procedures to do it?


This isn't a Cocoa question.

Example of a shell command-line (caution, may be line-wrapped by mail).

/usr/bin/osascript -e 'tell app "Xcode" to open Posix file "/usr/ 
include/assert.h"'


Change the app name and the file's pathname to suit.

  -- GG

___

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

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

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

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


Re: Core Data, to-many relationships, and object graph consistency

2009-06-15 Thread Quincey Morris

On Jun 15, 2009, at 06:43, Sebastian Celis wrote:


I believe I found my issue. In my SCBook class I was overriding
didChangeValueForKey:withSetMutation:usingObjects: so that I could
store an NSString containing a comma-separated list of tags associated
with the book. Apparently this is a very bad way to do it. I missed
the big warning in the documentation which states that this method
should not be overridden. What is the correct way to do this from
inside of the SCBook class?


If the comma-separated list is just for display in the user interface,  
you could generate it on the fly. Use  
'keyPathsForValuesAffectingTagList' (or whatever) to ensure that the  
proper KVO notifications get sent when the underlying bookTag objects  
change.


If you really want to store the comma-separated list, you can write  
your own set accessor overrides (addTagsObject, removeTagsObject,  
addTags, removeTags) and rebuild the string in the accessors. The only  
trick here (apart from following the documented pattern for writing  
the accessors) is to realize that the accessors are also called at  
undo time, so accessors with a side effect of updating a different  
property can be problematical unless you're careful.



___

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

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

Help/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: ANN: Rosetta Booster Beta 1.0.1a (reference [NSTask] -launch return)

2009-06-15 Thread Greg Guerin

M Pulis wrote:


On a 4GB machine:

Boot time increased 2.533 seconds or +6.535% for a 39 second boot.


But did it solve the problem?

That is, did "priming the pump" with the execution of an exit(0) ppc  
process reliably decrease the launch-time of another ppc process, the  
one actually desired?


I ask this because you wrote:


No. Rosetta is a translator. Please read Tannenbaum, Apple, et al.


Being a translator, it must perform some amount of initial  
translation of every ppc executable before the translated code can  
run.  What part of 2.533 secs is loading, and what is translation?


It seems clear that some of the initial 2.533 secs at boot time is  
due to Rosetta's libraries and data simply loading from disk.  I  
think we can safely say that this work won't be repeated for a 2nd  
ppc process.  But an unknown fraction of the 2.533 secs is spent  
translating the actual exit(0) code, and presumably, some of that  
will have to be repeated for each ppc executable.


Mitigating this is the observation that the ppc code run before main 
() is usually a common code sequence, and if Rosetta has half the  
wits of the Scarecrow (please read L. Frank Baum) it would already  
have that sequence cached.  It is also possible that various ppc  
libraries would be similarly cached, and thus not translated again.   
So we are left with one question answered (the cost of pump priming)  
and one unanswered (the cost unique to each ppc process).


I invite you to apply for further research grants to answer this  
question: How much does a 2nd ppc executable, being the one whose  
execution was originally desired, benefit from the primed pump?


A 3rd question is whether one can automate the creation of a suitable  
"primer" executable, similar enough in its use of libraries to an  
arbitrary original executable, that the maximum benefit of priming  
the pump can be obtained.  A marketing consultant suggested the name  
Optimize Primer for this, apparently a tie-in to a popular product  
related to inductors or transformers.


  -- GG

___

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

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

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

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


Re: [iPhone] (newbie) navigation controller is null, combining navigation controller and tab bar controller

2009-06-15 Thread Beth Freeman
Greg -Yes!  That was it.  I had missed hooking up the outlet in the App
Delegate.  I first tried the method you suggested and it worked; then I went
into IB and hooked up the outlet correct to the topicsTableNavController and
that worked too.

Thank you SO much.

Beth

On Mon, Jun 15, 2009 at 9:17 AM, Greg Titus  wrote:

> Hi Beth,
>
> Something that you might try, just to simplify the number of IB hookups and
> cut down on the possibility of errors there, is to change this line:
>
> [delegate.topicsTableNavController pushViewController:questionDetail
> animated:YES];
>
> To just:
>
> [self.navigationController pushViewController:questionDetail animated:YES];
>
> The UIViewController class has a method (-navigationController) to access
> the navigation controller that it is currently inside of. Using it will keep
> you from having to look up you app delegate, since it looks like the problem
> that you are having is that your app delegate's "topicsTableNavController"
> outlet is not getting set.
>
> Hope this helps,
>- Greg
>
>
> On Jun 15, 2009, at 8:26 AM, Beth Freeman wrote:
>
>  Hello,This is a follow up question to my previous question about combining
>> a
>> navigation controller with a tab bar controller.
>>
>> I have successfully combined the two in building the interface with
>> Interface Builder: My top level controller is a tab bar controller.  This
>> references a navigation controller, which references a table view
>> controller.  Selecting a row from the table view is then supposed to
>> display
>> a UI view (ie, not another table view).  When I run the program, I see the
>> tab bar, the navigation bar and the table with my data just fine. However,
>> when I select a row from the table, I never see the UI view.
>>
>> In my accessoryButtonTappedForRowWithIndexPath method (see below) in my
>> table view controller, my navigation controller appears to be null.  When
>> I
>> put a breakpoint at the line when I push the view controller on the stack,
>> the address of the navigation controller is 0x0.
>>
>> I have studied TheElements example from Apple extensively and believe I am
>> doing everything correctly in IB.  Since TheElements example is built
>> programmatically, it's a little difficult for me to know if I've done
>> everything I need to do to hook things up correctly, but I believe I have.
>> My understanding is that when I drag a controller from the library into my
>> MainWindow.xib window, I'm "instantiating" that as an object.  I have an
>> object in my MainWindow.xib window whose class is set to
>> TopicsTableNavController (the navigation controller for the first tab),
>> however, as described above, this appears to not be instantiated at the
>> breakpoint.
>>
>> In TheElements example, the navigation controllers are created and added
>> to
>> the tab bar view controllers programmatically.  My assumption was that
>> when
>> you assign the view controllers for the tab bar controller through IB, and
>> set the class of each of the view controllers through IB, I'm
>> instantiating
>> the objects at that time.
>>
>> Am I missing something?  Is there something I need to do programmatically
>> to
>> set up the navigation controller that I don't know about?  Am I wrong
>> about
>> how IB works?
>>
>> In the code below, I set up the view controller for the view that should
>> be
>> pushed onto the stack (questionDetail) and, I assume, displayed.  I do see
>> the log message just before the push, and have verified that my view is
>> being set up correctly.  However, the view is never displayed, I'm
>> guessing
>> because the navigation controller is 0x0 and is thus nil.
>>
>> Thanks so much in advance for any help.
>>
>> Elisabeth
>>
>>
>>
>> - (void)tableView:(UITableView *)tableView
>> accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {
>>
>> NSUInteger row = [indexPath row];
>>
>> if (self.questionDetail == nil) {
>>
>> QuestionDetail *aQuestionDetail = [[QuestionDetail alloc] initWithNibName:
>> @"QuestionDetail" bundle:nil];
>>
>> self.questionDetail = aQuestionDetail;
>>
>> [aQuestionDetail release];
>>
>> }
>>
>> questionDetail.title = [NSString stringWithFormat:@"Question from %@",
>> [topicsArray objectAtIndex:row]];
>>
>> if (QADetail != nil) {
>>
>> [questionDetail.question setText:[QADetail objectForKey:@"question"]];
>>
>> [questionDetail.answer setText:[QADetail objectForKey:@"answer"]];
>>
>> }
>>
>> NDQAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
>>
>> NSLog(@"Pushing Question Detail View Controller");
>>
>> [delegate.topicsTableNavController pushViewController:questionDetail
>> animated:YES];
>>
>> }
>> ___
>>
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/opt

spell checking

2009-06-15 Thread kvic...@pobox.com
my multi-document app has many windows and sheets, and there are LOTS 
of NSTextFields (and subclasses) and editable NSTableViews and 
editable NSOutlineViews in these windows and sheets.


i would like to enable continuous spell checking (in response to a 
user preference) in a majority of these fields/views/cells.


can anyone offer some advice/suggestions as to what might be the 
best/easiest way to go about this?


one approach i've thought of is to override -[NSWindow 
makeFirstResponder] and if calling super is successful, then check to 
see if the new first responder responds to 
setContinuousSpellCheckingEnabled and if so, then turn it on. and 
while this seems to work, it is a little too inclusive, and i must 
then find all the places i don't want it on. also, i'm not sure how 
i'd go about specifying the document tag to be used when a "vanilla" 
field editor does spell checking.


thanx for any help/pointers/advice,
ken

___

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

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

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

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


Re: Subtitle Track

2009-06-15 Thread Gordon Apple
This is a QuickTime question, not Cocoa.

I was just looking into this recently.  A text track is part of the
movie.  A subtitle track is an optional track usually depending on option
settings and the machine's language settings.  Yes, you can have multiple
languages.  Google it and you should find a few references.  I believe Final
Cut Pro can add such tracks.  There are also some inexpensive shareware
programs to add captioning.  I'm not sure about multi-language subtitles.


> Hi,
> can anybody tell the difference between text track and subtitle track.
> I know to add a text track to a movie, how can i add a subtitle track.
> can i add more than two language foe subtitle track?
> is there any source regarding subtitle?
> 
> Thanks in advance
> 
> regards
> Sandeep
> 



___

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

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

Help/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] (newbie) navigation controller is null, combining navigation controller and tab bar controller

2009-06-15 Thread Greg Titus

Hi Beth,

Something that you might try, just to simplify the number of IB  
hookups and cut down on the possibility of errors there, is to change  
this line:


[delegate.topicsTableNavController pushViewController:questionDetail  
animated:YES];


To just:

[self.navigationController pushViewController:questionDetail  
animated:YES];


The UIViewController class has a method (-navigationController) to  
access the navigation controller that it is currently inside of. Using  
it will keep you from having to look up you app delegate, since it  
looks like the problem that you are having is that your app delegate's  
"topicsTableNavController" outlet is not getting set.


Hope this helps,
- Greg

On Jun 15, 2009, at 8:26 AM, Beth Freeman wrote:

Hello,This is a follow up question to my previous question about  
combining a

navigation controller with a tab bar controller.

I have successfully combined the two in building the interface with
Interface Builder: My top level controller is a tab bar controller.   
This

references a navigation controller, which references a table view
controller.  Selecting a row from the table view is then supposed to  
display
a UI view (ie, not another table view).  When I run the program, I  
see the
tab bar, the navigation bar and the table with my data just fine.  
However,

when I select a row from the table, I never see the UI view.

In my accessoryButtonTappedForRowWithIndexPath method (see below) in  
my
table view controller, my navigation controller appears to be null.   
When I
put a breakpoint at the line when I push the view controller on the  
stack,

the address of the navigation controller is 0x0.

I have studied TheElements example from Apple extensively and  
believe I am

doing everything correctly in IB.  Since TheElements example is built
programmatically, it's a little difficult for me to know if I've done
everything I need to do to hook things up correctly, but I believe I  
have.
My understanding is that when I drag a controller from the library  
into my
MainWindow.xib window, I'm "instantiating" that as an object.  I  
have an

object in my MainWindow.xib window whose class is set to
TopicsTableNavController (the navigation controller for the first  
tab),
however, as described above, this appears to not be instantiated at  
the

breakpoint.

In TheElements example, the navigation controllers are created and  
added to
the tab bar view controllers programmatically.  My assumption was  
that when
you assign the view controllers for the tab bar controller through  
IB, and
set the class of each of the view controllers through IB, I'm  
instantiating

the objects at that time.

Am I missing something?  Is there something I need to do  
programmatically to
set up the navigation controller that I don't know about?  Am I  
wrong about

how IB works?

In the code below, I set up the view controller for the view that  
should be
pushed onto the stack (questionDetail) and, I assume, displayed.  I  
do see
the log message just before the push, and have verified that my view  
is
being set up correctly.  However, the view is never displayed, I'm  
guessing

because the navigation controller is 0x0 and is thus nil.

Thanks so much in advance for any help.

Elisabeth



- (void)tableView:(UITableView *)tableView
accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {

NSUInteger row = [indexPath row];

if (self.questionDetail == nil) {

QuestionDetail *aQuestionDetail = [[QuestionDetail alloc]  
initWithNibName:

@"QuestionDetail" bundle:nil];

self.questionDetail = aQuestionDetail;

[aQuestionDetail release];

}

questionDetail.title = [NSString stringWithFormat:@"Question from %@",
[topicsArray objectAtIndex:row]];

if (QADetail != nil) {

[questionDetail.question setText:[QADetail objectForKey:@"question"]];

[questionDetail.answer setText:[QADetail objectForKey:@"answer"]];

}

NDQAppDelegate *delegate = [[UIApplication sharedApplication]  
delegate];


NSLog(@"Pushing Question Detail View Controller");

[delegate.topicsTableNavController pushViewController:questionDetail
animated:YES];

}
___

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

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

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

This email sent to g...@omnigroup.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: to NIB or not to NIB

2009-06-15 Thread Mr. George Warner
On Mon, 15 Jun 2009 06:56:11 -0400, Chunk 1978   
wrote:

> what are your thoughts?  are developers who don't use IB masochists,
> or is it a wise choice?

Totally depends on your needs. Using IB is easier unless you're  
maintaining cross platform code that you want to share common (GUI)  
sources. Many of our developers use platform agnostic XML files to  
describe their GUI. Platform specific code parses these files to  
create Platform specific GUI (using platform specific APIs). For well  
factored code this is much less work to maintain in the long run. For  
smaller projects where faster initial delivery is more important then  
using the platform specific GUI editors is usually faster than  
developing the XML parsing and platform specific control (widget?) code.

--
Enjoy,
George Warner,
Schizophrenic Optimization Scientist
Apple Developer Technical Support (DTS)

___

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

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

Help/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] (newbie) navigation controller is null, combining navigation controller and tab bar controller

2009-06-15 Thread Dave DeLong
This is a topic I've blogged about, since I've noticed other people  
struggling with it as well.  In addition, I even created an  
instruction manual on how to do it for a class assignment.


http://davedelong.com/blog/2009/05/13/adding-uinavigationuitableview-controllers-uitabbarcontroller

HTH,

Dave

On Jun 15, 2009, at 9:26 AM, Beth Freeman wrote:

Hello,This is a follow up question to my previous question about  
combining a

navigation controller with a tab bar controller.

I have successfully combined the two in building the interface with
Interface Builder: My top level controller is a tab bar controller.   
This

references a navigation controller, which references a table view
controller.  Selecting a row from the table view is then supposed to  
display
a UI view (ie, not another table view).  When I run the program, I  
see the
tab bar, the navigation bar and the table with my data just fine.  
However,

when I select a row from the table, I never see the UI view.

In my accessoryButtonTappedForRowWithIndexPath method (see below) in  
my
table view controller, my navigation controller appears to be null.   
When I
put a breakpoint at the line when I push the view controller on the  
stack,

the address of the navigation controller is 0x0.

I have studied TheElements example from Apple extensively and  
believe I am

doing everything correctly in IB.  Since TheElements example is built
programmatically, it's a little difficult for me to know if I've done
everything I need to do to hook things up correctly, but I believe I  
have.
My understanding is that when I drag a controller from the library  
into my
MainWindow.xib window, I'm "instantiating" that as an object.  I  
have an

object in my MainWindow.xib window whose class is set to
TopicsTableNavController (the navigation controller for the first  
tab),
however, as described above, this appears to not be instantiated at  
the

breakpoint.

In TheElements example, the navigation controllers are created and  
added to
the tab bar view controllers programmatically.  My assumption was  
that when
you assign the view controllers for the tab bar controller through  
IB, and
set the class of each of the view controllers through IB, I'm  
instantiating

the objects at that time.

Am I missing something?  Is there something I need to do  
programmatically to
set up the navigation controller that I don't know about?  Am I  
wrong about

how IB works?

In the code below, I set up the view controller for the view that  
should be
pushed onto the stack (questionDetail) and, I assume, displayed.  I  
do see
the log message just before the push, and have verified that my view  
is
being set up correctly.  However, the view is never displayed, I'm  
guessing

because the navigation controller is 0x0 and is thus nil.

Thanks so much in advance for any help.

Elisabeth



- (void)tableView:(UITableView *)tableView
accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {

NSUInteger row = [indexPath row];

if (self.questionDetail == nil) {

QuestionDetail *aQuestionDetail = [[QuestionDetail alloc]  
initWithNibName:

@"QuestionDetail" bundle:nil];

self.questionDetail = aQuestionDetail;

[aQuestionDetail release];

}

questionDetail.title = [NSString stringWithFormat:@"Question from %@",
[topicsArray objectAtIndex:row]];

if (QADetail != nil) {

[questionDetail.question setText:[QADetail objectForKey:@"question"]];

[questionDetail.answer setText:[QADetail objectForKey:@"answer"]];

}

NDQAppDelegate *delegate = [[UIApplication sharedApplication]  
delegate];


NSLog(@"Pushing Question Detail View Controller");

[delegate.topicsTableNavController pushViewController:questionDetail
animated:YES];

}
___

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

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

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

This email sent to davedel...@me.com


___

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

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

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

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


ANN: Rosetta Booster Beta 1.0.1a (reference [NSTask] -launch return)

2009-06-15 Thread M Pulis

Group,

In a failed attempt of the group to provide a solution for a recent  
poster, I became intrigued with the subjective analysis that the OP  
represented as facts responsible for rejecting (with extreme  
prejudice) my proposal in particular. Others may have received off- 
list personal rejections; I can only speak of mine.


My purpose in sharing the story here is to first acknowledge those of  
us that took time to attempt to assist / educate the OP.


I felt, also, guilty, for having provoked the OP by labeling the OP's  
concerns as "Princess and the Pea" while the OP referenced Dr.  
Tannenbaum. With an epiphany I then realized that not only did we  
read different books but, more importantly, that was absolutely  
unfair of me to belittle the OP's issues without objective data.


To humbly apologize for my professional transgression and show due  
respect for those passing subjective analysis as fact by presenting a  
virtual olive branch, I immediately challenged the OP to create a  
business case for Apple DTS changing how Rosetta works. Then, awash  
with the guilt of assigning such an arduous task I asked myself what  
would it take to brew such a case? And how much brew would it take to  
even believe such a case?


Knowing that objective data would be required, and, at least in my  
shop, to even approve a DTS expense, or explain to a client on  
invoice, I took the suggestion by Mr. Guerin and others to prime the  
pump. I implemented an exit(0) app. And tested it as a log in items  
app to acquire the relevant data.  In the discussion below, I have  
included significant specific references for further study by  
interested parties.


Second, to expose Rosetta for the resource hog it must be to have  
created such scientifically objective responses as "a really really  
bad idea".  And "Nooo thanks!". I know that "double really", like  
cooties and capital letters, is MUCH (see?) more serious than just  
one "really", but, just how much more is "double really" really bad?  
Maybe it is really bad squared that would really be bad. And how  
bad was it to then force the keyboard into auto - repeating the  
letter "o"!  Not only a "double really bad" rating but also a seven  
"o" No rating? Wow! I feel like an awards show... "you hate me, you  
really hate me!" But I digress.   :-)


I set out to answer these questions: just how bad is really bad  
squared? How bad is No to the seventh power? One would need a PhD in  
irrational math to figure this out, certainly. So I thought, what  
would Dr. Tannenbaum do? Research, of course! The results are below  
in the proposed installer GUI for Rosetta Booster, but first:


For the archives, I also need to address some misconceptions that can  
get in the way of providing a solution to a client. The perpetuation  
of these myths insults and belittles the outstanding effort of  
Apple's implementation.


Here are the Top Ten myths about Rosetta, followed by my proposed  
GUI, specifically labeled to insure that large numbers validate the  
fears of the OP, like FOX News might do.


#1 " Rosetta is an emulator. "

No. Rosetta is a translator. Please read Tannenbaum, Apple, et al.

#2 "It uses up a lot of memory when running even if no ppc apps are  
running."


As it must, of course. There is no free launch. However, this is  
either the "Princess and the Pea" or "Achilles Heel" depending on  
your system load and capacity for juvenile literary references. Apple  
states that it allocates a large buffer. Both Apple's "large" and the  
OP "a lot" are far too vague as they are relative to different  
context. This is a pitfall of subjective thought. In comparison to  
the size of the PPC code, the buffer is gynormous, humungous even! In  
comparison to available resources, however, one could use miniscule  
without challenge. On the other hand, if your system is at 90% used  
RAM, you need to throw another RAM on the barbie, mate! Such memory  
starved systems are not properly configured for the task. Properly  
configured systems handle the load, as Atlas and turtles do.  
Perspective is required here, to avoid mistaking an elephant's tale  
for a snake or a rope. Please read Dr. Suess, Aesop, SnaggleTooth,  
Crocodile Dundee, et al.


#3 "It also consumes cpu cycles just by virtue of running."
Whatdaya want for nuthin? Rubber Biscuit? Please listen to Blues  
Brothers, et al.


#4 " fact that it remains running once started"
Only until the translated PPC process exits. Please read Apple, Dr.  
Pepper, Chicken Little, et al.


#5 "No user wants their computer slowed down every time they boot. "
- Except the user annoyed at waiting for the OP game to launch first  
time.

- Except for the power user that understands how operating systems work.
- Except for those users that hardly ever need to boot.
- Except for those users with boot  times scheduled by OSX for  
anytime before they arrive.
- Except the user that has PAID for enough RA

[iPhone] (newbie) navigation controller is null, combining navigation controller and tab bar controller

2009-06-15 Thread Beth Freeman
Hello,This is a follow up question to my previous question about combining a
navigation controller with a tab bar controller.

I have successfully combined the two in building the interface with
Interface Builder: My top level controller is a tab bar controller.  This
references a navigation controller, which references a table view
controller.  Selecting a row from the table view is then supposed to display
a UI view (ie, not another table view).  When I run the program, I see the
tab bar, the navigation bar and the table with my data just fine. However,
when I select a row from the table, I never see the UI view.

In my accessoryButtonTappedForRowWithIndexPath method (see below) in my
table view controller, my navigation controller appears to be null.  When I
put a breakpoint at the line when I push the view controller on the stack,
the address of the navigation controller is 0x0.

I have studied TheElements example from Apple extensively and believe I am
doing everything correctly in IB.  Since TheElements example is built
programmatically, it's a little difficult for me to know if I've done
everything I need to do to hook things up correctly, but I believe I have.
 My understanding is that when I drag a controller from the library into my
MainWindow.xib window, I'm "instantiating" that as an object.  I have an
object in my MainWindow.xib window whose class is set to
TopicsTableNavController (the navigation controller for the first tab),
however, as described above, this appears to not be instantiated at the
breakpoint.

In TheElements example, the navigation controllers are created and added to
the tab bar view controllers programmatically.  My assumption was that when
you assign the view controllers for the tab bar controller through IB, and
set the class of each of the view controllers through IB, I'm instantiating
the objects at that time.

Am I missing something?  Is there something I need to do programmatically to
set up the navigation controller that I don't know about?  Am I wrong about
how IB works?

In the code below, I set up the view controller for the view that should be
pushed onto the stack (questionDetail) and, I assume, displayed.  I do see
the log message just before the push, and have verified that my view is
being set up correctly.  However, the view is never displayed, I'm guessing
because the navigation controller is 0x0 and is thus nil.

Thanks so much in advance for any help.

Elisabeth



- (void)tableView:(UITableView *)tableView
accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {

NSUInteger row = [indexPath row];

 if (self.questionDetail == nil) {

QuestionDetail *aQuestionDetail = [[QuestionDetail alloc] initWithNibName:
@"QuestionDetail" bundle:nil];

self.questionDetail = aQuestionDetail;

[aQuestionDetail release];

}

questionDetail.title = [NSString stringWithFormat:@"Question from %@",
[topicsArray objectAtIndex:row]];

 if (QADetail != nil) {

[questionDetail.question setText:[QADetail objectForKey:@"question"]];

[questionDetail.answer setText:[QADetail objectForKey:@"answer"]];

}

 NDQAppDelegate *delegate = [[UIApplication sharedApplication] delegate];

NSLog(@"Pushing Question Detail View Controller");

[delegate.topicsTableNavController pushViewController:questionDetail
animated:YES];

}
___

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

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

Help/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: Adding actions to undo manager

2009-06-15 Thread I. Savant

On Jun 15, 2009, at 3:35 AM, Ryan Joseph wrote:

Thanks. What a challenge just for some basic undo support, there  
really should be something simpler than this.


  There is, and it's already been suggested.

  If you want higher-level functionality, use the higher-level  
facilities of the text system (such as NSTextView's own convenience  
methods like -changeColor:, -insertText:, or -alignJustified:). Or use  
the methods inherited by NSTextView from NSText and on up the lineage  
(such as -cut:/-copy:/-paste:, -changeFont:, -underline:, - 
capitalizeWord:, -yank:, and so on).


  If, on the other hand, you need to do something highly-specific to  
your application (which is not already covered by a higher-level  
convenience method), only you know what those changes mean, whether  
they should be undoable, and how that undo should be handled.  
Therefore, it's up to you to implement it.


--
I.S.



___

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

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

Help/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: to NIB or not to NIB

2009-06-15 Thread Andy Lee
You're not the first to ask.  May I suggest that we do not rehash this  
topic for the umpteenth time.  Searching CocoaBuilder for "nibless"  
should give you all the food for thought you need.


--Andy

On Jun 15, 2009, at 6:56 AM, Chunk 1978 wrote:


what are your thoughts?  are developers who don't use IB masochists,
or is it a wise choice?
___

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

Please do not post admin requests or moderator comments to the list.
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: Core Data, to-many relationships, and object graph consistency

2009-06-15 Thread Sebastian Celis
I believe I found my issue. In my SCBook class I was overriding
didChangeValueForKey:withSetMutation:usingObjects: so that I could
store an NSString containing a comma-separated list of tags associated
with the book. Apparently this is a very bad way to do it. I missed
the big warning in the documentation which states that this method
should not be overridden. What is the correct way to do this from
inside of the SCBook class?

Thanks,
Sebastian
___

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

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

Help/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 a file when Application launch

2009-06-15 Thread rethish
Hi,

I need to open the saved project file which is stored in the document folder
by using scheduling.

I created a plist file  to launch my application at the scheduled time and
and its working well. But I need to load the saved project file,  when the
application launches.

How can I do it?
What are the procedures to do it?

Thank you in advance.
___

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

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

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

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


Re: XCode and Safari Block Issues?

2009-06-15 Thread Chunk 1978
thanks.  ClickToFlash seems leagues of magnitude better.  and now i
don't have to deal with console nagging me when CG testing with XCode.

On Mon, Jun 15, 2009 at 8:29 AM, Jonathan del
Strother wrote:
> On Mon, Jun 15, 2009 at 12:57 PM, Chunk 1978 wrote:
>> i installed Safari Block for Safai 4.  Safari Block, for those who do
>> not already know, blocks flash banner ads on internet sites.  to
>> install, users simply drag Safari Block folder into
>> /Libary/InputManagers.  Safai Block works fine.
>>
>
> May I suggest ClickToFlash instead?  It's a 'proper' Safari plugin and
> so will only be loaded into Safari.
>
___

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

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

Help/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: XCode and Safari Block Issues?

2009-06-15 Thread Jonathan del Strother
On Mon, Jun 15, 2009 at 12:57 PM, Chunk 1978 wrote:
> i installed Safari Block for Safai 4.  Safari Block, for those who do
> not already know, blocks flash banner ads on internet sites.  to
> install, users simply drag Safari Block folder into
> /Libary/InputManagers.  Safai Block works fine.
>

May I suggest ClickToFlash instead?  It's a 'proper' Safari plugin and
so will only be loaded into Safari.
___

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

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

Help/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, to-many relationships, and object graph consistency

2009-06-15 Thread Sebastian Celis
On Mon, Jun 15, 2009 at 2:56 AM, Quincey
Morris wrote:

> What implementation of the 'tag' and 'book' properties are you using? (That
> is, how are setTag and setBook defined?)

I am just using @property and @dynamic to define all of these.

SCBook.h:

@property (nonatomic, retain) NSSet *tags; // This is the
Book->BookTag relationship.

SCBook.m:

@dynamic tags;

SCBookTag.h:

@property (nonatomic, retain) SCBook *book;
@property (nonatomic, retain) SCTag *tag;

SCBookTag.m:

@dynamic book;
@dynamic tag;

SCTag.h:

@property (nonatomic, retain) NSSet *bookTags;

SCTag.m:

@dynamic bookTags;


> (It's a bit confusing, btw, that you've called the Book->BookTag
> relationship 'tags' instead of 'bookTags'.)

Sorry. I'd change how I talk about them now but I fear that would just
lead to more confusion.

> You should double check that everything is correctly defined in your managed
> object model. Make sure, for example, that it shows that the inverse
> relationships are recognized as inverses. Also, check any validation
> conditions on your attributes. For example, if your Book->BookTags to-many
> relationship has a cardinality range of 0-1, you probably aren't going to
> get the results you expect.

Yeah, I initially had the same thought and I have checked and double
checked the data model. The inverses all look good, and all the
validation conditions are very lax. The only one I have set is to
ensure that a Tag must have at least one BookTag under the bookTags
relationship.

> However, based on your description, it actually sounds more like you have a
> memory management problem. Are you using garbage collection? If not, are you
> sure you're retaining objects appropriately?

I am not using garbage collection. Do I actually need to retain
anything in the code example in my original message? From creating the
SCBook to calling  [[book tags] count] I am not retaining anything,
but I was under the impression that I did not have to since this would
all happen before the autorelease pool empties itself. I went ahead
and tried retaining all of them in my example and [[book tags] count]
is still 1.

> Whatever gives you an actual error message is your best attack point for
> solving your problem.

Yeah, I spent hours tying to determine why I was getting a "dangling
reference to an invalid object" error when deleting an existing
BookTag and adding a new BookTag in the same commit. I kept trying to
simplify the scenario and then started to notice that even the initial
creates were not acting as I expected. I eventually decided that
adding two BookTags was still causing me to scratch my head, and
because that seemed like a really simple scenario, I thought I would
start there. Do you have any suggestions for how I would approach the
dangling reference error? It points to the BookTag object I deleted
(both Book and Tag in that object point to nil). I definitely call
[managedObjectContext deleteObject:bookTag] but I guess that somehow,
somewhere in the object tree someone still has a reference to it.

It was this that caused me to think that my model was incorrect in how
the object tree is constructed.

> You can use the debugger to examine your object relationships. When you add
> the second object to the relationship (from either end), are the first
> object's relationships getting clobbered, or are the second objects
> relationships not being set up properly?

The debugger is telling me that all of the relationships look fine
except for the Book->BookTags relationship. The set of BookTags only
contains the first BookTag object I created (scifi, in my example).
The 'dystopian' tag, on the other hand, is not there. However, the
relationships all look fine in the tag2 and bookTag2 objects. bookTag2
points at both the book and tag2, and tag2 points at bookTag2. It's
all very strange.

> You can also try calling [moc processPendingChanges] before checking to see
> if the desired inverse relationships were set up. I don't recall ever having
> to use it in such circumstances, but I may be misremembering the sequence of
> events.

Yeah, I did try calling that before [[book tags] count], but sadly it
made no difference.

Thank you very much for the time you have spent helping me thus far.
This issue is really killing me.

- Sebastian
___

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

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

Help/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: XCode and Safari Block Issues?

2009-06-15 Thread Rob Keniger


On 15/06/2009, at 9:57 PM, Chunk 1978 wrote:


however, now whenever i seems to build/launch an app in XCode, i get
this message in the console:

[Session started at 2009-06-15 07:53:16 -0400.]
2009-06-15 07:53:16.827 SimpleMenuScrolling[3044:10b] Error loading
/Library/InputManagers/SafariBlock/SafariBlock.bundle/Contents/MacOS/ 
SafariBlock:
dlopen(/Library/InputManagers/SafariBlock/SafariBlock.bundle/ 
Contents/MacOS/SafariBlock,

265): no suitable image found.  Did find:
	/Library/InputManagers/SafariBlock/SafariBlock.bundle/Contents/ 
MacOS/SafariBlock:

GC capability mismatch

does anyone understand this?



You have installed an Input Manager. These are loaded into all running  
apps. Because you are building a GC-enabled app and the SafariBlock  
input manager is not GC-enabled, the runtime doesn't load the plug-in  
and returns the error you are seeing.


--
Rob Keniger



___

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

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

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

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


XCode and Safari Block Issues?

2009-06-15 Thread Chunk 1978
i installed Safari Block for Safai 4.  Safari Block, for those who do
not already know, blocks flash banner ads on internet sites.  to
install, users simply drag Safari Block folder into
/Libary/InputManagers.  Safai Block works fine.

however, now whenever i seems to build/launch an app in XCode, i get
this message in the console:

[Session started at 2009-06-15 07:53:16 -0400.]
2009-06-15 07:53:16.827 SimpleMenuScrolling[3044:10b] Error loading
/Library/InputManagers/SafariBlock/SafariBlock.bundle/Contents/MacOS/SafariBlock:
 
dlopen(/Library/InputManagers/SafariBlock/SafariBlock.bundle/Contents/MacOS/SafariBlock,
265): no suitable image found.  Did find:

/Library/InputManagers/SafariBlock/SafariBlock.bundle/Contents/MacOS/SafariBlock:
GC capability mismatch

does anyone understand this?
___

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

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

Help/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: to NIB or not to NIB

2009-06-15 Thread KK
My opinion on IB is... I use Macs because it's so easy to design interfaces.

On Mon, Jun 15, 2009 at 7:13 AM, Steve Bird  wrote:

>
> On Jun 15, 2009, at 6:56 AM, Chunk 1978 wrote:
>
>  what are your thoughts?  are developers who don't use IB masochists,
>> or is it a wise choice?
>>
>
>
> The prime directive is:
> USE THE BEST TOOL AT HAND FOR THE JOB AT HAND.
>
> If you have a better way, then use it!
>
> NOTE: the definition of "better" is highly subjective.
>
> 
> Steve Bird
> Culverson Software - Elegant software that is a pleasure to use.
> www.Culverson.com (toll free) 1-877-676-8175
>
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/kthemank%40gmail.com
>
> This email sent to kthem...@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: to NIB or not to NIB

2009-06-15 Thread Steve Bird


On Jun 15, 2009, at 6:56 AM, Chunk 1978 wrote:


what are your thoughts?  are developers who don't use IB masochists,
or is it a wise choice?



The prime directive is:
USE THE BEST TOOL AT HAND FOR THE JOB AT HAND.

If you have a better way, then use it!

NOTE: the definition of "better" is highly subjective.


Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175


___

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

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

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

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


to NIB or not to NIB

2009-06-15 Thread Chunk 1978
what are your thoughts?  are developers who don't use IB masochists,
or is it a wise choice?
___

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

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

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

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


asl search optimization

2009-06-15 Thread Santosh Sinha

Hello list,

I have written messages in asl log through asl_log() function. My  
problem is that when I went to search these messages through  
asl_search_query() method. it takes a long time to search them because  
it looks in whole system log.


Now I am curious how to optimize asl search. can we create our own  
separate asl file for a particular application in /var/log/asl folder.  
if Yes then what's the procedure. secondly, how to write and read  
messages to and from this file.


it will be good 4  me if anyone explained it with some lines of sample  
code.


Any help will be highly appreciated.

Thanks!

Santosh


___

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

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

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

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


Subtitle Track

2009-06-15 Thread Sandeep Nair
Hi,
can anybody tell the difference between text track and subtitle track.
I know to add a text track to a movie, how can i add a subtitle track.
can i add more than two language foe subtitle track?
is there any source regarding subtitle?

Thanks in advance

regards
Sandeep
___

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

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

Help/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, to-many relationships, and object graph consistency

2009-06-15 Thread Quincey Morris

On Jun 14, 2009, at 12:20, Sebastian Celis wrote:


SCBookTag *bookTag1 = [NSEntityDescription
insertNewObjectForEntityForName:@"BookTag"

inManagedObjectContext:managedObjectContext];
[bookTag1 setTag:tag1];
[bookTag1 setBook:book];


What implementation of the 'tag' and 'book' properties are you using?  
(That is, how are setTag and setBook defined?)



On the other hand, if I remove the [bookTag1 setBook:book] and
[bookTag2 setBook:book] lines and instead write:

NSMutableSet *theTags = [book mutableSetValueForKey:@"tags"];
[theTags addObject:bookTag1];
[theTags addObject:bookTag2];

Now, [[book tags] count] equals two! What about this situation am I
not understanding correctly? What is the correct way to do this? It
seems as though forcing me to use mutableSetValueForKey is strange,
especially because I would then have to do this for the Tag.bookTags
relationship as well instead of simply calling [bookTag1 setTag:tag1].


Either approach should work. Adding the bookTag to the book or setting  
the book on the bookTag should produce the same effect. Incidentally,  
it shouldn't be necessary to use 'mutableSetValueForKey:'. You should  
be able to write '[book addTagsObject: bookTag1]' (using the Core-Data- 
provided accessor method) so long as you follow the instructions in  
the documentation for making the method known to the compiler. But the  
effect is the same.


(It's a bit confusing, btw, that you've called the Book->BookTag  
relationship 'tags' instead of 'bookTags'.)



In general, these particular entities and relationships are giving me
a lot of grief. For example, I have test code that can add new Tag and
BookTag objects to an existing book and save them to the persistent
store. I also have test code that can successfully delete existing Tag
and BookTag objects. However, when I run both pieces of test code at
the same time (add a new BookTag and delete an existing BookTag) and
try to save , I get an error stating that there is a dangling
reference to an invalid object (a BookTag object).


You should double check that everything is correctly defined in your  
managed object model. Make sure, for example, that it shows that the  
inverse relationships are recognized as inverses. Also, check any  
validation conditions on your attributes. For example, if your Book- 
>BookTags to-many relationship has a cardinality range of 0-1, you  
probably aren't going to get the results you expect.


However, based on your description, it actually sounds more like you  
have a memory management problem. Are you using garbage collection? If  
not, are you sure you're retaining objects appropriately? Whatever  
gives you an actual error message is your best attack point for  
solving your problem.


You can use the debugger to examine your object relationships. When  
you add the second object to the relationship (from either end), are  
the first object's relationships getting clobbered, or are the second  
objects relationships not being set up properly?


You can also try calling [moc processPendingChanges] before checking  
to see if the desired inverse relationships were set up. I don't  
recall ever having to use it in such circumstances, but I may be  
misremembering the sequence of events.



___

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

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

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

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


xcode 2.4 and gcc 3.3

2009-06-15 Thread Angelo Chen
Hi,every new project i created in xcode 2.4 uses gcc 3.3, but when compiling i 
got:
gcc-3.3: installation problem, cannot exec `cc1obj': No such file or directory
gcc-3.3: installation problem, cannot exec `cc1obj': No such file or directoryI 
need to change the gcc 3.3 to gcc 4.0, is there a way to set the xcode to use 
gcc 4.0 as default?
Thanks,



  Yahoo!香港提供網上安全攻略,教你如何防範黑客! 請前往 http://hk.promo.yahoo.com/security/ 了解更多!
___

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

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

Help/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: Adding actions to undo manager

2009-06-15 Thread Ryan Joseph
Thanks. What a challenge just for some basic undo support, there  
really should be something simpler than this.


On Jun 15, 2009, at 1:08 PM, Kyle Sluder wrote:


If you want undo manager support, you need to either perform the undo
machinations yourself, or target your modifications at an entity
higher up in the text system chain.  More information (along with an
incomplete and perhaps misguided implementation) can be found on the
CocoaDev wiki: http://www.cocoadev.com/index.pl?UndoSupportForNSTextStorage

--Kyle Sluder


Regards,
Josef

___

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

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

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

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