Newbie question: Object as input arguments

2008-11-26 Thread Jose A. Guerrero-Colón
Hello List, I'm in my baby steps on Cocoa Development, Objective C in particular. My question is in regard the following situation: Imagine that we have a cocoa application, "App_A" which create an object with information introduced by the user (the object is rather ellaborated and compl

set position of alert panel

2008-11-26 Thread Nishad Kumar
Hi all,i want to set the position of alert panel at centre of my application's main window rather than screen centre. I developing my application with Cocoa - Objective C. how can i do it. With thanks & regards,Nishad. _ Searching f

Do I need Custom View inside a hud panel to drag-n-drop images ??

2008-11-26 Thread Gustavo Pizano
Hello, well Im new to cocoa programing, but eager to learn, Im doing a small project, a naval battle game, I have a HUD panel which contains 5 NSImageView, one per Ship,(Carrier, frigate,...etc), and I wish to drag-ndrop those images which actually represents my objects in my model, into t

Number of Files on Volume

2008-11-26 Thread Joe Turner
I have ben trying to find a good way to get an accurate count of files on a Volume. Using a NSDirectoryEnumerator takes way too long (a couples minutes), so, I figured out how to do it on the old Carbon FileManager using: FSVolumeInfo info; FSRef pathRef; FSCatalogInfo catInfo; const char *

Re: Chapters in Hillegass to skip on first reading?

2008-11-26 Thread Michael Grant
I'd reconsider skipping the Core Data chapter. You can save yourself a LOT of coding with Core Data. Michael On Tue, Nov 25, 2008 at 5:30 PM, Ulai Beekam <[EMAIL PROTECTED]> wrote: > > Hi, > Let's say I have a plan for a simple app. Nothing too fancy, in a way. To > name an example, it could be

Re: Chapters in Hillegass to skip on first reading?

2008-11-26 Thread Gustavo Pizano
HEllo, Well Im following the book as well and the chapters you mention are really interesting and short, the problem is that some chapter are related so it happened to me that I skipped one and I saw that it was related with the prior project. Gus On 26.11.2008, at 0:30, Ulai Beekam w

How to use IB to create a viewcontroller which actually linking to another nib file?

2008-11-26 Thread Hu Shaw
Hi All, I'm a newbie here. And i'm not sure if I can send questions directly to this mail list. If not, please kindly tell me how to ask questions. Thanks! When I create a new prj using "viewbased app" template, it will create 2 nib file. And in MainWindow.xib, thre is a viewcontroller, when I op

Re: NSTableView Drag-Drop re-ordering...

2008-11-26 Thread Jean-Nicolas Jolivet
As I said... I have no problems with dragging files on the data table... my table is already a drag destination and its working well...with the bindings in place etc... What I can't find is good info about re-ordering the table row with drag and drop, and I did search google for the obvious

Re: Number of Files on Volume

2008-11-26 Thread Andrew Farmer
On 25 Nov 08, at 16:44, Joe Turner wrote: I have ben trying to find a good way to get an accurate count of files on a Volume. Using a NSDirectoryEnumerator takes way too long (a couples minutes), so, I figured out how to do it on the old Carbon FileManager using [FSGetVolumeInfo...] Is the

Re: NSTableView Drag-Drop re-ordering...

2008-11-26 Thread mmalcolm crawford
On Nov 26, 2008, at 12:06 AM, Jean-Nicolas Jolivet wrote: What I can't find is good info about re-ordering the table row with drag and drop, and I did search google for the obvious key words (NSTableView drag drop order, NSTableView re-order etc etc..) Did you look at the example? mmalc

Re: Programatically Triggering an NSSearchField Search

2008-11-26 Thread Frédéric Testuz
Le 26 nov. 08 à 04:57, Steve Steinitz a écrit : Hello, I use NSSearchFields bound to NSArrayControllers to allow my client to search their Core Data database. Pretty standard. My search predicate bindings are lengthy, giving my client lots of options to find what they want. Occasional

Re: NSTableView Drag-Drop re-ordering...

2008-11-26 Thread Jean-Nicolas Jolivet
Well it depends on which example you're talking about... you posted a google search result... The first link (a cocoa builder link) has nothing to do with row re- ordering... The second link (CocoaDev one) has a bunch of code examples but a bunch are from users saying they're having problems

Re: NSTableView Drag-Drop re-ordering...

2008-11-26 Thread chaitanya pandit
To re-order the items in the tableView, you will have to implement a custom drag type. Say for example you name your custom drag type as @"myDragType" then 1] Register your table view to accept this drag type using "registerForDraggedTypes:" and passing an array containing @"myDragType" alon

