Creating NSMappingModel programmatically

2010-03-26 Thread Ulai Beekam
I'm trying to create an NSMappingModel manually between two models, but it's not working in that no data gets migrated over (I checked with an SQLite database browser) to the new store, the tables are just empty. The source model has one entity Person with two attributes: name and eyeColor. Th

RE: Creating NSMappingModel programmatically

2010-03-26 Thread Ulai Beekam
Ok, that code really looks bad through email, so I'm going to give you a link to the code in much more pleasant format: http://pastie.org/888526 > > > I'm trying to create an NSMappingModel manually between two models, but it's > not working in that no data gets migrated over (I checked with

Any frameworks for Leopard's Spaces?

2010-04-05 Thread Ulai Beekam
How can I make my app know about when a space has changed, and when it has done so to which space it has changed? Also, how can I read which Spaces and how many are currently available? I'm allowed to use Snow Leopard. The only thing I'm aware of is the NSWorkspaceActiveSpaceDidChangeNotificati

RE: Any frameworks for Leopard's Spaces?

2010-04-05 Thread Ulai Beekam
I don't mind using private API for this. After all my goal is to make some simple in-house app and it doesn't matter too much if it breaks after some OS X update. I am aware the private API discussion is forbidden here. Thus, if anyone can point me in the right direction, I would appreciate it

iCal-style NSTextFields

2010-01-06 Thread Ulai Beekam
Hi, Go into iCal (in Snow Leopard) and create a new event and and then click outside that event. Then double-click on that event and hit the "Edit" button. In the window you see, you have some neat looking text fields that show only text when not in focus but show you a white background with a

RE: iCal-style NSTextFields

2010-01-10 Thread Ulai Beekam
No ideas at all? Were my instructions on how to find the iCal text fields that I want unclear? Please let me know if that is the case. > Go into iCal (in Snow Leopard) and create a new event and and then click> > outside that event. Then double-click on that event and hit the "Edit" button. >

Messaging Cocoa apps through Terminal

2010-03-03 Thread Ulai Beekam
How can I send messages to my Cocoa app through the terminal? Say something like MyGreatMp3Player.app --sendAdvancedMessageThatIsNotInTheUI create100EmptyPlaylists I suppose it's hard to do this on the .app since it's just a directory, but you get the point. Just so the user (but mainly the deve

NSTextField controlTextDidEndEditing

2010-03-05 Thread Ulai Beekam
I have a delegate of NSTextField that uses the controlTextDidEndEditing: method to do some stuff when the editing has finished. However, there are (as far as I can imagine) two types of possible scenarios under which the editing finishes: 1) the user hits return. in this case, the focus stays

RE: NSTextField controlTextDidEndEditing

