Re: defining NSColor constants
Thanks everyone, I'll try your tips. I almost don't dare to compare, but it's a lot more difficult than in REALBasic to declare a global color. But on the other side... who cares? Op 6-aug-2009, om 17:27 heeft Sean McBride het volgende geschreven: On 8/6/09 8:38 PM, Graham Cox said: Then add a class method to NSColor in a category: + (NSColor*)calibratedRGBColorWithValues:(const float*) values; Nitpick: use CGFloat instead of float to match NSColor. Especially since you're passing an array of float/doubles. -- Sean McBride, B. Eng s...@rogue-research.com Rogue Researchwww.rogue-research.com Mac Software Developer Montréal, Québec, Canada ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev% 40yaranga.nl This email sent to cocoa-...@yaranga.nl ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Two right buttons on UINavigationBar?
you might: * change the buttons programmatically every time. * drag 2 UIBarButtonItems in your InterfaceBuilder file, set the connections and the captions in IB. Then in XCode, you can change the buttons by using NSArray * topLevelObjs = nil; topLevelObjs = [[NSbundle mainBndle] loadNibName@"yourNibFile" owner:"nameOfNIBFilesOwner" options: nil]; UIBarButtonItem * barButton1 = (UIBarButtonItem *)[topLevelObjs objectAtIndex: indexNumber]; you could build in some error checking, like checking the class and the tag of the UIBarButtonItem. Feel free to comment on this! Op 6-aug-2009, om 7:47 heeft Agha Khan het volgende geschreven: Hi: I have a UINavigationBar where I would like to place 2 buttons. I was looking UINavigationBar.h for its implementation and didn't see the way we could add more than 2 buttons(Right hand side and left hand siderightBarButtonItem ) but my both buttons are rightBarButtonsItems where one of them is always hidden. I need 2 buttons because they point to 2 different click functions and different captions. You might have better idea? Best regards Agha___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev% 40yaranga.nl This email sent to cocoa-...@yaranga.nl ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
defining NSColor constants
In my app, I use several colors many times. I'd like to define them in a separate file or class. Is there another way to do this than: #define kNiceBlueColor [NSColor colorWithRed: 20 green: 20 blue: 240 alpha:1]; I would like a more obj-c style, like globals.h: extern NSColor * const kNiceBlueColor globals.m: #import globals.h NSColor * const kNiceBlueColor = [NSColor colorWithRed: 20 green: 20 blue: 240 alpha:1]; I found some examples of this kind for defining a NSString using the @"foo"-syntax. With NSColor, it doesn't seem to work. I get the error "initializer element is not constant". Anyone any thoughts on this? Thanks in advance! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: searching a string in big file
you can use some methods of NSString, but I doubt wether NSString performs well with really big string. I once tried to work with the Unix tool 'grep' for searching something in the iTunes Library xml file. That was amazingly fast! You can use it in cocoa with NSPipe etc. Op 13-jun-2009, om 7:55 heeft Angelo Chen het volgende geschreven: Hi, I need to open a big file and search for a certain string, if found, I need tup do some updates and write back the file, any idea what approach I should take? Thanks, Angelo Yahoo!香港提供網上安全攻略,教你如何防範黑客! 請前往 http:// hk.promo.yahoo.com/security/ 了解更多! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev% 40yaranga.nl This email sent to cocoa-...@yaranga.nl ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: dumb question
do you also use it across several classes? Op 12-jun-2009, om 12:36 heeft Chunk 1978 het volgende geschreven: maybe this coffee hasn't kicked in yet and undoubtedly there is a simple solution, but i'm trying unsuccessfully to refactor some code, and i'd like to set the following as a static or define instead of having it written several times in several methods -=-=-=- CGRect fullScreenRect = [[UIScreen mainScreen] bounds]; -=-=-=- how can i do that? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev% 40yaranga.nl This email sent to cocoa-...@yaranga.nl ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: API for fetching the computer name in cocoa
Won't CSCopyMachineName do the job? Op 12-jun-2009, om 8:24 heeft Gerriet M. Denkmann het volgende geschreven: On 11 Jun 2009, at 18:55, Graham Cox wrote: On 12/06/2009, at 2:08 AM, Arun wrote: Hi All, Is there any API in cocoa which can be used to fetch computer name which is getting displayed in Finder? I'm not sure if there's a better way, but you can use the Gestalt function with the gestaltUserVisibleMachineName selector. I tried: SInt32 response = 0xdeadbeef; OSErr resul1 = Gestalt( gestaltUserVisibleMachineName, &response ); if ( resul1 != noErr ) // error handling NSLog(@"%s response = %ld = %#lx", __FUNCTION__, response, response); and got no error and: response = 1224224 = 0x12ae20 Where is my mistake? Kind regards, Gerriet. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev% 40yaranga.nl This email sent to cocoa-...@yaranga.nl ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Growing UITextView in UITableView
I'm trying create a UITableView like the one Apple uses for composing an email in its mail app. As far as I know, it is a UITableView with UITextView for the mailmessage. There has been written a lot about this topic yet, but I haven't found the solution for my problem. I managed to only let the tableView scroll instead of the UITextView as well. But how can I let the textView (and the tableviewcell it's placed in) grow with the text? In other words: How can I change the height of the textview and the cell at the moment a new line appears? I tried a lot, but nothing helped so far. Thanks in advance! Arie Pieter ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com