Re: NSTableView Drag-Drop re-ordering...

2008-11-26 Thread Jean-Nicolas Jolivet
Thanks a lot Chaitanya... exactly the kind of info i was looking for! :) On 26-Nov-08, at 3:41 AM, chaitanya pandit wrote: To re-order the items in the tableView, you will have to implement a custom drag type. Say for example you name your custom drag type as @"myDragType" then 1] Register y

Re: How to use IB to create a viewcontroller which actually linking to another nib file?

2008-11-26 Thread Jonathan Hess
Hey Hu - You can drag a view controller into your document from the library, and then set the NIB name in the attributes inspector (command + 1). When the outer NIB is loaded, the view controller will be immediately created but will lazily load its view from the specified NIB/XIB. Good lu

Re: NSTableView Drag-Drop re-ordering...

2008-11-26 Thread mmalcolm crawford
On Nov 26, 2008, at 12:37 AM, Jean-Nicolas Jolivet wrote: Well it depends on which example you're talking about... you posted a google search result... The first link (a cocoa builder link) has nothing to do with row re- ordering... The second link (CocoaDev one) has a bunch of code examples

Re: NSTableView Drag-Drop re-ordering...

2008-11-26 Thread Michael Robinson
(I really did intend for this to reach the list, but I hurriedly pressed the "reply to sender" hotkey) Hi Jean-Nicolas I too had a horrible time implementing this. Below I've pasted the code that handles dnd re-ordering in my table. Basically it just makes a copy of the dragged row, deletes i

Re: Preventing a user from moving a window

2008-11-26 Thread Benjamin Dobson
On 26 Nov 2008, at 03:28:11, Damien Cooke wrote: Hi all, I have an arrangement of windows that I do not want the user to move. What is the best way of doing this. There are several ways I thought of but they are not very elegant. Can someone point me in the right direction? Regards Da

Re: Number of Files on Volume

2008-11-26 Thread Graham Lee
On 26/11/2008 08:28, "Andrew Farmer" <[EMAIL PROTECTED]> wrote: > On 25 Nov 08, at 16:44, Joe Turner wrote: >> I have ben trying to find a good way to get an accurate count of >> files on a Volume. Using a NSDirectoryEnumerator takes way too long >> (a couples minutes), so, I figured out how to do

Re: Preventing a user from moving a window

2008-11-26 Thread Gregory Weston
Damien Cooke wrote: Hi all, I have an arrangement of windows that I do not want the user to move. What is the best way of doing this. There are several ways I thought of but they are not very elegant. Can someone point me in the right direction? The right direction is *probably* to rethink y

Re: NSTableView Drag-Drop re-ordering...

2008-11-26 Thread mmalcolm crawford
On Nov 26, 2008, at 2:02 AM, Jean-Nicolas Jolivet wrote: Sorry for not spotting that one earlier... I thought WithAndWithoutBinding was basically the same example only more recent...! I've updated the descriptions to try to make it more clear. mmalc _

Re: NSTableView Drag-Drop re-ordering...

2008-11-26 Thread Chris Idou
--- On Wed, 26/11/08, Michael Robinson <[EMAIL PROTECTED]> wrote: > I too had a horrible time implementing this. > > Below I've pasted the code that handles dnd re-ordering > in my table. > > Basically it just makes a copy of the dragged row, deletes > it, then rebuilds the array, inserting the

Re: Programatically Triggering an NSSearchField Search

2008-11-26 Thread Steve Steinitz
Hi Frédéric Thank you for your helpful reply. On 26/11/08, Frédéric Testuz wrote: I'm not sure but did you try : [searchfield validateEditing]; - (void)validateEditing Thank you so much for pointing me to NSControl. I found many goodies there. validateEditing on its own did not solve th

Re: Number of Files on Volume

2008-11-26 Thread Joe Turner
Thanks you! I remembered that there was a NSFileSystemNodes and NSFileSystemFreeNodes in the filesystem attribute dictionary of the Cocoa FileManager, so, I did what you told me and subtracted free nodes from total nodes :) On Nov 26, 2008, at 5:53 AM, Graham Lee wrote: On 26/11/2008 0

Re: NSTableView Drag-Drop re-ordering...

2008-11-26 Thread mmalcolm crawford
On Nov 26, 2008, at 1:42 AM, Jean-Nicolas Jolivet wrote: mmm interesting, I did download WithAndWithoutBindings before posting but it doesn't seem to implement drag and drop re- ordering... not in the WithBinding version at least... I'm trying it right now and it's definitely not working...

