Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-19 Thread Graham Cox
On 19/06/2009, at 3:59 AM, Erik Buck wrote: use [[myBox subviews] makeObjectPerformSelector:@selector(setEnabled:) withObject:NO]; or similar. Are you certain that works? 'NO' isn't an object, so I didn't think you could use -makeObjectsPerformSelector:withObject: in this fashion - o

Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-19 Thread Graham Cox
On 19/06/2009, at 5:23 PM, Graham Cox wrote: However it does seem to compile without complaint, though I'm not sure why... If this is permitted, does it work with rects, points, etc? My bad - it doesn't even compile in fact, so I guess that answers that question. --Graham ___

Re: "Tokenizing" NSTextView content [solved]

2009-06-19 Thread Rob Keniger
On 19/06/2009, at 12:32 PM, Rob Keniger wrote: I need to display a text view which will contain HTML-like syntax and allow the user to drag "objects" into the view. I have been able to use NSTextAttachment to handle the display of the dragged objects just fine, but what I want to do is rest

Filling View With Pattern Image

2009-06-19 Thread Chunk 1978
i have this image ("image.png") that i would like to tile throughout the view... i've read the Quartz 2D programming guide... ok, ok, i breezed thru it, i admit... but i couldn't seem to find an easy way of repeating an image through out a view without actually drawing the image programatically...

Re: Filling View With Pattern Image

2009-06-19 Thread Rob Keniger
On 19/06/2009, at 6:14 PM, Chunk 1978 wrote: i have this image ("image.png") that i would like to tile throughout the view... i've read the Quartz 2D programming guide... ok, ok, i breezed thru it, i admit... but i couldn't seem to find an easy way of repeating an image through out a view with

Re: Filling View With Pattern Image

2009-06-19 Thread Florian Soenens
You will have to do it programmatically but it's pretty easy stuff. This should do the trick nicely: -(void)drawBackgroundPattern { // Suppose backgroundPatternImage is a valid reference to your pattern image NSRect rect = [self frame]; float width = rect.siz

Re: Filling View With Pattern Image

2009-06-19 Thread Chunk 1978
hi rob, thanks for this answer. i forgot to mention that it is for UIView on iPhone OS. i just found a super simple way of managing this using the backgroundColor property of the view: self.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"image.png"]]; On Fri, Jun 19, 20

Re: Filling View With Pattern Image

