Re: Changing a custom field editor's position

2009-04-29 Thread Ashley Clark
The PhotoSearch[1] sample code from Apple uses a custom cell and overrides -selectWithFrame:inView:editor:delegate:start:length: and - editWithFrame:inView:editor:delegate:event: to resize the field editor within a larger cell. Ashley [1] http://developer.apple.com/SampleCode/PhotoSearch/

Re: Registering Clients using DO

2009-04-29 Thread Ken Thomases
On Apr 30, 2009, at 12:47 AM, Kiran Kumar S wrote: I am developing a client/server application using DO. In server an object is vended to be accessible by clients.In the client side i am accessing vended object and get required info from server.Every thing works fine. Until now my client qu

Re: NSURLConnection unhappiness

2009-04-29 Thread Richard Frith-Macdonald
On 30 Apr 2009, at 05:31, Nick Hristov wrote: Hello, I am currently working on a small iphone app, and I am facing some difficulty with getting NSURLConnection to ... connect. Basically my unit tests don't pass: connection is never made. Here is a snippet of the non-working code: - (id)

Re: Building a 64-bit Preferences Pane

2009-04-29 Thread 慧 松本
Thanks!! My problem was resolved at Satoshi On 2009/04/30, at 12:59, Clark Cox wrote: 2009/4/29 慧 松本 : On 2009/04/30, at 12:05, Andrew Farmer wrote: On 29 Apr 09, at 19:48, 慧 松本 wrote: Does anybody know how to make 64-bit preference panes?

Re: NSURLConnection unhappiness