2010-03-05 Thread Ulai Beekam
Sweet, thanks! I didn't even know of NSTextMovement, but doing a search for in Spotlight, I saw that it was indeed buried somewhere in the Event Handling Guide :) So anyway, this is how I'm doing it now, and so far it seems to be working well: - (void)controlTextDidEndEditing:(NSNotification *

cocoa-dev vs. Apple's dev forums?

2010-03-06 Thread Ulai Beekam
Which one would you prefer (assuming you had 99 bucks to spare each year without trouble) and why? _ Hotmail: Powerful Free email with security by Microsoft. https://signup.live.com/signup.

Bypassing action method in NSSegmentedControl

2010-03-07 Thread Ulai Beekam
I have an NSSegmentedControl with 2 segments. The first has a menu set. The second has no menu. I have set a target and action for the whole segmented control. My problem is that I have to hold down the first segment to see the menu for it. By just clicking on it, the action method gets called

Making a beta version expire

2010-03-11 Thread Ulai Beekam
For a beta version of an app, let's say I want to make sure that users cannot use the beta for far too long, far longer than the app goes out of beta. (Note that this case would in reality rarely occur. Most users would end up getting notified of a new update far sooner. This is just a "safety"

Modeling "Smart Playlists"

2009-05-30 Thread Ulai Beekam
How would you model "smart playlists" (like in iTunes) with Core Data? If you have a Song entity, it is fairly obvious how you model a "regular playlist". The RegularPlaylist entity would simply have a to-many relationship to the Song entity, being a simple collection of songs that the user ad

Detecting when fetch: finishes

2009-06-03 Thread Ulai Beekam
I have an NSArrayController that, at the request of the user, can be given a new fetch predicate. To do that I use the setFetchPredicate: method. How can I detect when this predicate has been applied and the appropriate fetching is done? I have not come across any delegate method for it. I sus

RE: Detecting when fetch: finishes

2009-06-03 Thread Ulai Beekam
? > From: cocoa-...@esoteritech.com > To: cocoa-dev@lists.apple.com > Date: Wed, 3 Jun 2009 17:31:32 -0600 > Subject: Re: Detecting when fetch: finishes > > On Jun 3, 2009, at 5:12 PM, Ulai Beekam wrote: > >> I have an NSArrayControl

RE: Detecting when fetch: finishes

2009-06-04 Thread Ulai Beekam
: Re: Detecting when fetch: finishes > > > On Jun 3, 2009, at 4:12 PM, Ulai Beekam wrote: > >> I have an NSArrayController that, at the request of the user, can be >> given a new fetch predicate. To do that I use the setFetchPredicate: >> method. How can I detect when this pr

Core Data Fetching Limitations?

2009-06-21 Thread Ulai Beekam
Draw up the following model on a piece of paper: We have three entities: Department, Employee, and EmployeeCar. Each of them has the 'name' attribute. Department has the to-many 'employees' relationship to Employee. Its inverse is, naturally, the to-one 'department' relationship in Employee. Emp

Core Data Fetching Limitations?

2009-06-21 Thread Ulai Beekam
(Sorry, the previous post was not sent with plaintext) Please draw up the following model on a piece of paper: We have three entities: Department, Employee, and EmployeeCar. Each of them has the 'name' attribute. Department has the to-many 'employees' relationship to Employee. Its inverse is,

RE: Core Data Fetching Limitations?

2009-06-22 Thread Ulai Beekam
; name starts with 'Jo' and whose assigned car has the name of 'Volvo'." > Then, query that the result of that fetch for each employee's > department, plonk them into a set, and you will have a unique set of > departments matching the query. > > On 22 Jun 200

RE: Core Data Fetching Limitations?

2009-06-23 Thread Ulai Beekam
-- > Date: Tue, 23 Jun 2009 12:17:24 -0700 > Subject: Re: Core Data Fetching Limitations? > From: barryw...@gmail.com > To: ulaibee...@hotmail.com > > Ulai, > > Can you point me to the documentation that gives the "only one IN" per > query limitation of SQLite? &g

Creating a managed object without adding it to the context?

2009-01-24 Thread Ulai Beekam
Hi, How do I programmatically create a managed object (with respect to some entity in a particular context of course) but WITHOUT adding it to the context? The reason I want this is to be able to take that new managed object and add it via an NSArrayController (one that is connected to said

RE: Creating a managed object without adding it to the context?

2009-01-24 Thread Ulai Beekam
> You indicated in your first sentence that you know which managed > object context the new object is destined for. I don't see the > problem. Just insert it when you create it. My problem is that when I add directly to the managed object context, the item is not getting selected automatic

RE: Creating a managed object without adding it to the context?

2009-01-26 Thread Ulai Beekam
>> My problem is that when I add directly to the managed object >> context, the item is not getting selected automatically in the array >> controller (by the way, I see the selection visually by means of the >> table view bound to the array controller) even if I have checked the >> "select on inse

Safari-like tabs in my own app?

2009-01-26 Thread Ulai Beekam
Where can I get Safari-like tabs in my own app? Actually, drag and drop is not necessary for me, but I need tabs that "merge" themselves into the toolbar. For instance, judging from this image: http://www.xtorrentp2p.com/1.png does he use some known tab implementation? Let's just say I want

RE: Safari-like tabs in my own app?

2009-01-26 Thread Ulai Beekam
> Check out PSMTabBarControl over on googlecode: > > http://code.google.com/p/maccode/wiki/WhatIsMacCode > > Dave Hmm ok. I checked that out but the palette refused to appear in Interface Builder. I followed their directions and put PSMTabBarControl.palette folder into ~/Library/Palettes/ folde

Stroking "on the inside" with NSBezierPath

2009-01-30 Thread Ulai Beekam
The default stroke seems to be one that assumes the path you make is the center of the stroke. How can I make the stroke be on one of the *side* of the path? Depending on how you look at it it could be to the "right", "left", "outside" or "inside". Any way to modify that? Thanks,U __

RE: Stroking "on the inside" with NSBezierPath

2009-01-30 Thread Ulai Beekam
The clipping path was indeed what I was looking for to solve this. Thank you sirs! :) >> The default stroke seems to be one that assumes the path you make is >> the center of the stroke. How can I make the stroke be on one of the >> *side* of the path? Depending on how you look at it it could

How to get the "white shadow" effect when drawing NSStrings?

2009-02-21 Thread Ulai Beekam
Hi, Just take a look at any toolbar text in Leopard. It has a subtle, white shadow. How can I get this very same effect in my own app when using NSString's drawInRect method? What attributes to use? Do you have any sample code? Thanks, U.

RE: How to get the "white shadow" effect when drawing NSStrings?

2009-02-21 Thread Ulai Beekam
SStrings? > Date: Sat, 21 Feb 2009 06:22:25 -0500 > > Use a cell to draw your text and call -setBackgroundStyle: on it with > the parameter NSBackgroundStyleRaised. That'll apply the exact same > shadow that's used on toolbar item labels. Keep in mind that this > method

How to create a simple pop-up-menu

2009-03-02 Thread Ulai Beekam
Hi, How do I create a Safari-style pop-up menu? I'm talking about the pop-up menu (be sure to correct me if this thing is not even called a pop-up menu) that appears when you click the ">>" button to show off-screen tabs. Just open Safari (use version 3) and keep creating new tabs until the "

Crash when "loading" window second time

2008-11-23 Thread Ulai Beekam
Hi,I'm trying to do the exercise on p. 195 in Hillegass (3rd Edition).I have put this line in the AboutController.h header: IBOutlet NSWindow *aboutWindow;And I have put these lines in AboutController.m file:- (IBAction)showAboutPanel:(id)sender { if (aboutWindow == nil) { NSLog(@"load

RE: Crash when "loading" window second time

2008-11-24 Thread Ulai Beekam
ai -> > Do you have a backtrace for the crash?> > If you think the problem has to do with the aboutWindow outlet being > referenced after the window has been dealloced, you could nil out the > aboutWindow outlet in response to a windowDidCloseClose: delegate > method.> &g

Chapters in Hillegass to skip on first reading?

2008-11-25 Thread Ulai Beekam
Hi, Let's say I have a plan for a simple app. Nothing too fancy, in a way. To name an example, it could be one like ShoveBox or Things. Mine is probably simpler than those. (It will be a good looking UI and icon that will be more trickier part for me.) I've already read more than half of Hilleg

Simple Core Animation Problem

2008-11-28 Thread Ulai Beekam
I want to create this user interface element: A rounded rectangle somewhere on the window (it should be able to be created through code, not inside the NIB). If I double click it, it should increase its height using animation. But here is the catch: When the heigh is increased, a text field is re

RE: Simple Core Animation Problem

2008-11-29 Thread Ulai Beekam
> code and post specific questions.> > Best Regards,> > -Matt> > > > > On Nov 28, 2008, at 7:26 PM, Ulai Beekam wrote:> >>>> I want to create this user interface element:>> A rounded rectangle somewhere on the window (it should be able to be &g

RE: Simple Core Animation Problem

2008-11-29 Thread Ulai Beekam
idden in NSView). > > You said simple. I'm not so sure that's true. I suggest you write some > code and post specific questions. > > Best Regards, > > -Matt > > > > > On Nov 28, 2008, at 7:26 PM, Ulai Beekam wrote: > >> >> I

(no subject)

2008-11-29 Thread Ulai Beekam
Hi I know I can put an image into a layer by doing theLayer.contents = cgTheGreatImage. But that will just put a single image on the layer. My question is, how can I use that image to have a repeating pattern on that layer of that single image? Can you give me short example code snippet?

NSTextField as a CALayer

2008-11-30 Thread Ulai Beekam
How can I incorporate an (editable) NSTextField into a CALayer, so that I can put the text field into another layer by doing [parentLayer addSublayer:textFieldLayer] ? I really need to do this or some similar thing. Core Animation boasts being easily be able to create animated user interfaces

RE: [ANN]CocoaOniguruma Released

2008-12-01 Thread Ulai Beekam
That is nice. Thanks. Can you paste some simple code examples that do some matching against an NSStrings? For example, to determine whether myString matches against "$s.+" And another example that matches myString against "foo(.*)bar" and if it matches puts the stuff in the parantheses in a n

NSTableView live resizing glitch

2009-03-12 Thread Ulai Beekam
Hi, I'm having an NSTableView live resizing glitch that is driving me nuts. Please see this image: http://img15.imageshack.us/img15/2012/picture1tcz.png I really need to have the column width independent of the table view's size, so it is not an option to have the column resize with the ta

RE: NSTableView live resizing glitch

2009-03-13 Thread Ulai Beekam
Thu, 12 Mar 2009 16:06:11 -0700 > To: csu...@sutes.co.uk > CC: cocoa-dev@lists.apple.com > Subject: Re: NSTableView live resizing glitch > > > On Mar 12, 2009, at 3:50 PM, Chris Suter wrote: > >> Hi Ulai, >> >> On Fri, Mar 13, 2009 at 9:33 AM, Ulai Beekam >>

Changing a custom field editor's position

2009-03-15 Thread Ulai Beekam
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 situation: If I subclass NSTextView and override the drawRect method like this, - (void)drawRect:(NSRect)

Easy question about bindings for a custom view

2009-03-19 Thread Ulai Beekam
Hi, Let's say I have an NSArrayController that contains Employee objects (Core Data managed objects if you don't mind). Call this controller simply 'employeesArray'. I want to create a custom view that displays (editable) text fields on the top of each other, as many as it takes, that displa

