Re: Authorization Question (Possibly a simple POSIX question?)

2009-08-21 Thread Stephen J. Butler
On Fri, Aug 21, 2009 at 1:56 AM, Dave Keck wrote: > File descriptors can be passed between processes using the sendmsg() API. > > If you have further questions about that, I'd suggest taking this > question to darwin-dev. Also, the MoreIsBetter samples include MoreSecurity which helps you write he

When to 'release' in Cocoa management?

2009-08-21 Thread DairyKnight
Hi, In some calls to Cocoa API subroutines we do: UIView *myView = [[UIView alloc] init]; [window addSubView:myView]; [myView release]; but sometimes you cannot release the temporarily allocated object, e.g. : UIDatePicler *picker; ... (picker was initialised somewhere) NSDate *date = [[NSDa

Re: When to 'release' in Cocoa management?

2009-08-21 Thread Graham Cox
On 21/08/2009, at 5:32 PM, DairyKnight wrote: NSDate *date = [[NSDate alloc] init]; [picker setDate:date]; [date release]; // Opps! immediate release of 'date' causes program crash. So is there a rule of thumb, like when should we release immediately after passing the object to some Coc

Re: When to 'release' in Cocoa management?

2009-08-21 Thread bryscomat
Yes. You release the object when one of three things occur: 1. You allocate the object yourself with the "alloc" message. 2. You allocate the object yourself with the shorthand "new" message. 3. You issue a retain message. So in both examples you gave you are required to release the object, as

Re: Authorization Question (Possibly a simple POSIX question?)

2009-08-21 Thread Ken Thomases
On Aug 21, 2009, at 1:33 AM, Seth Willits wrote: I'm looking at some code* in an app which uses a helper tool, in order to open and read the contents of a protected file. Normally the user does not have privileges to read this file, hence the authorization. Here's the process it goes throug

Re: When do I need to override hash?

2009-08-21 Thread Alastair Houghton
On 21 Aug 2009, at 03:45, Jeff Laing wrote: The -hash method is important for objects that are used as keys in associative collections. [snip] So, in practice, it's perfectly safe in 99.9% of cases to base your hash off your object's properties. In the specific case when you're mutating objects

Re: When do I need to override hash?

2009-08-21 Thread Alastair Houghton
On 21 Aug 2009, at 04:51, Seth Willits wrote: On Aug 20, 2009, at 2:31 PM, Alastair Houghton wrote: The -hash method is important for objects that are used as keys in associative collections. The documentation, nor did many others' comments on this topic, make it clear that the mutability

Re: When do I need to override hash?

2009-08-21 Thread Alastair Houghton
On 21 Aug 2009, at 05:44, Quincey Morris wrote: On Aug 20, 2009, at 20:51, Seth Willits wrote: The documentation, nor did many others' comments on this topic, make it clear that the mutability is only a problem for the *keys*. Others and the docs talk about (paraphrasing) "putting an object

Re: When do I need to override hash?

2009-08-21 Thread Alastair Houghton
On 21 Aug 2009, at 06:48, Quincey Morris wrote: On Aug 20, 2009, at 22:05, Jeff Laing wrote: "If a mutable object is added to a collection that uses hash values to determine the object’s position in the collection, the value returned by the hash method of the object must not change while th

Re: When to 'release' in Cocoa management?

2009-08-21 Thread DairyKnight
OK. Here's the code of my UIViewController: - (void)viewDidLoad { [super viewDidLoad]; okButton = [[UIBarButtonItem alloc] initWithTitle:@"OK" style: UIBarButtonItemStyleBordered target:self action:@selector(okAction:)]; self.navigationItem.rightBarButtonItem = okButton; [okButton rel

Re: When do I need to override hash?

2009-08-21 Thread Jean-Daniel Dupas
Le 21 août 2009 à 10:55, Alastair Houghton a écrit : On 21 Aug 2009, at 05:44, Quincey Morris wrote: On Aug 20, 2009, at 20:51, Seth Willits wrote: The documentation, nor did many others' comments on this topic, make it clear that the mutability is only a problem for the *keys*. Others a

Re: When to 'release' in Cocoa management?

2009-08-21 Thread DairyKnight
One more thing, it has nothing to do with the DateFormatter. So somehow UIDatePicker released its date somewhereoutside of my code... I guess it has something to do with autoreleasepool. On Fri, Aug 21, 2009 at 5:07 PM, DairyKnight wrote: > > OK. Here's the code of my UIViewController: > > - (vo

core data nsarraycontroller for all entities

2009-08-21 Thread Martin Hewitson
Dear all, I'd like to have an NSArrrayController 'collect' all the values of a particular attribute from all entities in the managed object array. More specifically, I have core-data document based app with a simple model containing two entities: an Entry and a Category. The Entry entity

Re: When do I need to override hash?

2009-08-21 Thread Jean-Daniel Dupas
No, not true. Key values cannot be mutated while used in a collection, period. Correct. Excuse my intrusion in this discussion, but I don't really understand why 'isEqual:' and 'compare:' results must not change when an object is used as key. My though was that as long as the hash rema

Re: When do I need to override hash?

2009-08-21 Thread Alastair Houghton
On 21 Aug 2009, at 10:07, Jean-Daniel Dupas wrote: Excuse my intrusion in this discussion, but I don't really understand why 'isEqual:' and 'compare:' results must not change when an object is used as key. My though was that as long as the hash remain the same, it should not be an issue. I

Re: When do I need to override hash?

2009-08-21 Thread Richard Frith-Macdonald
On 21 Aug 2009, at 10:31, Alastair Houghton wrote: On 21 Aug 2009, at 10:07, Jean-Daniel Dupas wrote: Excuse my intrusion in this discussion, but I don't really understand why 'isEqual:' and 'compare:' results must not change when an object is used as key. My though was that as long as the

Re: When to 'release' in Cocoa management?

2009-08-21 Thread Graham Cox
On 21/08/2009, at 7:08 PM, DairyKnight wrote: One more thing, it has nothing to do with the DateFormatter. So somehow UIDatePicker released its date somewhere outside of my code... I guess it has something to do with autoreleasepool. Well, yes, obviously. If this seems mysterious to you,

Re: When do I need to override hash?

2009-08-21 Thread Alastair Houghton
On 21 Aug 2009, at 10:52, Richard Frith-Macdonald wrote: On 21 Aug 2009, at 10:31, Alastair Houghton wrote: In the current implementation, I think you're probably right that - isEqual: and -compare: could change their results as long as -hash stayed the same. I very much doubt that. Beca

Re: When to 'release' in Cocoa management?

2009-08-21 Thread Graham Cox
On 21/08/2009, at 5:42 PM, bryscomat wrote: Yes. You release the object when one of three things occur: 1. You allocate the object yourself with the "alloc" message. 2. You allocate the object yourself with the shorthand "new" message. 3. You issue a retain message. So in both examples you ga

Re: Force crash a cocoa app for Crash Reporter testing

2009-08-21 Thread jonat...@mugginsoft.com
On 20 Aug 2009, at 19:03, Kyle Sluder wrote: On Thu, Aug 20, 2009 at 10:04 AM, aaron smith wrote: Anyone have any code I can use to do this? abort() which calls raise(SIGABRT); // SIGFPE and SIGSEGV also may be tried abort() is defined to optionally flush streams and delete temporary f

pulldown in custom NSCell

2009-08-21 Thread Georg Seifert
Hi, I want to build a custom cell similar to the one in "Transfer" list in Cyberduck. I need several pulldowns and input fields. I did looked at the code of Cyberduck but as it is written in Java I did not understand it completely. What I found is that the Cell, in its drawwithFrame metho

Re: core data nsarraycontroller for all entities

2009-08-21 Thread Sean Kline
It sounds like this tutorial is doing what you want: http://themikeswan.wordpress.com/2009/05/22/7/ Regards, - S On Fri, Aug 21, 2009 at 5:12 AM, Martin Hewitson wrote: > Dear all, > > I'd like to have an NSArrrayController 'collect' all the values of a > particular attribute from all entities

Re: How to reference to objects laid in external xibs in Interface Builder?

2009-08-21 Thread Sean Kline
That is just a View Controller Object. Under the attributes of the object, you can specify the NIB (or more precisely XIB in your case) name. This object may be dragged from the library to your Window XIB. On Thu, Aug 20, 2009 at 10:45 PM, DairyKnight wrote: > > I think you didn't understand m

Re: Authorization Question (Possibly a simple POSIX question?)

2009-08-21 Thread Jerry Krinock
On 2009 Aug 21, at 00:27, Stephen J. Butler wrote: Also, the MoreIsBetter samples include MoreSecurity which helps you write helper tools For Mac OS 10.4 and above, MoreIsBetter has been superceded by BetterAuthorizationSample. For help with BetterAuthorizationSample, search list archive

Re: When to 'release' in Cocoa management?

2009-08-21 Thread DairyKnight
Thanks for the link. Guess it explains. So every call without alloc/new, e.g. [NSMutableString stringWithString], you dont have to release the objects yourself? On Fri, Aug 21, 2009 at 6:34 PM, Graham Cox wrote: > > On 21/08/2009, at 5:42 PM, bryscomat wrote: > > Yes. You release the object wh

Re: When to 'release' in Cocoa management?

2009-08-21 Thread DairyKnight
Thanks for the reply. So the implementation of : NSDate *date = [dateFormatter dateFromString:@"0 : 0"]; is something like: return [[NSString alloc] init autorelease]; And as the autoreleasepool gets drained in every event loop, the NSDate object was released? On Fri, Aug 21, 2009 at 6:19 P

iPhone: Accessing variable from another view controller

2009-08-21 Thread Eric E. Dolecki
I have an application using a TabBar. The default view loaded and displayed (so this loads up first): FirstViewController: #import @interface FirstViewController : UIViewController { @public BOOL availableNetwork; } @property (readonly) BOOL availableNetwork; - (BOOL) isDataSourceAvailabl

Re: When to 'release' in Cocoa management?

2009-08-21 Thread Jean-Daniel Dupas
Don't try to guess what implementation is, and what variable's life- time will be. Just follow the rules. You don't create the date object (by calling alloc or new or copy, …) you don't have to release it. Le 21 août 2009 à 14:50, DairyKnight a écrit : Thanks for the reply. So the imple

Re: iPhone: Accessing variable from another view controller

2009-08-21 Thread Luke the Hiesterman
On Aug 21, 2009, at 5:54 AM, Eric E. Dolecki wrote: FirstViewController *fvDelegate = (FirstViewController *) [[UIApplication sharedApplication] delegate]; BOOL online = FirstViewController.availableNetwork; This should be fvDelegate.availableNetwork. You access the property on the instan

Bindings & Reverting Properties

2009-08-21 Thread Dave Keck
Hey list, I've implemented a custom bindings-compatible preferences controller object - let's call it MyPrefsController. It's similar to NSUserDefaultsController, but has lots of different functionality, and inherits directly from NSObject. As the user is changing the preferences in the UI, the p

Re: iPhone: Accessing variable from another view controller

2009-08-21 Thread edole...@gmail.com
i caught that after sending. it still does not work -- Sent from the Verizon network using Mobile Email --Original Message-- From: Luke the Hiesterman To: "Eric E. Dolecki" Cc: "cocoa-dev" Date: Fri, Aug 21, 6:22 AM -0700 Subject: Re: iPhone: Accessing variable from another vie

Re: iPhone: Accessing variable from another view controller

2009-08-21 Thread Luke the Hiesterman
You probably need to @synthesize the property in FirstViewController's @implementation. If it compiles but just doesn't work, log the output of this line: NSLog(@"class of app delegate: %@", [fvDelegate class]); because it seems very odd to me that your app delegate is also a view cont

Setting multi line Text to Radio button

2009-08-21 Thread Vijay Kanse
Hello List, I want my radio buttons to have multi line text, and Title should have alignment like attached snapshot. I have tried to Set multi line text to check box with setting Attributed title, but I am not getting text alignment as per my requirement. So can any one tell me how is it possible

Re: When do I need to override hash?

2009-08-21 Thread Kirk Kerekes
AFAIK, NSDictionary specifies that it COPIES keys, and RETAINS objects. Thus even if you were to use an NSMutableString as a key, you could not mutate the key in the NSDictionary. So the only way you are likely to get into trouble with keys is if you do troublesome things like use oddball m

Re: iPhone: Accessing variable from another view controller

2009-08-21 Thread Eric E. Dolecki
I had @synthesize too. In my 1st tab is the FirstViewController - when I run the app it says "optionally move this view into a sep nib file..." When I trace out the class, it is indeed the app delegate and NOT the firstViewController. That's pretty strange. I was expecting to get at the actual Fir

Re: iPhone: Accessing variable from another view controller

2009-08-21 Thread Eric E. Dolecki
Okay - I moved my method into my app delegate and I can access it like that. However, how does one access class properties from one class to another (not using app delegate) - without making an instance of it - or do you need to do that? Looking for a singleton implementation. On Fri, Aug 21, 2009

Re: iPhone: Accessing variable from another view controller

2009-08-21 Thread Luke the Hiesterman
On Aug 21, 2009, at 6:39 AM, Eric E. Dolecki wrote: When I trace out the class, it is indeed the app delegate and NOT the firstViewController. That's pretty strange. I was expecting to get at the actual FirstViewController class. What made you think that [[UIApplication sharedApplication]

Re: iPhone: Accessing variable from another view controller

2009-08-21 Thread Luke the Hiesterman
On Aug 21, 2009, at 6:53 AM, Eric E. Dolecki wrote: However, how does one access class properties from one class to another (not using app delegate) - without making an instance of it - or do you need to do that? Looking for a singleton implementation. Well, properties are, like instance m

persistentDomainNames

2009-08-21 Thread Rick C.
hello, i have come across this method in NSUserDefaults and it appears to be a list of identifiers located on the current system. my question is if an app is deleted does its identifier eventually get removed from the persistentDomainNames list? thanks, rick _

Re: Editable NSTextFieldCell with clickable button?

2009-08-21 Thread Corbin Dunn
On Aug 20, 2009, at 8:55 PM, Seth Willits wrote: Anyone have an editable text field cell with a clickable button? I'm thinking along the lines of a "go to" button next to the (editable) text, like the buttons in iTunes which take you to the album in the iTunes Store. Trying to avoid re

Re: pulldown in custom NSCell

2009-08-21 Thread Corbin Dunn
On Aug 21, 2009, at 3:48 AM, Georg Seifert wrote: Hi, I want to build a custom cell similar to the one in "Transfer" list in Cyberduck. I need several pulldowns and input fields. I did looked at the code of Cyberduck but as it is written in Java I did not understand it completely. What I

Re: persistentDomainNames

2009-08-21 Thread Dave Keck
> i have come across this method in NSUserDefaults and it appears to be a list of identifiers located on the current system. my question is if an app is deleted does its identifier eventually get removed from the persistentDomainNames list? Not unless your app's preferences file is deleted, and t

Toll-free bridging, say for NSDictionary and CFDictionary.

2009-08-21 Thread jonat...@mugginsoft.com
Snippet from this recent thread: Re: When do I need to override hash? <-- Each bucket might be implemented as an array or as a linked list or some other data structure, but whatever it is, if it contains more than one key object, the implementation picks the correct one by searching the bu

Re: Bindings & Reverting Properties

2009-08-21 Thread I. Savant
On Aug 21, 2009, at 9:27 AM, Dave Keck wrote: I've implemented a custom bindings-compatible preferences controller object - let's call it MyPrefsController. It's similar to NSUserDefaultsController, but has lots of different functionality, and inherits directly from NSObject. As the user is

CoreData: Using to-may relationships in fetch request predicates

2009-08-21 Thread Frank Illenberger
Hi there, in the typical CoreData example, if I want to fetch all departments whose employees have a salary higher than a specified value, I will perform a fetch on the Department entity using a predicate with the following format: "ANY employees.salary < %@" This is working fine. Now I

Re: CoreData: Using to-may relationships in fetch request predicates

2009-08-21 Thread I. Savant
On Aug 21, 2009, at 11:13 AM, Frank Illenberger wrote: "ANY (employees.salary < %@ AND employees.dateOfBirth > %@" But it doesn't. Does anybody know if there is a way to use the ANY statement with more than one condition? Are you using the sqlite store type? "ANY" can't be used in a com

Re: CoreData: Using to-may relationships in fetch request predicates

2009-08-21 Thread Frank Illenberger
"ANY (employees.salary < %@ AND employees.dateOfBirth > %@)" But it doesn't. Does anybody know if there is a way to use the ANY statement with more than one condition? Are you using the sqlite store type? "ANY" can't be used in a compound predicate (AND) with the sqlite store type. Yes,

Re: Toll-free bridging, say for NSDictionary and CFDictionary.

2009-08-21 Thread Alastair Houghton
On 21 Aug 2009, at 15:56, jonat...@mugginsoft.com wrote: We can dig into http://www.opensource.apple.com/source/CF/CF-476.19/CFDictionary.c and sure enough we find buckets being probed. But what does this tell us about NSDictionary? Yes, we know it's toll-free bridged to CFDictionary but does

MathML View or Component?

2009-08-21 Thread Gordon Apple
Does anyone know of a Cocoa View or a drawing component (or code) that will render MathML (from LaTex, whatever)? I've been looking at a lot of stuff through Google, but haven't found what I want. What I would really like is a total graphical equation editor/renderer. DesignScience has a com

Re: Authorization Question (Possibly a simple POSIX question?)

2009-08-21 Thread Stephen J. Butler
On Fri, Aug 21, 2009 at 7:29 AM, Jerry Krinock wrote: > > On 2009 Aug 21, at 00:27, Stephen J. Butler wrote: > >> Also, the MoreIsBetter samples include MoreSecurity which helps you >> write helper tools > > For Mac OS 10.4 and above, MoreIsBetter has been superceded by > BetterAuthorizationSample.

Re: CoreData: Using to-may relationships in fetch request predicates

2009-08-21 Thread I. Savant
On Aug 21, 2009, at 11:31 AM, Frank Illenberger wrote: Yes, I am using an sqlite store, but I tried it with the other store types and it did not work either. What would a working predicate look like for other store types? I didn't catch this at first, but you said you're fetching empl

Re: Toll-free bridging, say for NSDictionary and CFDictionary.

2009-08-21 Thread jonat...@mugginsoft.com
On 21 Aug 2009, at 16:32, Alastair Houghton wrote: On 21 Aug 2009, at 15:56, jonat...@mugginsoft.com wrote: We can dig into http://www.opensource.apple.com/source/CF/CF-476.19/CFDictionary.c and sure enough we find buckets being probed. But what does this tell us about NSDictionary? Yes, w

Re: Statements in Replaced Method execute out of sequence - How?

2009-08-21 Thread Scott Ribe
> No, that's not how Method Replacement works. Ah, sorry for the noise. I'm unable to move to Obj-C 2.0 yet, so haven't started learning it yet, so spoke when I shouldn't have ;-) -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice

Re: CoreData: Using to-may relationships in fetch request predicates

2009-08-21 Thread Frank Illenberger
Am 21.08.2009 um 17:49 schrieb I. Savant: On Aug 21, 2009, at 11:31 AM, Frank Illenberger wrote: Yes, I am using an sqlite store, but I tried it with the other store types and it did not work either. What would a working predicate look like for other store types? I didn't catch this a

Re: Setting multi line Text to Radio button

2009-08-21 Thread Jerry Krinock
On 2009 Aug 21, at 06:39, Vijay Kanse wrote: I want my radio buttons to have multi line text I've found this to be one of those things that "just doesn't work". Set the title to an empty string, and display the title in an adjoining text field ("Multi-line Label" from the Library) instea

Replace NSScroller instances in NSScrollView?

2009-08-21 Thread Jim Correia
I have a subclass of NSScrollView in which I'm also using a custom NSScroller subclass. If I am unarchiving from a NIB, I can set the object classes for the NSScroller to my subclass. However, there doesn't appear to be an API to specify the class of the scroller used when I alloc+init an

Re: CoreData: Using to-may relationships in fetch request predicates

2009-08-21 Thread Jerry Krinock
Everything I.S. said is true, and as far as I know you're out of luck. You might want to log into Bug Reporter and "second" my bug 6857142: 05-May-2009 07:05 AM Jerry Krinock: Summary: Core Data's fetches cannot handle arbitrary predicates produced by NSPredicateEditor Steps to Reproduce: 1

Re: Bindings & Reverting Properties

2009-08-21 Thread Quincey Morris
On Aug 21, 2009, at 06:27, Dave Keck wrote: - (void)setHappy: (BOOL)newHappy { happy = newHappy; if (![self save]) self.happy = !happy; // Revert to the old value. Pretend the recursive call wouldn't attempt // another save and cause a stack over

Re: Replace NSScroller instances in NSScrollView?

2009-08-21 Thread Jim Correia
On Aug 21, 2009, at 12:22 PM, Jim Correia wrote: I have a subclass of NSScrollView in which I'm also using a custom NSScroller subclass. If I am unarchiving from a NIB, I can set the object classes for the NSScroller to my subclass. However, there doesn't appear to be an API to specify th

Re: When do I need to override hash?

2009-08-21 Thread Jeffrey Oleander
> On Fri, 2009/08/21, Quincey Morris wrote: > From: Quincey Morris > Subject: Re: When do I need to override hash? > To: "cocoa-dev" > Date: Friday, 2009 August 21, 00:48 >> On 2009 Aug 20, at 22:05, Jeff Laing wrote: >> Without wanting to keep the thread going forever, >> can I just ask why we

Re: Authorization Question (Possibly a simple POSIX question?)

2009-08-21 Thread Todd Heberlein
I don't understand how the app allowed to use that file descriptor to read the file's contents. Its a general UNIX thing. If you have a book on UNIX interprocess communications, you can probably find some details in it. And as others have pointed out, permissions are checked at the time of

Formatting/partitioning drives with Cocoa

2009-08-21 Thread PCWiz
There are obviously ways to do this using shell and NSTask, but is there some sort of Cocoa framework that will allow me to format/ partition drives? Thanks ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

Re: Authorization Question (Possibly a simple POSIX question?)

2009-08-21 Thread Jean-Daniel Dupas
Le 21 août 2009 à 18:55, Todd Heberlein a écrit : I don't understand how the app allowed to use that file descriptor to read the file's contents. Its a general UNIX thing. If you have a book on UNIX interprocess communications, you can probably find some details in it. And as others have

Re: Execution of Replaced Method Jumps back to top -- How??

2009-08-21 Thread Jerry Krinock
In case anyone is scratching their head over this, I have a possible answer, although I'm still deep in Undo Doodoo. The jumping back to the top is apparently caused by Cocoa's automatic "group by event" mechanism, as you can see from #2 in this call stack: #0 0x0035603a in -[NSUndoManager

Treat warnings as errors flag missing in iPhone Xcode project

2009-08-21 Thread john chen
Hi all, Usually I like to turn on the flag 'Treat warnings as errors'. It's in OSX Project. But when creating an iPhone project in 3.0 SDK, I can't see that flag under the build setting. Anyone know how to set that? Thanks, John ___ Cocoa-dev mailing

Re: Treat warnings as errors flag missing in iPhone Xcode project

2009-08-21 Thread Kyle Sluder
On Fri, Aug 21, 2009 at 11:24 AM, john chen wrote: > Usually I like to turn on the flag 'Treat warnings as errors'.  It's in OSX > Project. But when creating an iPhone project in 3.0 SDK, I can't see that > flag under the build setting. Anyone know how to set that? Dunno why it isn't there, but yo

Re: Treat warnings as errors flag missing in iPhone Xcode project

2009-08-21 Thread john chen
Hi Kyle, Thank you for the responds. Where is the right place in the project setting to add that -Werror ? Thanks, John On Fri, Aug 21, 2009 at 11:27 AM, Kyle Sluder wrote: > On Fri, Aug 21, 2009 at 11:24 AM, john chen wrote: > > Usually I like to turn on the flag 'Treat warnings as errors'.

Re: Authorization Question (Possibly a simple POSIX question?)

2009-08-21 Thread Seth Willits
The second bit of information is that permissions are tested at the time of the open(). Once you have the file descriptor, you can use it without further checks. That's the bit that confuses me, because it seems to be a security gap. It sounds like I could just spawn an application which

Re: Editable NSTextFieldCell with clickable button?

2009-08-21 Thread Seth Willits
On Aug 21, 2009, at 7:08 AM, Corbin Dunn wrote: Anyone have an editable text field cell with a clickable button? I'm thinking along the lines of a "go to" button next to the (editable) text, like the buttons in iTunes which take you to the album in the iTunes Store. Trying to avoid reinve

Re: Authorization Question (Possibly a simple POSIX question?)

2009-08-21 Thread Stephen J. Butler
On Fri, Aug 21, 2009 at 2:12 PM, Seth Willits wrote: >> The second bit of information is that permissions are tested at the time >> of the open().  Once you have the file descriptor, you can use it without >> further checks. > > That's the bit that confuses me, because it seems to be a security gap

Re: Authorization Question (Possibly a simple POSIX question?)

2009-08-21 Thread Seth Willits
On Aug 21, 2009, at 12:24 PM, Stephen J. Butler wrote: The second bit of information is that permissions are tested at the time of the open(). Once you have the file descriptor, you can use it without further checks. That's the bit that confuses me, because it seems to be a security gap

Re: Formatting/partitioning drives with Cocoa

2009-08-21 Thread Alastair Houghton
On 21 Aug 2009, at 17:55, PCWiz wrote: There are obviously ways to do this using shell and NSTask, but is there some sort of Cocoa framework that will allow me to format/ partition drives? That's a very low-level operation, and not really the kind of thing you're going to find in Cocoa.

Re: Authorization Question (Possibly a simple POSIX question?)

2009-08-21 Thread Stephen J. Butler
On Fri, Aug 21, 2009 at 2:12 PM, Seth Willits wrote: >> The second bit of information is that permissions are tested at the time >> of the open().  Once you have the file descriptor, you can use it without >> further checks. > > That's the bit that confuses me, because it seems to be a security gap

Dynamically open file with application of end user choise......

2009-08-21 Thread Sutapalli Satyanarayana
Hi, I am using Cocoa with Obj C. I am using the following method to open a file associated with a particular application. [[NSWorkspace sharedWorkspace] openFile:] But if the file is associated with certain application, it is opening. If the file is not associated with any application, I w

Re: devil of a time with an NSImageView

2009-08-21 Thread Jeremy Hughes
Quincey Morris (20/8/09, 19:31) said: >On Aug 20, 2009, at 11:02, I. Savant wrote: > >> I missed that thread. Do you happen to know some keywords from the >> subject? > >No, I've looked for it but I can't find it. It was one of a number of >similar questions around that time, possibly about iPhon

Re: How to create an interface without interface builder

2009-08-21 Thread Michael Mucha
I did it without Interface Builder for my first App Store app, over the last few months. While I found IB interesting, and really slick for certain types of apps, it didn't seem particularly advantageous for the Core Animation heavy 2D game I was doing, while I found it annoying that you had to cro

Choose applications dialog?

2009-08-21 Thread Sutapalli Satyanarayana
Hi, I want to launch Choose Application dialog. How? --Satyam Thanks & Regards, Satyanarayana SVV Novell Software Development (I) Pvt. Ltd., Bangalore, India 9886555469 (mobile) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do

Table view with multiple columns

2009-08-21 Thread Massimiliano Gargani
Hi everybody, I'm learning cocoa to write a little app. I'm facing a problem I can't solve by myself. I've red loads of tutorials, post, specification, but I can't make it work. I have a mutable array with inside something like "luke","l...@luke.com","mark","m...@mark.com", .. I c

NSSegmentedCell and strange selected segment behavior

2009-08-21 Thread Brice Martin
Hi there, I have some trouble setuping a NSSegmentedCell within a NSTableView. I actually succeeded adding the NSSegmentedCell itself (it appears at runtime) but setting and getting the selected segment have a strange behavior. 1- Whatever segment index I might set during the call to setSelected:

Re: Dynamically open file with application of end user choise......

2009-08-21 Thread I. Savant
On Aug 21, 2009, at 3:08 AM, Sutapalli Satyanarayana wrote: In the following code we have to tell which application it has to open. [[NSWorkspace sharedWorkspace] openFile:< some file path> withApplication:@"TextEdit"] But I want user to select the application at run time dynamically. .

Re: Dynamically open file with application of end user choise......

2009-08-21 Thread Jean-Daniel Dupas
Le 21 août 2009 à 09:08, Sutapalli Satyanarayana a écrit : Hi, I am using Cocoa with Obj C. I am using the following method to open a file associated with a particular application. [[NSWorkspace sharedWorkspace] openFile:] But if the file is associated with certain application, it is ope

Re: Choose applications dialog?

2009-08-21 Thread Nick Zitzmann
On Aug 21, 2009, at 4:42 AM, Sutapalli Satyanarayana wrote: I want to launch Choose Application dialog. How? There aren't any such dialogs that are built into the frameworks. You'll have to make your own. Nick Zitzmann

Re: Choose applications dialog?

2009-08-21 Thread Jean-Daniel Dupas
Le 21 août 2009 à 12:42, Sutapalli Satyanarayana a écrit : Hi, I want to launch Choose Application dialog. How? You know, you can safely assume that everybody on this list know read. Posting two time the same question will not give you better result. _

Re: Choose applications dialog?

2009-08-21 Thread Nick Zitzmann
On Aug 21, 2009, at 2:28 PM, Nick Zitzmann wrote: I want to launch Choose Application dialog. How? There aren't any such dialogs that are built into the frameworks. You'll have to make your own. That is, of course, assuming that you want something like Script Editor's "open dictionary"

Re: devil of a time with an NSImageView

2009-08-21 Thread Quincey Morris
On Aug 21, 2009, at 02:51, Jeremy Hughes wrote: How about... From Kevin Cathey (10/6/09, 06:37): "We encourage you to use the controller's controller specific methods for knowing when you content is loaded: NSWindowController -- windowDidLoad UIViewController -- viewDidLoad Since the behavio

Re: Table view with multiple columns

2009-08-21 Thread Kyle Sluder
On Fri, Aug 21, 2009 at 3:53 AM, Massimiliano Gargani wrote: > when I run the app I get TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION If your app is quitting because of an exception, you need to post the actual exception and a stack trace. Make sure that Break on Exceptions is checked, or that you have a

Re: Toll-free bridging, say for NSDictionary and CFDictionary.

2009-08-21 Thread Greg Parker
On Aug 21, 2009, at 7:56 AM, jonat...@mugginsoft.com wrote: We can dig into http://www.opensource.apple.com/source/CF/CF-476.19/CFDictionary.c and sure enough we find buckets being probed. But what does this tell us about NSDictionary? Yes, we know it's toll-free bridged to CFDictionary but do

Wait until volume is mounted?

2009-08-21 Thread PCWiz
Hi, I'm using the OS X authorization frameworks to run the shell command "diskutil eraseVolume" to format a drive and then copy some files to it. The problem is that the copy procedure starts before the volume is remounted after the format. Is there any way to make it wait until the volum

Re: Treat warnings as errors flag missing in iPhone Xcode project

2009-08-21 Thread john chen
NM. Figured out. We can manually add a OTHER_CFLAGS = -Werror in the User-Defined section. That works for me. Thanks, John On Fri, Aug 21, 2009 at 12:08 PM, john chen wrote: > Hi Kyle, > > Thank you for the responds. Where is the right place in the project setting > to add that -Werror ? > > T

Best Way to Simulate Keyboard

2009-08-21 Thread Joe Turner
Hey, So, until now, I've been using CGEvents for simulating a keyboard. This posed a problem when I figured out CGKeyCodes must be translated based on localization/keyboard layout. And now it poses an ever bigger problem because of 'kchr' keyboards, which it seems, all API's that can acce

Re: Wait until volume is mounted?

2009-08-21 Thread Greg Parker
On Aug 21, 2009, at 2:30 PM, PCWiz wrote: I'm using the OS X authorization frameworks to run the shell command "diskutil eraseVolume" to format a drive and then copy some files to it. The problem is that the copy procedure starts before the volume is remounted after the format. Is there any

Re: Wait until volume is mounted?

2009-08-21 Thread Alastair Houghton
On 21 Aug 2009, at 22:30, PCWiz wrote: I'm using the OS X authorization frameworks to run the shell command "diskutil eraseVolume" to format a drive and then copy some files to it. The problem is that the copy procedure starts before the volume is remounted after the format. Is there any wa

Undocumented preparedCellAtColumn:-1 row:row

2009-08-21 Thread Seth Willits
In some Apple sample code... // If it is a "full width" cell, we don't have to go through the rows NSCell *fullWidthCell = [self preparedCellAtColumn:-1 row:row]; if (fullWidthCell) { } else { } It's not documented what preparedCellAtColumn:-1 returns though. Anyon

Re: Wait until volume is mounted?

2009-08-21 Thread Alastair Houghton
On 21 Aug 2009, at 23:10, PCWiz wrote: Thanks, but when the notification is received, is there any way to make sure that the drive I want has been mounted, and not just some other drive? Please copy replies to the list. You'll find the information you're asking for here in the documentat

Re: Undocumented preparedCellAtColumn:-1 row:row

2009-08-21 Thread Seth Willits
On Aug 21, 2009, at 3:27 PM, Ernesto Giannotta wrote: It's not documented what preparedCellAtColumn:-1 returns though. Anyone know for sure? yep! it's the cell that you can return in the delegate method: - (NSCell *)outlineView:(NSOutlineView *)ov dataCellForTableColumn:(NSTableColumn *)tabl

Re: Best Way to Simulate Keyboard

2009-08-21 Thread Eric Schlegel
On Aug 21, 2009, at 2:55 PM, Joe Turner wrote: Hey, So, until now, I've been using CGEvents for simulating a keyboard. This posed a problem when I figured out CGKeyCodes must be translated based on localization/keyboard layout. And now it poses an ever bigger problem because of 'kchr' ke

Right Size All Columns Individually

2009-08-21 Thread tim lindner
I know about the contextual menu for NSBrowsers. But is there a way issue this command programatically? -- tim lindner tlind...@macmess.org Bright ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Ple

I have a Corrupt data

2009-08-21 Thread Agha Khan
HI: While I am saving my data on exit, it save 99% correctly, but 1% the data is not properly saved. In such situations I want to exit the application and start new. How can we initiate new instance of that application and removing old? How can force to exit the application. Best regards

Re: I have a Corrupt data

2009-08-21 Thread Hank Heijink (Mailinglists)
I seem to remember you do iPhone development, so I'll answer from there, inasmuch as I can: you're not giving us much to work with here. As to your last question: there is no way to gracefully exit the application. On an iPhone, you can't force an exit that doesn't look like a crash to the

Re: I have a Corrupt data

2009-08-21 Thread Paul M
If you know you have a problem, why do you want to just push it away, and hope it doesnt come back _too_ soon. Why dont you want to actualy fix the problem instead of wasting time building creative ways of hiding it? paulm On 22/08/2009, at 2:28 PM, Agha Khan wrote: HI: While I am saving

  1   2   >