2009-04-29 Thread Kyle Sluder
On Thu, Apr 30, 2009 at 1:44 AM, Jeff Johnson wrote: > On an unrelated note, your use of "self->connection", etc., is non-standard > and not advised. You should be using direct ivar access "connection", > properties "self.connection", or accessor methods "[self connection]". Sure, `self->connecti

Registering Clients using DO

2009-04-29 Thread Kiran Kumar S
I am developing a client/server application using DO. In server an object is vended to be accessible by clients.In the client side i am accessing vended object and get required info from server.Every thing works fine. Until now my client queries server and server replies to that. But on ser

Re: NSURLConnection unhappiness

2009-04-29 Thread Jeff Johnson
Hi Nick. You can't sleep the thread. According to the documentation for - [NSThread sleepForTimeInterval:], "No run loop processing occurs while the thread is blocked.". You need to run the run loop for the connection to process. On an unrelated note, your use of "self->connection", etc.,

NSURLConnection unhappiness

2009-04-29 Thread Nick Hristov
Hello, I am currently working on a small iphone app, and I am facing some difficulty with getting NSURLConnection to ... connect. Basically my unit tests don't pass: connection is never made. Here is a snippet of the non-working code: - (id) initWithURL: (NSURL*) someurl { self = [super in

Animating .gif in NSImageView

2009-04-29 Thread led248
In Interface Builder, I dragged an "Image Well" (NSImageView) onto my window and checked the "Animates" and "Editable" attribute flags. When running my app, I can drag a .gif into the Image Well and it works great -- the animated gif animates. If I cut and paste back into the same Image Wel

Re: Repositioning the Field Editor

2009-04-29 Thread K. Darcy Otto
So, I have continued my work with a subclass of NSTextView for my field editor, and here is another part of the puzzle: (i) if I implement -drawRect: in the subclass, and ask it for the frame, the frame is the same as the frame set in -viewWillDraw, but not acted upon; (ii) if I implement -

Re: Why is NSString->FSRef so hard?

2009-04-29 Thread Michael Ash
On Thu, Apr 30, 2009 at 12:02 AM, Charles Srstka wrote: > With that said, I don't really see what is harmful about recommending the > use of NSString's path concatenation methods, which could save quite a few > headaches in the case that this *does* somehow change for some bizarre > reason, howeve

Re: Why is NSString->FSRef so hard?

2009-04-29 Thread Jim Correia
On Thu, Apr 30, 2009 at 12:02 AM, Charles Srstka wrote: > With that said, I don't really see what is harmful about recommending the > use of NSString's path concatenation methods, which could save quite a few > headaches in the case that this *does* somehow change for some bizarre > reason, howeve

Re: Changing a custom field editor's position

2009-04-29 Thread K. Darcy Otto
Hi Ulai, Did you find a solution to this problem? I'm trying to do the same thing. Darcy Hi, Let's say I want to have the field editor for a table view appear 2 pixel below where it usually is, i.e. shifted 2 pixels down. How can I do this? Consider the following hypothetical situatio

Re: Drawing Across NSTableView Columns [solved]

2009-04-29 Thread K. Darcy Otto
Thank you for the suggestions. It turns out that I went the second way, and it works just fine (to tell you the truth, I was a bit apprehensive at getting into drawing, but it wasn't as difficult as I had suspected - the -frameOfCellAtColumn:row: really made everything not too bad at all).

Re: Why is NSString->FSRef so hard?

2009-04-29 Thread Charles Srstka
On Apr 29, 2009, at 9:22 PM, Andrew Farmer wrote: On 29 Apr 09, at 06:15, Mark Douma wrote: If you are working with file paths, you shouldn't be using componentsSeparatedByString:, nor should you be defining "/" to be the component you should be separating by. What if someone had your app

Re: Building a 64-bit Preferences Pane

2009-04-29 Thread Clark Cox
2009/4/29 慧 松本 : > > On 2009/04/30, at 12:05, Andrew Farmer wrote: >> >> On 29 Apr 09, at 19:48, 慧 松本 wrote: >>> >>> Does anybody know how to make 64-bit preference panes? >> >> You can't, yet. The System Preferences application - which loads >> preference panes as plugins - is still 32-bit only, s

Re: Building a 64-bit Preferences Pane

2009-04-29 Thread 慧 松本
On 2009/04/30, at 12:05, Andrew Farmer wrote: On 29 Apr 09, at 19:48, 慧 松本 wrote: Does anybody know how to make 64-bit preference panes? You can't, yet. The System Preferences application - which loads preference panes as plugins - is still 32-bit only, so it can't load 64-bit prefpane pl

Re: Why is NSString->FSRef so hard?

2009-04-29 Thread Michael Ash
On Wed, Apr 29, 2009 at 10:22 PM, Andrew Farmer wrote: > On 29 Apr 09, at 06:15, Mark Douma wrote: >> >> If you are working with file paths, you shouldn't be using >> componentsSeparatedByString:, nor should you be defining "/" to be the >> component you should be separating by. What if someone ha

Re: Scheduling a selector when a thread completes

2009-04-29 Thread Michael Ash
On Wed, Apr 29, 2009 at 9:55 PM, wrote: > Hi > > > I wrote a directory scanner application that spawns 4 different threads with > independent rescan intervals and need to repeat the process if and only if a > thread has completed a scan. Basically, for each file type I'm watching, the > proces

Re: Building a 64-bit Preferences Pane

2009-04-29 Thread Andrew Farmer
On 29 Apr 09, at 19:48, 慧 松本 wrote: Does anybody know how to make 64-bit preference panes? You can't, yet. The System Preferences application - which loads preference panes as plugins - is still 32-bit only, so it can't load 64-bit prefpane plugins. Rumor has it this may change in 10.6._

Re: Building a 64-bit Preferences Pane

2009-04-29 Thread Kiel Gillard
Hi Satoshi, If you run this in Terminal: Bugdom:~ kiel$ file /Applications/System\ Preferences.app/Contents/ MacOS/System\ Preferences /Applications/System Preferences.app/Contents/MacOS/System Preferences: Mach-O universal binary with 2 architectures /Applications/System Preferences.app/Conte

Building a 64-bit Preferences Pane

2009-04-29 Thread 慧 松本
I have been trying to make a simple 64-bit preference pane. But all trials ended in failure. For example: 1) Make a new preference pane project "SamplePrefPane" with Xcode. 2) Set the build option "ARCHS" to "x86_64" 3) Build it and double click SamplePrefPane.prefPane Then System Preferences

Re: Scheduling a selector when a thread completes

2009-04-29 Thread Greg Guerin
2. Wait until the thread completes NSThreadWillExitNotification? -- 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)list

Re: Why is NSString->FSRef so hard?

2009-04-29 Thread Andrew Farmer
On 29 Apr 09, at 06:15, Mark Douma wrote: If you are working with file paths, you shouldn't be using componentsSeparatedByString:, nor should you be defining "/" to be the component you should be separating by. What if someone had your app inside of a folder they named "Apps/Utilities"? The

Re: Scheduling a selector when a thread completes

2009-04-29 Thread Stephen J. Butler
On Wed, Apr 29, 2009 at 8:55 PM, wrote: > I tried calling NSObject's > > > performSelector:(SEL) aSelector withObject:(id) anArgument afterDelay:( > NSTimeInterval ) delay > > > > But the receiver's " aSelector" method is never getting called. The only > logical place to perform this sched

Re: Scheduling a selector when a thread completes

2009-04-29 Thread Marc Van Olmen
* You could use NSOperationQueue and set the maximumThread count to 1. and make for each of these methods an NSOperation. And then add those 4 operations to your OperationQueue. * But your case is simple so you can easily code this your self by creating an object for each operation you are

Scheduling a selector when a thread completes

2009-04-29 Thread kentozier
Hi I wrote a directory scanner application that spawns 4 different threads with independent rescan intervals and need to repeat the process if and only if a thread has completed a scan. Basically, for each file type I'm watching, the process is 1. Spawn a thread to sample files of the spec

Changing CoreData store type

2009-04-29 Thread Jim Thomason
Howdy all, Hopefully this is a ridiculously simple question with a ridiculously simple answer, but I just haven't been able to find it. I have a document based CoreData app and I want to change the store type of the file. So it previously saved as XML, and I now want those docs to save as SQLite.

Re: virtual keycode to character

2009-04-29 Thread Ken Thomases
On Apr 29, 2009, at 6:40 PM, kvic...@pobox.com wrote: thank you. this solved my problem. You're welcome. I'm glad I could help. and for the archives (to help anyone in the future), here is my code: UInt32 deadKeyState = 0; UniCharCount actualCount = 0; UniChar baseChar; TISInputSourceRef

Re: virtual keycode to character

2009-04-29 Thread kvic...@pobox.com
ken, thank you. this solved my problem. and for the archives (to help anyone in the future), here is my code: UInt32 deadKeyState = 0; UniCharCount actualCount = 0; UniChar baseChar; TISInputSourceRef sourceRef = TISCopyCurrentKeyboardLayoutInputSource(); CFDataRef keyLayoutPtr = (CFDataRef)TISG

Re: File Reading Problems

2009-04-29 Thread Pierce Freeman
Hey Ken: Your advice is really appreciated, and I will definitely look over the Memory Management Guidelines when I have a bit more time in my day. ;) On 4/29/09 1:12 PM, "Ken Thomases" wrote: > On Apr 28, 2009, at 9:19 PM, Pierce Freeman wrote: > >> - (void)awakeFromNib >> { >>NSFileHand

Re: Core Data Fetches + Transient Properties + NSPredicateEditor = Sadness

2009-04-29 Thread Jerry Krinock
Thanks to Kyle and Melissa for the further explanation. So, I thought about it some more and agree with you that putting a few redundant bits on the disk is not sinful, and actually I am a fan of keyPathsForValuesAffectingValueFor. Look at the little script I have in my Xcode scripts menu!

Re: NSButtonCell visibility binding in NSOutlineView

2009-04-29 Thread Chris Tracewell
On Apr 29, 2009, at 10:59 AM, Ashley Clark wrote: On Apr 29, 2009, at 11:46 AM, Chris Tracewell wrote: On Apr 29, 2009, at 8:13 AM, Ashley Clark wrote: On Apr 28, 2009, at 12:12 PM, Chris Tracewell wrote: I am looking for the best method of turning off the visibility of an NSButtonCell o

Re: File Reading Problems

2009-04-29 Thread Ken Thomases
On Apr 28, 2009, at 9:19 PM, Pierce Freeman wrote: - (void)awakeFromNib { NSFileHandle *remoteConnection = [NSFileHandle fileHandleForReadingAtPath:@"/Users/user/Desktop/file.plist"]; The above does not promise to keep the NSFileHandle object around for as long as you need it. It's not a

Re: Disabling NSNumberFormatter rounding?

2009-04-29 Thread Nick Zitzmann
On Apr 27, 2009, at 1:10 PM, Nick Zitzmann wrote: I have an NSNumberFormatter (10.4 behavior) attached to an NSTextField, and I'm setting the text field's object value to an NSDecimalNumber that can be of any length. But when I load in an NSDecimalNumber that is at least 16 digits long (e.

Re: Group Identity Programming

2009-04-29 Thread Keary Suska
On Apr 29, 2009, at 7:36 AM, Jessica Billings wrote: The third thing I tried is getting the gid using: gid_t curGroupID = getgid(); OR int curGroupID = getgid(); CBGroupIdentity *groupIdentity = [CBGroupIdentity groupIdentityWithPosixGID:curGroupID authority:[CBIdentityAuthority defaultIdentity

Re: Binding question

2009-04-29 Thread Ken Thomases
On Apr 28, 2009, at 5:09 AM, Arun wrote: For the first table i have used the an array in my controller and this array has been set as content array in the ArrayController object. Now when i double click in need to bind the table in the sheet to the the subjectDetails array. I am not able to

Re: NSOperation, Sqlite, library routine called out of sequence

2009-04-29 Thread Тимофей Даньшин
Hm... That really works! Thanks a lot. Putting the bodies of those methods in @synchronized(self) blocks helped Thanks a lot again. On Apr 29, 2009, at 11:33 PM, Greg Guerin wrote: Тимофей Даньшин wrote: The DatabaseManager is synchronized. If any class is to communicate with the db, it do

Re: NSOperation, Sqlite, library routine called out of sequence

2009-04-29 Thread Greg Guerin
Тимофей Даньшин wrote: The DatabaseManager is synchronized. If any class is to communicate with the db, it does that through the DatabaseManager. The latter just provides proxy methods. I think, that should result in classes getting the instance of the DatabaseManager only when it is no l

Re: NSOperation, Sqlite, library routine called out of sequence

2009-04-29 Thread Тимофей Даньшин
The DatabaseManager is synchronized. If any class is to communicate with the db, it does that through the DatabaseManager. The latter just provides proxy methods. I think, that should result in classes getting the instance of the DatabaseManager only when it is no longer (or not yet) used b

Re: NSOperation, Sqlite, library routine called out of sequence

2009-04-29 Thread Greg Guerin
Тимофей Даньшин wrote: In short, i get an error calling the same synchronized singleton DatabaseManager from different threads. Are you sure your database accesses are synchronized (i.e. thread- safe)? I see nothing in the posted code that uses @synchronized or any other locking mechanism

Re: CA -animator animation only works the first time

2009-04-29 Thread Benjamin Stiglitz
On Tue, Apr 28, 2009 at 02:49:23PM -0700, Erg Consultant wrote: > I have two standard Cocoa objects in my window that I animate using CA's > AppKit -animator method. When my nib loads, I get the original NSRects of the > two items by sending them the -frame message. I then recalc the rects to mov

Re: Group Identity Programming

2009-04-29 Thread Greg Guerin
Jessica Billings wrote: My ultimate problem is that I have a number of group identities chosen by the identity picker. I need to look at their member lists and see if the logged-in user is in any of those lists. What I can't figure out is how to get access to the member lists of the groups

Re: Group Identity Programming

2009-04-29 Thread Kyle Sluder
On Wed, Apr 29, 2009 at 9:36 AM, Jessica Billings wrote: > What group is this referring to? If I made a local "test_group" and put the > user in that, would it be the gid of "test_group"? What if the user is an > many groups, both local and managed? This is the heart of my problem. Users in UNIX

Re: NSButtonCell visibility binding in NSOutlineView

2009-04-29 Thread Ashley Clark
On Apr 29, 2009, at 11:46 AM, Chris Tracewell wrote: On Apr 29, 2009, at 8:13 AM, Ashley Clark wrote: On Apr 28, 2009, at 12:12 PM, Chris Tracewell wrote: I am looking for the best method of turning off the visibility of an NSButtonCell object for individual rows in an OutlineView/ TableVi

NSOperation, Sqlite, library routine called out of sequence

2009-04-29 Thread Тимофей Даньшин
Hello again. In short, i get an error calling the same synchronized singleton DatabaseManager from different threads. Here is what I am actually doing. As I was writing earlier, i am writing a dictionary application that is supposed to show translations for words from the database. In the

Re: NSButtonCell visibility binding in NSOutlineView [SOLVED]

2009-04-29 Thread Corbin Dunn
On Apr 29, 2009, at 9:31 AM, Chris Tracewell wrote: Kyle, Thanks for the reply. Yes I know and agree on the issue of the usability. I struggled with this but ultimately felt it was essential as other options disassociated the property from the object too much or made it appear that a giv

Re: NSButtonCell visibility binding in NSOutlineView

2009-04-29 Thread Chris Tracewell
On Apr 29, 2009, at 8:13 AM, Ashley Clark wrote: On Apr 28, 2009, at 12:12 PM, Chris Tracewell wrote: I am looking for the best method of turning off the visibility of an NSButtonCell object for individual rows in an OutlineView/ TableView. I have an OutlineView that is bound to a TreeContr

Re: Group Identity Programming

2009-04-29 Thread Jessica Billings
>> The third thing I tried is getting the gid using: >> gid_t curGroupID = getgid(); OR >> int curGroupID = getgid(); >> CBGroupIdentity *groupIdentity = [CBGroupIdentity >> groupIdentityWithPosixGID:curGroupID authority:[CBIdentityAuthority > defaultIdentityAuthority]]; >> > When I try to show the

Re: NSButtonCell visibility binding in NSOutlineView [SOLVED]

2009-04-29 Thread Chris Tracewell
Kyle, Thanks for the reply. Yes I know and agree on the issue of the usability. I struggled with this but ultimately felt it was essential as other options disassociated the property from the object too much or made it appear that a given object could indeed have the property enabled. W

Re: NSTableView: Type selecting in one column but not another

2009-04-29 Thread Eric Gorr
On Apr 29, 2009, at 12:05 PM, Ashley Clark wrote: On Apr 29, 2009, at 10:43 AM, Eric Gorr wrote: I was wondering if it was possible to get finer control over what type selecting searches in a row. I have two columns in my table which both contain text. It only makes sense to match what th

Re: NSTableView: Type selecting in one column but not another

2009-04-29 Thread Ashley Clark
On Apr 29, 2009, at 10:43 AM, Eric Gorr wrote: I was wondering if it was possible to get finer control over what type selecting searches in a row. I have two columns in my table which both contain text. It only makes sense to match what the user is typing to the text found in the first co

Re: NSTableView: Type selecting in one column but not another

2009-04-29 Thread I. Savant
On Wed, Apr 29, 2009 at 11:43 AM, Eric Gorr wrote: > I was wondering if it was possible to get finer control over what type > selecting searches in a row. > > I have two columns in my table which both contain text. It only makes sense > to match what the user is typing to the text found in the fir

NSTableView: Type selecting in one column but not another

2009-04-29 Thread Eric Gorr
I was wondering if it was possible to get finer control over what type selecting searches in a row. I have two columns in my table which both contain text. It only makes sense to match what the user is typing to the text found in the first column. Unfortunately, I cannot seem to find a wa

Re: Crashing resetting or releasing an NSManagedObjectContext

2009-04-29 Thread Alexander Spohr
Daniel, You are trying to fetch an object and keep it - but you want to ignore / throw away the NSManagedObjectContext. This will never work. The NSManagedObjectContext keeps the object. Your Pet can not exist without its NSManagedObjectContext. You should let the caller provide a NSManag

Re: NSButtonCell visibility binding in NSOutlineView

2009-04-29 Thread Ashley Clark
On Apr 28, 2009, at 12:12 PM, Chris Tracewell wrote: I am looking for the best method of turning off the visibility of an NSButtonCell object for individual rows in an OutlineView/TableView. I have an OutlineView that is bound to a TreeController. There are two columns. In the last column I

Re: Crashing resetting or releasing an NSManagedObjectContext

2009-04-29 Thread Keary Suska
On Apr 29, 2009, at 2:59 AM, Daniel Kennett wrote: Different combinations of trying to do this right result in crashes at different points. Leaving out [context reset] and just releasing it obviously gives EXC_BAD_ACCESS again. Autoreleasing the MOC in +petAtURL: causes crashes when the aut

Re: It doesn't work without the NSLog()... Why?

2009-04-29 Thread Graham Cox
On 29/04/2009, at 10:48 PM, Тимофей Даньшин wrote: - (void) intoArray:(NSMutableArray *)mutableRet addItemFromTable: (NSString *)table usingStatement:(sqlite3_stmt *)statement andSearchString:(NSString *) searchString { Also, I don't mean to pick on your code (there's nothing obviously

Localizing Without Xcode UI

2009-04-29 Thread Michael Hanna
I'm adding localized nibs in Xcode 3.1 by Get Info... on the nib, and clicking "Add Localization..." this is working as expected but rather slow. Is there a faster way? Michael ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post a

Re: Why is NSString->FSRef so hard?

2009-04-29 Thread Mark Douma
On Apr 28, 2009, at 1:34 AM, Erg Consultant wrote: if( glBundle ) { // Get main bundle info dict... d = [ glBundle infoDictionary ]; if( d ) { // Get the GL bundle's path from the info dict... z = [ d objectForKey:kNSBundleInitialPathInfoDictKey ];

Re: Getting Display Names

2009-04-29 Thread Cédric Luthi
> Perfect! Thank you. Is this documented anywhere? Not even IORegistryExplorer > appears to display this dictionary. There is no technote documenting the procedure, but both IODisplayCreateInfoDictionary and CGDisplayIOServicePort are in public headers, so it is safe to use. __

How to set keyboard focus to in NSView in Carbon Application?

2009-04-29 Thread xue zhiy
I create a custom NSView in my Carbon Application. For embed it into Carbon window, i create a HICocoaview for it. My question is: How to set keyboard focus to the NSView? I can get the focus after i mouse click the NSView. I try to set focus by SetKeyboardFocus( windowRef, pHICocoaView,

Re: iphone SDK session duration

2009-04-29 Thread Bess Ho
I did reply. Moderator on this list rejected because my reply is too long. I was about to report the results. I get it to work. I open source the Xcode project code on google project if anyone want it. On Wed, Apr 29, 2009 at 12:57 AM, Alexander Spohr wrote: > Luke already told you six hours bef

Re: It doesn't work without the NSLog()... Why?

2009-04-29 Thread Graham Cox
On 29/04/2009, at 10:48 PM, Тимофей Даньшин wrote: Why copy mutableRet when you just release it anyway? Instead, just return it with an autorelease: I do that because i return an immutable array. I always try to return the types i promise to return in the declaration :) Even so, you're

Re: It doesn't work without the NSLog()... Why?

2009-04-29 Thread Michael Ash
2009/4/29 Тимофей Даньшин : > Hello. > It's a very funny thing. And i do hope i am not bonkers. But the following > code works fine until i delete the line with "NSLog()". In the latter > case it just returns an empty array. Are there any sane reasons why that can > happen? Does it break if yo

Re: It doesn't work without the NSLog()... Why?

2009-04-29 Thread Тимофей Даньшин
Why copy mutableRet when you just release it anyway? Instead, just return it with an autorelease: I do that because i return an immutable array. I always try to return the types i promise to return in the declaration :) To Kyle: I looked at the - intoArray:addItemFromTable:usingStatement:and

Re: NSRunLoop vs. NSThread sleep

2009-04-29 Thread Michael Ash
On Wed, Apr 29, 2009 at 6:53 AM, Alastair Houghton wrote: > On 29 Apr 2009, at 11:44, Kyle Sluder wrote: > >> On Wed, Apr 29, 2009 at 6:00 AM, Alastair Houghton >> wrote: >>> >>> But all of this is somewhat academic in a way, because Apple has handily >>> provided NSOperationQueue for you which i

Re: It doesn't work without the NSLog()... Why?

2009-04-29 Thread Graham Cox
On 29/04/2009, at 10:05 PM, Тимофей Даньшин wrote: NSArray *ret = [mutableRet copy]; // NSLog(@"The number of items to be returned is: %i", [ret count]); [mutableRet release]; return ret; I don't see why your NSLog line should cause a problem, but your memory m

Re: It doesn't work without the NSLog()... Why?

2009-04-29 Thread Kyle Sluder
2009/4/29 Тимофей Даньшин : > It's a very funny thing. And i do hope i am not bonkers. But the following > code works fine until i delete the line with "NSLog()". In the latter > case it just returns an empty array. Are there any sane reasons why that can > happen? No, there is no sane reason

It doesn't work without the NSLog()... Why?

2009-04-29 Thread Тимофей Даньшин
Hello. It's a very funny thing. And i do hope i am not bonkers. But the following code works fine until i delete the line with "NSLog()". In the latter case it just returns an empty array. Are there any sane reasons why that can happen? - (NSArray *) selectWordsBeginningWith:(NSString

[OT] Re: C language in obj-c

2009-04-29 Thread Alastair Houghton
On 29 Apr 2009, at 11:36, fawad shafi wrote: thanks for this useful info. is it possible? existing code that (possibly written in C) that we can easily port over to obj-c with minimum effort. You don't need to "port" C code to ObjC. ObjC is just C with some simple extensions. Similarly,

Re: NSRunLoop vs. NSThread sleep

2009-04-29 Thread Alastair Houghton
On 29 Apr 2009, at 11:44, Kyle Sluder wrote: On Wed, Apr 29, 2009 at 6:00 AM, Alastair Houghton wrote: But all of this is somewhat academic in a way, because Apple has handily provided NSOperationQueue for you which is probably what you should be using unless you have some backwards compati

RE: C language in obj-c

2009-04-29 Thread jmunson
That depends upon the nature of the existing code... Quoting fawad shafi : thanks for this useful info. is it possible? existing code that (possibly written in C) that we can easily port over to obj-c with minimum effort. Regards, Fawad Shafi CC: cocoa-dev@lists.apple.com From: alast

Re: C language in obj-c

2009-04-29 Thread Jean-Daniel Dupas
Le 29 avr. 09 à 12:39, Alastair Houghton a écrit : On 29 Apr 2009, at 11:35, Jean-Daniel Dupas wrote: Le 29 avr. 09 à 12:25, Alastair Houghton a écrit : Just for the record, with gcc-llvm, you can no longer assume that .o files are Mach-O object files. When you use Link-Time-Optimization (

Re: NSRunLoop vs. NSThread sleep

2009-04-29 Thread Kyle Sluder
On Wed, Apr 29, 2009 at 6:00 AM, Alastair Houghton wrote: > But all of this is somewhat academic in a way, because Apple has handily > provided NSOperationQueue for you which is probably what you should be using > unless you have some backwards compatibility requirement or some other > requirement

Re: C language in obj-c

2009-04-29 Thread Alastair Houghton
On 29 Apr 2009, at 11:35, Jean-Daniel Dupas wrote: Le 29 avr. 09 à 12:25, Alastair Houghton a écrit : Just for the record, with gcc-llvm, you can no longer assume that .o files are Mach-O object files. When you use Link-Time-Optimization (or -O4) with llvm-gcc (or clang), it produces llvm b

RE: C language in obj-c

2009-04-29 Thread fawad shafi
thanks for this useful info. is it possible? existing code that (possibly written in C) that we can easily port over to obj-c with minimum effort. Regards, Fawad Shafi > CC: cocoa-dev@lists.apple.com > From: alast...@alastairs-place.net > To: fawadpaki_...@hotmail.com > Subject: Re: C langua

Re: C language in obj-c

2009-04-29 Thread Jean-Daniel Dupas
Le 29 avr. 09 à 12:25, Alastair Houghton a écrit : On 29 Apr 2009, at 11:04, fawad shafi wrote: may be this question is odd, but i wana use .obj file created in c language, in objective-c. is it possible?? It depends what you mean. If you're asking if it's possible to use C code in a p

Re: C language in obj-c

2009-04-29 Thread Alastair Houghton
On 29 Apr 2009, at 11:29, fawad shafi wrote: for example i write one program in c language and then compile it, the compiler will create the one .obj file for us. if i wana use that obj file in xcode or obj-c, is it possible?? The system compiler on Mac OS X doesn't make files with the exte

Re: C language in obj-c

2009-04-29 Thread Jean-Daniel Dupas
Le 29 avr. 09 à 12:04, fawad shafi a écrit : Dear All, may be this question is odd, but i wana use .obj file created in c language, in objective-c. is it possible?? thanks in advance. Obj-C is a superset of C and can access any C code just like you can from any other C file. _

Re: C language in obj-c

2009-04-29 Thread Alastair Houghton
On 29 Apr 2009, at 11:25, Alastair Houghton wrote: Kind regards, Alastair. p.s. This type of question is better addressed to xcode-dev. Of course I meant xcode-users :-D Kind regards, Alastair. -- http://alastairs-place.net ___ Cocoa-dev mai

Re: C language in obj-c

2009-04-29 Thread Alastair Houghton
On 29 Apr 2009, at 11:04, fawad shafi wrote: may be this question is odd, but i wana use .obj file created in c language, in objective-c. is it possible?? It depends what you mean. If you're asking if it's possible to use C code in a program that uses ObjC, of course. Usually you'd inclu

Re: C string constant->NSString constant without defining twice?

2009-04-29 Thread Alastair Houghton
On 29 Apr 2009, at 01:33, Gwynne Raskind wrote: [NSFileHandle initWithFileDescriptor:fileno(tmpfile()) closeOnDealloc:NO]. Oops, now I have to keep track of the FILE* for as long as the NSFileHandle* exists. Well you could use dup() to get around that, not that the above is the best thing

Re: C string constant->NSString constant without defining twice?

2009-04-29 Thread Alastair Houghton
On 28 Apr 2009, at 21:58, Erg Consultant wrote: Except in the case where one line of code creates the temp file and then another immediately uses it and deletes is - as in my case. There is zero chance the user could FUS faster than my 2 lines of code create and delete the file. Honestly,

C language in obj-c

2009-04-29 Thread fawad shafi
Dear All, may be this question is odd, but i wana use .obj file created in c language, in objective-c. is it possible?? thanks in advance. Regards, Fawad Shafi _ Rediscover Hotmail®: Now available on your iPhone or BlackBerry htt

Re: NSRunLoop vs. NSThread sleep

2009-04-29 Thread Alastair Houghton
On 29 Apr 2009, at 00:57, Eric Hermanson wrote: When implementing the while-loop in the main function of an NSThread, is it correct to assume it is more efficient on the operating system to run the current run-loop until a specified date rather than just use NSThread sleepUntilDate to obtai

Crashing resetting or releasing an NSManagedObjectContext

2009-04-29 Thread Daniel Kennett
Hi list, I'm hoping you guys can help me. I'm loading up a Core Data store, copying some data out and attempting to clear it all up. I use this code for my Quicklook plugin, and in parts of my app for previewing documents in a more advanced manner than Quicklook provides. This is how I se

Re: iphone SDK session duration

2009-04-29 Thread Alexander Spohr
Luke already told you six hours before your post: Am 29.04.2009 um 02:10 schrieb Bess Ho: *** -[NSObject timeIntervalSinceReferenceDate]: unrecognized selector sent to instance 0x521fe0 2009-04-28 17:07:32.283 sessiontime[22584:20b] CoreAnimation: ignoring exception: *** -[NSObject timeInterv

Re: NSButtonCell visibility binding in NSOutlineView

2009-04-29 Thread Kyle Sluder
On Tue, Apr 28, 2009 at 1:12 PM, Chris Tracewell wrote: > I am looking for the best method of turning off the visibility of an > NSButtonCell object for individual rows in an OutlineView/TableView. I have > an OutlineView that is bound to a TreeController. There are two columns. In > the last colu

Re: C string constant->NSString constant without defining twice?

2009-04-29 Thread Uli Kusterer
On 28.04.2009, at 22:58, Erg Consultant wrote: Except in the case where one line of code creates the temp file and then another immediately uses it and deletes is - as in my case. There is zero chance the user could FUS faster than my 2 lines of code create and delete the file. Wish that