RE: Easy question about bindings for a custom view

2009-03-19 Thread Ulai Beekam
400 > Subject: Re: Easy question about bindings for a custom view > From: kyle.slu...@gmail.com > To: ulaibee...@hotmail.com > CC: cocoa-dev@lists.apple.com > > 2009/3/19 Ulai Beekam : >> I want to create a custom view that displays (editable) text fields on the >> top o

Advanced Core Data and Inverse Relationships Question

2009-04-19 Thread Ulai Beekam
I have two entities Boss and Employee. Boss has the to-many relationship 'employees'. The inverse is, naturally, the to-one relationship 'boss'. My problem is this. I have a custom key that I implement for Boss. And while I am BETWEEN (i.e. the code between) willChangeValue:forKey: and didChan

Bindings making NSNumberFormatter strange

2009-04-22 Thread Ulai Beekam
Hi, I have an (editable) NSTextField with an NSNumberFormatter attached to it. The text field is bound to some other numerical property (if you want to test this, you can just make a simple AppController and put the "@property(readwrite) int foo;" inside it, and bind the text field to AppContr

RE: Bindings making NSNumberFormatter strange

2009-04-22 Thread Ulai Beekam
Noone has an idea? To elaborate, when not using bindings, the default behavior of text fields with a number formatter is that when a user tries to enter "abc" in it, the text field refuses to lose focus and makes a beeping sounds. However, when the text field's value binding has been set, a s

RE: Bindings making NSNumberFormatter strange

2009-04-22 Thread Ulai Beekam
> CC: cocoa-dev@lists.apple.com > From: cocoa-...@esoteritech.com > To: ulaibee...@hotmail.com > Subject: Re: Bindings making NSNumberFormatter strange > Date: Wed, 22 Apr 2009 16:46:12 -0600 > > On Apr 22, 2009, at 3:57 PM, Ulai Beekam wrote: > >> To elaborate, when not u

RE: ESC while editing NSOutlineView subclass

2009-04-23 Thread Ulai Beekam
Hi, I find to be a strange problem. I would think that the control:textView:doCommand... method should indeed get called. Are you absolutely sure you are spelling it right? Did you put an NSLog(@"foo"); in there to make sure it is getting called? U >

Detecting changes to NSPopUpButtonCell in an NSTableView

2009-04-23 Thread Ulai Beekam
Hi, We all know that we can detect whenregular text in an NSTableView finishes editing using the control notification method controlTextDidEndEditing:. My problem, however, is this: In one of the columns I have attached an NSPopUpButtonCell. The pop up button has two predetermined con

RE: custom field editor results in no focus ring

2009-04-23 Thread Ulai Beekam
It might be because Apple's way of alloc-ing the field editor on the spot may not be such a good idea. If I remember correctly, it didn't work for me. That may be the cause of your problem. So my suggestion is: Try making an instance variable for the NSTextView, and create it once in -init or

RE: custom field editor results in no focus ring

2009-04-23 Thread Ulai Beekam
And yes, make sure you apply some good stuff to your NSTextView before using it, such as [myGreatTextView setFieldEditor:YES]. Try letting that float along in the -init or -awakeFromNib. > From: ulaibee...@hotmail.com > To: alterconsult...@gmail.com; coc

RE: Detecting changes to NSPopUpButtonCell in an NSTableView

2009-04-23 Thread Ulai Beekam
> CC: cocoa-dev@lists.apple.com > > You can bind the selection of the popup to a variable and then observe > that variable via KVO. I did that on a single NSPopUpButton, you would > still need to get the affected row. > > ALEXander. > > > On 24.04.2009, at 00:12, Ulai Bee

RE: Bindings making NSNumberFormatter strange

2009-04-23 Thread Ulai Beekam
> Using control:didFailToFormatString:errorDescription: and always > returning YES will stop the "Formatting Error" sheet. Is this the only way to stop that "formatting error" sheet? I tried it and it sure works. A major drawback, however, is that editing ends even if it was invalid. And tha

RE: valueForKeyPath

2009-04-30 Thread Ulai Beekam
Because just adding a key to a dictionary does not make it key-value-coding compliant with respect to that key. KVC is needed for key paths like that to work. > From: steve_cro...@mac.com > To: cocoa-dev@lists.apple.com > Date: Thu, 30 Apr 2009 19:00:51

NSScrollView, NSTableView and NSSplitView Glitch

2009-05-23 Thread Ulai Beekam
I have a serious (well serious according to my own standards) glitch I came across using NSScrollView (around an NSTableView) when using it with NSSplitView. I don't want to bore you with a long description, so I made this nice movie of the glitch: http://dl.getdropbox.com/u/496106/scrollViewS

RE: NSScrollView, NSTableView and NSSplitView Glitch

2009-05-24 Thread Ulai Beekam
Thanks for the reply, Here is my sample project: http://dl.getdropbox.com/u/496106/scrollViewSplitViewGlitch.zip I have added a simple data source to it that gives the table view 10 rows. Just to emphasize that unchecking "show vertical scroller" is not really an option for me because I indee

RE: NSFormatter Question

2009-05-24 Thread Ulai Beekam
You're right, you can't edit the formatter's error in control:didFailToFormatString:errorDescription: because the error description has already been determined. You need to override the getObjectValue:forString:errorDescription: method of NSFormatter to set a custom error description. As fo

RE: NSScrollView, NSTableView and NSSplitView Glitch

2009-05-24 Thread Ulai Beekam
Well I'll be damned. I finally found out how to fix this thing. Turns out it is trivial when you know about it :) Simply do this in IB: http://dl.getdropbox.com/u/496106/tableViewIBSetting.png for the *table view* (not just the scroll view). Then it starts behaving properly, even when we r