2009-06-19 Thread Chunk 1978
thanks Florian. i'll be sure to use your helpful code for my mac programming. :) On Fri, Jun 19, 2009 at 4:27 AM, Florian Soenens wrote: > You will have to do it programmatically but it's pretty easy stuff. > This should do the trick nicely: > > -(void)drawBackgroundPattern > { >        // Suppos

Search field in ABPeoplePickerView

2009-06-19 Thread Nikhil Khandelwal
Hi folks, In my application i am using ABPeoplePickerView. Search field in that ABPeoplePickerView is not working. How i could make it working ? Thanks, Nikhil DISCLAIMER == This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd.

Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-19 Thread Erik Buck
It compiles because NO == nil == NULL == 0. I shouldn't have posted the silly example which doesn't work in most cases. how about this typed in mail: @interface NSView (MYGroupEnable) /// Enable all controls nested within the receiver - (void)enableSubviews { for(NSView *currentView in [

Re: advice on background process

2009-06-19 Thread Rick C.
thank you again very much. i do follow you and i was able to put together a basic background process. i still have work to do but seems i'm on the right track. thank you again for the assistance. rick From: Jerry Krinock To: cocoa-dev Sent: Friday, June

[solved] Re: Incompatible managed object model versions

2009-06-19 Thread Lynn Barton
If your application is NSPersistentDocument-based, the document file *is* the persistent store. If you application isn't document-based, your application delegate probably contains a method that specifies the path to the persistent store. (In the Xcode Core Data application template, the boilerpla

Re: NSRuntime.loadLibrary(/usr/lib/java/libObjCJava.dylib) error

2009-06-19 Thread Tejas Vora
Hello All, Can any one add more details regarding the problem which I am facing. I am not really getting a correct picture of whether the task which I am tryingto perform is feasible or not. Please let me know the details. Thanks in advance Thanks and Regards Tejas Vora On Mon, Jun 15, 2009 at

Which Foundation classes should I use for parsing text from a file?

2009-06-19 Thread Michael A. Crawford
My NS class vocabulary is a little shallow when it comes to text processing. I'm sure that there are classes in Foundation that can be used to put together a text processing application in short order, I just don't know what they are. I'm looking through the docs now, but I'm kind of in a

Re: Which Foundation classes should I use for parsing text from a file?

2009-06-19 Thread Filip van der Meeren
You have 2 options: NSScanner or CFStringTokenizerRef I prefer the NSScanner for regular parsing, but if you want to parse for words, then you should opt for the Tokenizer... Filip van der Meeren On 19 Jun 2009, at 16:58, Michael A. Crawford wrote: My NS class vocabulary is a little sh

Just implementing -isEqual:, never invoked, causes crash

2009-06-19 Thread Jerry Krinock
I implemented an -isEqual: method in one of my classes today. This causes the app to crash while loading a document, after some milliseconds. Crashes occur in different unrelated places. I then simplified the implementation to just log and call super -- - (BOOL)isEqual:(Browfile*)otherBrow

Re: NSRuntime.loadLibrary(/usr/lib/java/libObjCJava.dylib) error

2009-06-19 Thread Nick Zitzmann
On Jun 19, 2009, at 8:55 AM, Tejas Vora wrote: Can any one add more details regarding the problem which I am facing. I am not really getting a correct picture of whether the task which I am tryingto perform is feasible or not. Java 6 on Mac OS X is 64-bit only. The Cocoa-Java bridge, which

Re: Which Foundation classes should I use for parsing text from a file?

2009-06-19 Thread Ben
I recommend TDParseKit by Todd Ditchendorf (http://ditchnet.org/tdparsekit/ ). It comes with a demo app and can be used for tokenizing and parsing. The code is also moderately easy to browse, though a whole framework might be a bit heavy depending on what your needs are. - Ben On 19 Jun 20

Re: Just implementing -isEqual:, never invoked, causes crash

2009-06-19 Thread Bill Bumgarner
On Jun 19, 2009, at 10:40 AM, Jerry Krinock wrote: Simply removing this implementation by renaming it to XXisEqual: results in no more crashes. The crash looks like a memory-smasher, but under the circumstances maybe something is being linked incorrectly. I "touched" all of the files and r

Re: Just implementing -isEqual:, never invoked, causes crash

2009-06-19 Thread Jesper Storm Bache
In general, make sure to match the types of methods that you override (the obj-c runtime does not consider types). The signature of isEqual is: - (BOOL)isEqual:(id)object; Note the "id" type for the argument (however, if Browfile is an obj-c class, then things ought to work, so I assum

Re: NSRuntime.loadLibrary(/usr/lib/java/libObjCJava.dylib) error

2009-06-19 Thread Michael Ash
On Fri, Jun 19, 2009 at 10:55 AM, Tejas Vora wrote: > Hello All, > > Can any one add more details regarding the problem which I am facing. > I am not really getting a correct picture of whether the task which I am > tryingto perform is feasible or not. > Please let me know the details. Greg Guerin

Re: Just implementing -isEqual:, never invoked, causes crash

2009-06-19 Thread Michael Ash
On Fri, Jun 19, 2009 at 11:40 AM, Jerry Krinock wrote: > I implemented an -isEqual: method in one of my classes today.  This causes > the app to crash while loading a document, after some milliseconds.  Crashes > occur in different unrelated places. > > I then simplified the implementation to just

Re: Just implementing -isEqual:, never invoked, causes crash

2009-06-19 Thread Jerry Krinock
I don't "turn on zombies" very often, so, just to make sure I did it correctly, I "turned on zombies" by activating this code in my main()... #define KEEP_ZOMBIES #ifdef KEEP_ZOMBIES setenv("NSZombieEnabled", "YES", 1) ; setenv("NSAutoreleaseFreedObjectCheckEnabled", "YES", 1) ;

Basic, but still confuses me (initWithFrame and drawRect)

2009-06-19 Thread Chunk 1978
i want to create a UIView programatically... so i have the 2 main methods of UIView: InitWithFrame, and drawRect. i don't understand the difference between the 2. i think i'm suppose to simply set the frame size in initWithFrame method, and set attributes (like background color, and clipping mas

Re: Just implementing -isEqual:, never invoked, causes crash

2009-06-19 Thread Chris Parker
On 19 Jun 2009, at 9:18 AM, Jerry Krinock wrote: I don't "turn on zombies" very often, so, just to make sure I did it correctly, I "turned on zombies" by activating this code in my main ()... #define KEEP_ZOMBIES #ifdef KEEP_ZOMBIES setenv("NSZombieEnabled", "YES", 1) ; setenv("NSA

Re: Just implementing -isEqual:, never invoked, causes crash

2009-06-19 Thread Kyle Sluder
On Fri, Jun 19, 2009 at 9:18 AM, Jerry Krinock wrote: > That should do the job, right? You're better off setting it in the executable's inspector. Do a Get Info on your executable and you'll see an Environment Variables section. > As you can see, the last thing I do there is get the -managedObje

Inspecting synthesized variables in gdb

2009-06-19 Thread Ingvar Nedrebo
I've recently been experimenting with some code that takes advantage of the new features of Objective-C 2.0 and the 64-bit runtime: Synthesized variables, ie. declaring properties in a class extension without declaring the corresponding variables in the class interface - like so: Foo.h:

Re: Basic, but still confuses me (initWithFrame and drawRect)

2009-06-19 Thread David Duncan
On Jun 19, 2009, at 9:26 AM, Chunk 1978 wrote: i don't understand the difference between the 2. i think i'm suppose to simply set the frame size in initWithFrame method, and set attributes (like background color, and clipping masks, etc.) in the drawRect method. -initWithFrame: is one of the

Rosetta Booster Conclusion - It Works

2009-06-19 Thread M Pulis
This completes the discussion of Rosetta Booster on this list. Its relevance comes from a cocoa dev poster concerned about startup delay of PPC code on Intel. A responder proposed a solution. I implemented and tested the proposed solution. As a Cocoa developer and a Product Manager, I am in

Re: Just implementing -isEqual:, never invoked, causes crash

2009-06-19 Thread Jerry Krinock
Thanks to all who pointed out that you can't set those zombie environment variables in main(). No wonder why they never worked for me! With zombies properly enabled, I now consistently get this before the crash: *** -[ entitiesByName]: message sent to deallocated instance 0x24c92a0

Re: Just implementing -isEqual:, never invoked, causes crash

2009-06-19 Thread Kyle Sluder
On Fri, Jun 19, 2009 at 11:20 AM, Jerry Krinock wrote: >   *** -[ entitiesByName]: message sent to deallocated instance 0x24c92a0 Use ObjectAlloc to figure out what was allocated there. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.co

my drawer won't close

2009-06-19 Thread James Walker
I set up a drawer in IB, with an NSScrollView containing an NSTextView as my content view. I open it programmatically, and it looks fine. But when I try to close the drawer using the mouse, it just beeps. I tried making my controller the delegate of the NSDrawer and adding the drawerShouldCl

Re: Basic, but still confuses me (initWithFrame and drawRect)

2009-06-19 Thread Chunk 1978
i'm "attempting" to add a stroke to a rect, and i realized that NSBezierPath is not available on iPhone SDK, so i'm forced to subclass the rect... my StrokeView:UIView class.m is this: - (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { frame = CGRectMake(10,

Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-19 Thread Chilton Webb
Hi, Here's why I'm asking. Right now I have an app that has a number of possibly different 'objects' in it. And I currently have a single inspector for all of them. When a new object is selected, the appropriate view for that object is added to the inspector window. This is a basically o

Re: Basic, but still confuses me (initWithFrame and drawRect)

2009-06-19 Thread Shawn Erickson
On Fri, Jun 19, 2009 at 12:20 PM, Chunk 1978 wrote: > totally doesn't work. In what way doesn't it work? -Shawn ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the mo

Re: Basic, but still confuses me (initWithFrame and drawRect)

2009-06-19 Thread David Duncan
On Jun 19, 2009, at 12:20 PM, Chunk 1978 wrote: i'm "attempting" to add a stroke to a rect, and i realized that NSBezierPath is not available on iPhone SDK, so i'm forced to subclass the rect... I would probably start by looking at the QuartzDemo sample code at

Re: Basic, but still confuses me (initWithFrame and drawRect)

2009-06-19 Thread Scott Thompson
On Jun 19, 2009, at 2:20 PM, Chunk 1978 wrote: so i'm forced to subclass the rect... Hmm... There's no such thing as "subclassing a rect". CGRect is a structure, not a class. my StrokeView:UIView class.m is this: - (id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:f

Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-19 Thread Andy Lee
If I understand correctly: * You want to have a single general-purpose model class (what you are calling the "object") for which different object types might have different sets of attributes. Kind of like a dictionary or an NSManagedObject. * You'd like to use xib files to serve as attribute

Re: Which Foundation classes should I use for parsing text from a file?

2009-06-19 Thread Michael A. Crawford
Thanks for the recommendations. Currently, I'm using NSScanner. But I will have a look at TDParseKit. -Michael -- There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make

Re: Basic, but still confuses me (initWithFrame and drawRect)

2009-06-19 Thread Grant Erickson
On 6/19/09 9:26 AM, Chunk 1978 wrote: > i want to create a UIView programatically... so i have the 2 main > methods of UIView: InitWithFrame, and drawRect. > > i don't understand the difference between the 2. i think i'm suppose > to simply set the frame size in initWithFrame method, and set > a

Troubles with NSTask, xcodebuild, and NSLog

2009-06-19 Thread Dave DeLong
Hi everyone, I'm writing a little Foundation tool to automate running unit tests. In the tool, I create an NSTask object, have it run xcodebuild on my Tests target, and then I wait until it's done. That works fine. The problem is that any NSLog() statement after running xcodebuild does

Re: Show the dock icon's context menu:

2009-06-19 Thread Ian was here
I think the best way to show an application dock icon's context menu from within the application itself is to write an AppleScript that can find the desired application's dock icon, then ask it to show its context menu. ___ Cocoa-dev mailing

Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-19 Thread Graham Cox
On 20/06/2009, at 5:35 AM, Chilton Webb wrote: Hi, Here's why I'm asking. Right now I have an app that has a number of possibly different 'objects' in it. And I currently have a single inspector for all of them. When a new object is selected, the appropriate view for that object is adde

Re: repeatable random numbers in an object

2009-06-19 Thread Brian Dittmer
Why not generate random numbers the first time each level is run and then just store those numbers (fs if you want them across app loads, in-memory otherwise) somewhere for all subsequent runs? Regards, Brian Dittmer On Wed, Jun 17, 2009 at 10:33 AM, Roland King wrote: > I need to generate repeat

Core Data Persistent Store Corrupted

2009-06-19 Thread Vladislav Struhar
Hi, I'm using Core Data model with NSBinaryStoreType persistent store. After a long time of using this with no issues, I have encountered an error: "The file could not be opened because it is not in the right format." File is about 1MB size. Do you know what might be the cause of this? Is

Jerky/juttery (core-)animation in a screensaver

2009-06-19 Thread Phillip B Oldham
I've built a screensaver for Leopard which utilises core-animation. It doesn't do anything overly complicated; uses a tree of CALayers and CATextLayers to produce a "table" of data in the following structure/levels: - root › maincontainer › subcontainer › row [multiple] › cell

LSUIElement=1 application activation causes menu items of other applications to be wrongly enabled

2009-06-19 Thread Johnny Lai
I have encountered a strange issue regarding the enable/disable status of menu items when my menu extra only application (LSUIElement = 1) activates itself. It activates itself so that it can bring its window to the front. The issue occurs if you follow the following steps: 1. Open a normal appl

Re: Jerky/juttery (core-)animation in a screensaver

2009-06-19 Thread Andrew Farmer
On 17 Jun 2009, at 11:51, Phillip B Oldham wrote: Also, I'm quite sure its not a problem with the hardware. I've tested the built-in screensavers which use core-animation, and downloaded a few free CA-based for comparison, and they run without issue on both machines. None of the standard screen