Re: Testing apps on 10.*

2008-11-26 Thread Gregory Weston
On Nov 25, 2008, at 9:03 PM, Gerriet M. Denkmann wrote: On 26 Nov 2008, at 02:28, Gregory Weston <[EMAIL PROTECTED]> wrote: macdev wrote: I was wondering what the common ways are to test my application on OSX 10.* versions. Besides having a separate machine each having a different version

Re: How to tell if app launched via login item (versus manual launch)

2008-11-26 Thread Mark Aufflick
Perfect thanks! The only minor tweak is that the AE doesn't coerce into an int32Value (you always get 0), instead I used the enumCodeValue method and it works as advertised. For the question about why I want to know - I have a preference option to say don't open a default window if the applicatio

Re: [Reposted] Document based resource strategy

2008-11-26 Thread Gerriet M. Denkmann
On 26 Nov 2008, at 09:14, Jason Stephenson wrote: Gerriet M. Denkmann wrote: What version of Xcode do you have installed? I have 3.1.1 and Safari just says: "No file exists at the address “/Developer/ Documentation/DocSets/ com.apple.ADC_Reference_Library.CoreReference.docset/Contents/ Re

Re: NSTableView Drag-Drop re-ordering...

2008-11-26 Thread Jean-Nicolas Jolivet
mmm interesting, I did download WithAndWithoutBindings before posting but it doesn't seem to implement drag and drop re-ordering... not in the WithBinding version at least... I'm trying it right now and it's definitely not working... It seems like when they are saying "re-ordering" they mea

Re: Number of Files on Volume

2008-11-26 Thread Joe Turner
Okay, maybe I spoke too soon... It worked twice. To get the number of files, I am doing this now: - (NSNumber *)fileCount { NSDictionary *attributes = [[NSFileManager defaultManager] fileSystemAttributesAtPath:path]; return [NSNumber numberWithDouble: ([[attr

Re: set position of alert panel

2008-11-26 Thread Mike Abdullah
I'd advise against this. Either accept the standardised system behaviour, or use a sheet instead. That said, NSAlert has a -window method. You should be able to grab the window with that and place it wherever you like using - setFrame:display: Mike. On 25 Nov 2008, at 11:49, Nishad Kumar

core-data multiple contexts or coordinators?

2008-11-26 Thread Chris Idou
The core-data documentation seems very vague about whether multiple threads should use different NSManagedObjectContexts but one NSPersistentStoreCoordinator, or multiple coordinators. I've got an app where one thread needs to write, and one (or maybe more) threads need to read. One or more co

Re: How to get notification of rerun application

2008-11-26 Thread Macarov Anatoli
Example: http://www.cocoabuilder.com/archive/message/cocoa/2001/7/8/41850 - (BOOL)applicationShouldHandleReopen:(NSApplication *)sender hasVisibleWindows:(BOOL)flag {     NSBeep();     NSLog(@"Hi");     return YES; } And in awakeFromNib in the same class [NSApp setDelegate:self];

Code signing and verification

2008-11-26 Thread Donnie Lee
Hello. I'd like to sign my Application and check this signature from another my Application. I've found how to sign an app, but I can't find how to check already signed app from objective-c/cocoa. Also I need to verify that the program was signed with my certificate, not with any other certificate

NSTrackingArea strange requirement

2008-11-26 Thread rajesh
Hi all, I have Custom NSView with set of boxes arranged in some pattern ( boxes with some extra UI elements like , text fields and stuff). I am using the gaps between the boxes a.k.a the visible custom NSView to add the NStrackingAreas for cursor updates and as well for resizing the subview

Re: Number of Files on Volume

2008-11-26 Thread Jean-Daniel Dupas
Just a question, what was wrong with the CoreServices way ? (ie using FSGetVolumeInfo). Le 26 nov. 08 à 15:19, Joe Turner a écrit : Okay, maybe I spoke too soon... It worked twice. To get the number of files, I am doing this now: - (NSNumber *)fileCount { NSDictionary *attributes = [[NSFi

Re: Number of Files on Volume

2008-11-26 Thread Joe Turner
I'm just worried that it will be deprecated soon with the release of Snow Leopard; it is Carbon. Second, I just wanted to see if there was an easy Cocoa way; the CoreServices way works fine. On Nov 26, 2008, at 8:51 AM, Jean-Daniel Dupas wrote: Just a question, what was wrong with the CoreSer

to get handle to "File/1.jpg"

2008-11-26 Thread Nick Rogers
Hi, How do I obtain a NSFileHandle to this file which has a forward slash in the name to be able to write to this file. Supplying the path to NSFileHandle with filename in quotes also fails. If not possible is there any other way to write to such a file. I can't use open(), as the file name cou

Re: NSTableView Drag-Drop re-ordering...

2008-11-26 Thread Jean-Nicolas Jolivet
Got it! thanks a lot for the code! Sorry for not spotting that one earlier... I thought WithAndWithoutBinding was basically the same example only more recent...! J-N On 26-Nov-08, at 4:59 AM, mmalcolm crawford wrote: On Nov 26, 2008, at 1:42 AM, Jean-Nicolas Jolivet wrote: mmm interest

Re: set position of alert panel

2008-11-26 Thread Michael Ash
On Tue, Nov 25, 2008 at 6:49 AM, Nishad Kumar <[EMAIL PROTECTED]> wrote: > > Hi all,i want to set the position of alert panel at centre of my > application's main window rather than screen centre. I developing my > application with Cocoa - Objective C. how can i do it. With thanks & > regards,Ni

Re: Programatically Triggering an NSSearchField Search

2008-11-26 Thread Steve Steinitz
Hi Frédéric I determined that a single method will propagate a programatically-set NSSearchFieldCell value to its NSArrayController: [searchfield setStringValue: aSearchString]; [searchfield performClick: self]; Ta-Dum. Thanks again Frédéric and all the best, Steve ___

Re: to get handle to "File/1.jpg"

2008-11-26 Thread James Montgomerie
On 26 Nov 2008, at 14:56, Nick Rogers wrote: Hi, How do I obtain a NSFileHandle to this file which has a forward slash in the name to be able to write to this file. Supplying the path to NSFileHandle with filename in quotes also fails. If not possible is there any other way to write to such a

Re: Number of Files on Volume

2008-11-26 Thread Jean-Daniel Dupas
Only the HIToolbox will be discontinued. All others API are already available in 64 bits app. IMHO Apple is neither going to remove the CoreServices File Manager nor even mark it deprecated (before at least Mac OS 11 or 12). There is no Cocoa API to efficiently access the File System. And

Re: Code signing and verification

2008-11-26 Thread Michael Ash
On Wed, Nov 26, 2008 at 7:14 AM, Donnie Lee <[EMAIL PROTECTED]> wrote: > Hello. > > I'd like to sign my Application and check this signature from another > my Application. I've found how to sign an app, but I can't find how to > check already signed app from objective-c/cocoa. Also I need to verify

Re: to get handle to "File/1.jpg"

2008-11-26 Thread Michael Ash
On Wed, Nov 26, 2008 at 9:56 AM, Nick Rogers <[EMAIL PROTECTED]> wrote: > Hi, > How do I obtain a NSFileHandle to this file which has a forward slash in the > name to be able to write to this file. > Supplying the path to NSFileHandle with filename in quotes also fails. Filenames cannot have slash

Re: Number of Files on Volume

2008-11-26 Thread Joe Turner
Thanks :) As long as I know it will not be deprecated anytime soon, I will use it :) Cheers! On Nov 26, 2008, at 9:19 AM, Jean-Daniel Dupas wrote: Only the HIToolbox will be discontinued. All others API are already available in 64 bits app. IMHO Apple is neither going to remove the Cor

Re: to get handle to "File/1.jpg"

2008-11-26 Thread Jean-Daniel Dupas
Le 26 nov. 08 à 16:19, James Montgomerie a écrit : On 26 Nov 2008, at 14:56, Nick Rogers wrote: Hi, How do I obtain a NSFileHandle to this file which has a forward slash in the name to be able to write to this file. Supplying the path to NSFileHandle with filename in quotes also fails. If

Re: Killing a Thread

2008-11-26 Thread Scott Ribe
> The application is not crashing, but the thread is not exiting. From UI I'm > giving a time interval say 10sec is set for the time interval between emails > to be send. At the first time when I'm clicking the button to send email, > the thread is getting called and is working fine and sends email

Re: to get handle to "File/1.jpg"

2008-11-26 Thread James Montgomerie
On 26 Nov 2008, at 15:28, Jean-Daniel Dupas wrote: Le 26 nov. 08 à 16:19, James Montgomerie a écrit : On 26 Nov 2008, at 14:56, Nick Rogers wrote: Hi, How do I obtain a NSFileHandle to this file which has a forward slash in the name to be able to write to this file. Supplying the path to NS

Re: NSTrackingArea strange requirement

2008-11-26 Thread rajesh
hi all Sorry , I completely overlooked the part "updateTrackingAreas" may be I can override and reduce some over head. If any one has better solution , do let me know. Thanks in advance Rajesh On Nov 26, 2008, at 3:30 PM, rajesh wrote: Hi all, I have Custom NSView with set of boxes arran

Re: core-data multiple contexts or coordinators?

2008-11-26 Thread Jim Correia
On Nov 26, 2008, at 5:02 AM, Chris Idou wrote: The core-data documentation seems very vague about whether multiple threads should use different NSManagedObjectContexts but one NSPersistentStoreCoordinator, or multiple coordinators. I've got an app where one thread needs to write, and one (

Re: Code signing and verification

2008-11-26 Thread Donnie Lee
>> I'd like to sign my Application and check this signature from another >> my Application. I've found how to sign an app, but I can't find how to >> check already signed app from objective-c/cocoa. Also I need to verify >> that the program was signed with my certificate, not with any other >> cert

Re: [Reposted] Document based resource strategy

2008-11-26 Thread Keary Suska
On Nov 25, 2008, at 5:29 PM, Carlos Eduardo Mello wrote: Guess I wasn't clear again... I'm not talking about the fact that the NSDocument subclass owns the document window nib, as in 'iSpend'. What I mean is this: if you check the tableview in iSpend, it has its datasource outlet connect t

Re: to get handle to "File/1.jpg"

2008-11-26 Thread Gregory Weston
Michael Ash wrote: Hi, How do I obtain a NSFileHandle to this file which has a forward slash in the name to be able to write to this file. Supplying the path to NSFileHandle with filename in quotes also fails. Filenames cannot have slashes in them. If you think that your file has one, the

Re: Need some advice on multithreading

2008-11-26 Thread David Phillip Oster
At 11:42 AM -0800 11/24/08, [EMAIL PROTECTED] wrote: No, it's not a general consensus. It's something I discovered on my own, and posted about it here. I haven't received any overall confirmation that it's broken, but my simple test project was able to reliably crash on perhaps half a dozen diffe

Re: Killing a Thread

2008-11-26 Thread Scott Ribe
It occurs to me that maybe you do not know about or understand the use of the pause button in the debugger. Get your application to the state where it's hung up. Then hit the pause button in the debugger. Then use the thread popup to examine the stack of each thread. Once you know where each threa

Re: to get handle to "File/1.jpg"

2008-11-26 Thread Scott Ribe
> At the > filesystem level, that '/' is really a ':' (to avoid clashing with the > '/' directory seperator character). Just replace the '/' with a ':' > and you'll be set. Actually, it's probably not, because HFS can't store a file with a ":" in it, but can store a file with a "/" in it. But t

Re: to get handle to "File/1.jpg"

2008-11-26 Thread Michael Ash
On Wed, Nov 26, 2008 at 11:41 AM, Gregory Weston <[EMAIL PROTECTED]> wrote: > Michael Ash wrote: > >>> Hi, >>> How do I obtain a NSFileHandle to this file which has a forward slash in >>> the >>> name to be able to write to this file. >>> Supplying the path to NSFileHandle with filename in quotes a

Re: NSTrackingArea strange requirement

2008-11-26 Thread Quincey Morris
On Nov 26, 2008, at 06:30, rajesh wrote: I have Custom NSView with set of boxes arranged in some pattern ( boxes with some extra UI elements like , text fields and stuff). I am using the gaps between the boxes a.k.a the visible custom NSView to add the NStrackingAreas for cursor updates and a

Multiple NSTableViews in one NSScrollView

2008-11-26 Thread Thomas Engelmeier
Hi, I have an UI where a bunch of NSTableViews plus extra title views are stacked in one NSScrollView. Currently each table is loaded from a subview NIB, populated, resized- to-fit and placed in a master documentview. That is working fine except IB generated TableViews reside already in a

RE: Chapters in Hillegass to skip on first reading?

2008-11-26 Thread 李瑞
Hi, I am also a beginner, and I am confused about how to skip the chapters of this book. > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > Date: Wed, 26 Nov 2008 08:05:50 +0100 > CC: cocoa-dev@lists.apple.com > Subject: Re: Chapters in Hillegass to skip on first reading? > > HEllo, > Wel

RE: How to use IB to create a viewcontroller which actually linking to another nib file?

2008-11-26 Thread 李瑞
Hi, To be honest, i can't catch what your question are. Maybe this could help you loadNibFile:externalNameTable:withZone: Unarchives the contents of the nib file and links them to objects in your program. + (BOOL)loadNibFile:(NSString *)fileName externalNameTable:(NSDictionary *)context

Scheduling and launchd

2008-11-26 Thread Per Ohlson
I'm trying to schedule multiple events that are supposed to trigger an application at different hours on different days. My current idea is to use launchd with each event as plist in Library/LaunchAgents. However, is it a bad idea to spam the LaunchAgents-folder? Can I use multiple dates in the sa

Live editing an NSTextView

2008-11-26 Thread Arved von Brasch
Dear Cocoa Dev List, I am attempting to add live editing to a NSTextView. This means that when the user types some specific text, the text view notices and converts it into a different substring, with possibly a different length. The idea is similar to an auto-correcting spell checker.

Using NSAnimation

2008-11-26 Thread Hrishikesh Muruk
I have a basic question about using NSAnimation. Here is what I am trying to do: My program shows a custom view and I want to animate an NSImage within that custom view. When the mouse is clicked within the program I want to move (animate) the image to a new point in the window. I have su

Re: Live editing an NSTextView

2008-11-26 Thread Douglas Davidson
On Nov 26, 2008, at 4:14 AM, Arved von Brasch wrote: I have this working almost perfectly by listening for the NSTextDidChangeNotification and searching the text for the special sequence. I've found this to be the best place to handle it, so that cut and paste operations containing the sp

Re: to get handle to "File/1.jpg"

2008-11-26 Thread Stefan Werner
On Nov 26, 2008, at 6:44 PM, Scott Ribe wrote: Actually, it's probably not, because HFS can't store a file with a ":" in it, but can store a file with a "/" in it. But the UNIX stuff means much of the OS can't handle a file with a "/" in it, so it gets mapped to ":" for the OS. But some Ma

Re: Using NSAnimation

2008-11-26 Thread Matt Long
Core Animation using layers would make this simpler for you, I think. You can still get the click from the layer backed view, but then add your image to the view's layer tree as a layer. Animating a layer is trivial in CA. I did a blog post on how to animate a layer to the clicked point in

Re: NSImage/NSImageView/GIF Saving an Animated GIF from NSImageView

2008-11-26 Thread Michael Robinson
I was wondering if anyone had any ideas on how to do this? Thanks Michael Robinson wrote: Hi list, I'd like to be able to use an NSImageView to display a default animated GIF image. The image may be replaced by the user. I have been using the code below to save / load images from / into th

Re: Code signing and verification

2008-11-26 Thread Chris Hanson
On Nov 26, 2008, at 7:32 PM, Donnie Lee wrote: There is currently no public API for code signing. You can use the codesign command line tool. See the man page for how to use it and all of the various options available. That is really sad :( Thank you for the answer, Michael! As always, i

Re: Live editing an NSTextView

2008-11-26 Thread Arved von Brasch
On 2008-11-27, at 05:57 , Douglas Davidson wrote: On Nov 26, 2008, at 4:14 AM, Arved von Brasch wrote: I have this working almost perfectly by listening for the NSTextDidChangeNotification and searching the text for the special sequence. I've found this to be the best place to handle it,

Figure out the size of an NSAttributedString

2008-11-26 Thread Jean-Nicolas Jolivet
I know this might seem like a weird idea, but I need to figure out the size (width and height) of an NSAttributedString that I am drawing... basically I need to know it because I am drawing it inside a larger image and I need to position it... however the string can be of any font/size/leng

Core Data modeling question

2008-11-26 Thread Markus Schneider
Hi All, I have started using CoreData and have a modeling question. My model has a managed object "TASK", which shall be executed each day during a time period. Therefore, I have added a startDate and an endDate as attributes: TASK - startDate - endDa

Re: Figure out the size of an NSAttributedString

2008-11-26 Thread Douglas Davidson
On Nov 26, 2008, at 3:14 PM, Jean-Nicolas Jolivet wrote: I know this might seem like a weird idea, but I need to figure out the size (width and height) of an NSAttributedString that I am drawing... basically I need to know it because I am drawing it inside a larger image and I need to posi

Re: Figure out the size of an NSAttributedString

2008-11-26 Thread Nick Zitzmann
On Nov 26, 2008, at 4:14 PM, Jean-Nicolas Jolivet wrote: I know this might seem like a weird idea, but I need to figure out the size (width and height) of an NSAttributedString that I am drawing... basically I need to know it because I am drawing it inside a larger image and I need to posi

Re: Figure out the size of an NSAttributedString

2008-11-26 Thread Jean-Daniel Dupas
Le 27 nov. 08 à 00:14, Jean-Nicolas Jolivet a écrit : I know this might seem like a weird idea, but I need to figure out the size (width and height) of an NSAttributedString that I am drawing... basically I need to know it because I am drawing it inside a larger image and I need to positio

Re: Figure out the size of an NSAttributedString

2008-11-26 Thread Gerd Knops
On Nov 26, 2008, at 5:14 PM, Jean-Nicolas Jolivet wrote: I know this might seem like a weird idea, but I need to figure out the size (width and height) of an NSAttributedString that I am drawing... basically I need to know it because I am drawing it inside a larger image and I need to posi

Re: Figure out the size of an NSAttributedString

2008-11-26 Thread Jean-Nicolas Jolivet
Thanks to all Somehow I assumed it wouldn't be something that is commonly used... now that I think about it, it makes perfect sense that one would need to know the size of a string that is do be drawn!... apparently I should've dig a little deeper! A hearty RTFM to myself! :) Thanks

Using a string as filepath

2008-11-26 Thread Knut Lorenzen
Dear list, I would like to name a file according to an user defined entry. However, the user's name entry might be illegal as a filepath, containing illegal characters for a pathname like "." or "-" as 1st character, "/", ":", etc. I've looked into the Cocoa docs for NSString and NSFileMa

Re: Using a string as filepath

2008-11-26 Thread Kiel Gillard
On 27/11/2008, at 11:09 AM, Knut Lorenzen wrote: Dear list, I would like to name a file according to an user defined entry. However, the user's name entry might be illegal as a filepath, containing illegal characters for a pathname like "." or "-" as 1st character, "/", ":", etc. I've l

Re: Which Mac models use the new 64-bit Objective-C ABI?

2008-11-26 Thread Sean McBride
On 11/20/08 9:52 AM, Nick Zitzmann said: >The 64-bit environment has sort of been a mixed bag in my experience Agreed. I'm very glad we didn't go 64 bit only. In addition to Nick's great list, I'd add: 5. The tools don't support 64 bit as well as they do 32 bit. Thread Viewer.app doesn't supp

Re: to get handle to "File/1.jpg"

2008-11-26 Thread Gregory Weston
Stefan Werner wrote: Actually, it's probably not, because HFS can't store a file with a ":" in it, but can store a file with a "/" in it. But the UNIX stuff means much of the OS can't handle a file with a "/" in it, so it gets mapped to ":" for the OS. But some Mac APIs can't handle the ":" so t

Re: Newbie question: Object as input arguments

2008-11-26 Thread Ken Thomases
On Nov 25, 2008, at 2:14 AM, Jose A. Guerrero-Colón wrote: Imagine that we have a cocoa application, "App_A" which create an object with information introduced by the user (the object is rather ellaborated and complex). At the very last point of this application, I would like to pass that o

Scheme for efficiently archiving images.

2008-11-26 Thread Graham Cox
In my app I have a class that "has a" NSImage which it displays. Currently, when I archive the whole kit-n-kaboodle when saving to a file, the image simply gets archived as an object. With small images it's not too bad, but I have noticed for some larger images a huge amount of inflation oc

Re: Scheme for efficiently archiving images.

2008-11-26 Thread Ken Ferry
I don't have time to go much into this before I go off for the holiday, but one thing: On Wed, Nov 26, 2008 at 5:26 PM, Graham Cox <[EMAIL PROTECTED]> wrote: > For images from a file, I am thinking I can copy the > original file into my package and simply archive a relative path to it. If you cre

Sort Through Commas in Cocoa

2008-11-26 Thread Pierce Freeman
Hi everyone. Assuming that you get input from user via a regular text field, I am wondering how you can sort through the commas and then save each of the words that come before the commas into a array. For example, the words below would be what the user inputted: Apple, banana, grapes Then it w

Re: Sort Through Commas in Cocoa

2008-11-26 Thread Nick Zitzmann
On Nov 26, 2008, at 7:12 PM, Pierce Freeman wrote: Assuming that you get input from user via a regular text field, I am wondering how you can sort through the commas and then save each of the words that come before the commas into a array. For example, the words below would be what the us

Re: Sort Through Commas in Cocoa

2008-11-26 Thread Pierce Freeman
Thanks for your reply. I understand how you would do that much, but how exactly would you do that if Apple, Banana, Grape were stored in a variable? Sent from my iPhone On Nov 26, 2008, at 6:23 PM, Nick Zitzmann <[EMAIL PROTECTED]> wrote: On Nov 26, 2008, at 7:12 PM, Pierce Freeman wrot

Re: Sort Through Commas in Cocoa

2008-11-26 Thread Nick Zitzmann
On Nov 26, 2008, at 7:28 PM, Pierce Freeman wrote: Thanks for your reply. I understand how you would do that much, but how exactly would you do that if Apple, Banana, Grape were stored in a variable? Same thing as I wrote, except substitute the variable's name for the constant. Nick

Memory management puzzle

2008-11-26 Thread DKJ
I've got something this in my code, which is run several times by the app: UIView *subView = [[MyView alloc] initWithFrame:frame]; [theView addSubview:subView]; [subView release]; Later on this happens: [subView removeFromSuperView]; subView = nil; The

Re: Scheme for efficiently archiving images.

2008-11-26 Thread Ken Thomases
On Nov 26, 2008, at 7:26 PM, Graham Cox wrote: In my app I have a class that "has a" NSImage which it displays. Currently, when I archive the whole kit-n-kaboodle when saving to a file, the image simply gets archived as an object. [...] There are a few issues though. When my image-owning ob

how to set up nextKeyView, full keyboard access etc, for custom subviews set up in code (rather than nib)

2008-11-26 Thread Rua Haszard Morris
I have a dialog that has a few controls as well as a complex custom view that itself contains other controls as subviews. The custom view (for various good reasons) is instantiated and added as a subview in code. A template view and NSView's replaceSubview:with is used so the positioning et

Re: to get handle to "File/1.jpg"

2008-11-26 Thread Scott Ribe
> More to the point, from the perspective of both the Cocoa APIs and the > low-level POSIX APIs that every other userland API... This is specifically not true of some Carbon/Core APIs. -- Scott Ribe [EMAIL PROTECTED] http://www.killerbytes.com/ (303) 722-0567 voice

Re: Memory management puzzle

2008-11-26 Thread Roland King
hmm - I do believe this works for me, I have views being destroyed in my app and they are going away. Have you tried something a bit gross and disgusting which is getting the current refcount before and after the removeFromSuperView? I know that you cannot use the absolute value of your refcou

Re: Scheme for efficiently archiving images.

2008-11-26 Thread Graham Cox
On 27 Nov 2008, at 12:49 pm, Ken Ferry wrote: I don't have time to go much into this before I go off for the holiday, but one thing: On Wed, Nov 26, 2008 at 5:26 PM, Graham Cox <[EMAIL PROTECTED]> wrote: For images from a file, I am thinking I can copy the original file into my package and

Re: Memory management puzzle

2008-11-26 Thread Scott Ribe
Are you sure your dealloc is not being called? Are you sure your dealloc has the correct method signature? Because the "I got an EXC_BAD_ACCESS as well" thing sure sounds like your view is being deallocated. -- Scott Ribe [EMAIL PROTECTED] http://www.killerbytes.com/ (303) 722-0567 voice __

Re: Need some advice on multithreading

2008-11-26 Thread Peter N Lewis
At 9:00 -0800 26/11/08, David Phillip Oster wrote: However, if instead of using 10 NSOperationQueues, you use a single global NSOperationQueue, the program stops crashing and becomes reliable. If you want serialization, then use -[NSOperation addDependency:] that is what addDependency: is for

Re: Using a string as filepath

2008-11-26 Thread Michael Ash
On Wed, Nov 26, 2008 at 7:09 PM, Knut Lorenzen <[EMAIL PROTECTED]> wrote: > Dear list, > > I would like to name a file according to an user defined entry. However, the > user's name entry might be illegal as a filepath, containing illegal > characters for a pathname like "." or "-" as 1st character

Re: Scheme for efficiently archiving images.

2008-11-26 Thread Graham Cox
On 27 Nov 2008, at 2:00 pm, Ken Thomases wrote: First, it seems to me like you don't want an NSImage in your model. You want the original source of the image. Either a file path or a blob of data with some meta-data (e.g. UTI) describing it and what it is. You'd use NSImage as a view-en

Re: Newbie question: Object as input arguments

2008-11-26 Thread
Thanks Ken for the information. I think that the best solution so far is the archiving thing. Lastly, I have to say this is a pretty weird request. Why do you want to chain applications like this? If App_A is ending and passing work off to App_B, why not just have App_A "become" App_B by

  1   2   >