Re: addsubview

2012-04-24 Thread Keary Suska
On Apr 20, 2012, at 9:19 AM, koko wrote: > Here is the code that creates and adds the subview The method > -makeAndWrapViews is in the custom class of the NSTabViewItem view. > > I do get -viewDidMoveToSuperview when addSubview is called. > > When the tab is clicked I do get viewdidMoveToWi

Re: Updating NSMenu while it's open

2012-04-24 Thread vinayak pai
Yes. I am facing the same problem. I am updating the menu in performSelectorOnMainThread. If the menu is kept open without any event then there is menu refreshing issue ie. sometimes some items will be shown twice. When I move the mouse over items then it will update. But, when the menu is open and

Re: NSDateFormatter problem

2012-04-24 Thread Lorenzo Thurman
On Apr 20, 2012, at 9:32 AM, Keary Suska wrote: > On Apr 20, 2012, at 6:08 AM, Lorenzo Thurman wrote: > >> On Apr 19, 2012, at 10:18 PM, Keary Suska wrote: >> >>> >>> Perhaps this excerpt from the API doc is key: "Do not use these constants >>> if you want an exact format." Why, might be acad

Re: addsubview

2012-04-24 Thread koko
On Apr 20, 2012, at 12:13 PM, Keary Suska wrote: > On Apr 20, 2012, at 9:19 AM, koko wrote: > >> Here is the code that creates and adds the subview The method >> -makeAndWrapViews is in the custom class of the NSTabViewItem view. >> >> I do get -viewDidMoveToSuperview when addSubview is ca

Re: NSDateFormatter problem

2012-04-24 Thread Lorenzo Thurman
On Apr 20, 2012, at 9:32 AM, Keary Suska wrote: > On Apr 20, 2012, at 6:08 AM, Lorenzo Thurman wrote: > >> On Apr 19, 2012, at 10:18 PM, Keary Suska wrote: >> >>> >>> Perhaps this excerpt from the API doc is key: "Do not use these constants >>> if you want an exact format." Why, might be acad

Re: addsubview

2012-04-24 Thread Keary Suska
On Apr 20, 2012, at 1:02 PM, koko wrote: >> Does this code work when you substitute NSPDText with a canned cocoa UI >> object? > Yes. I created an NSButton in the same method, added it and it > displays. Then it is most likely the case that the issue is with the NSPDText, that it is not

Re: NSDateFormatter problem

2012-04-24 Thread Lorenzo Thurman
On Apr 20, 2012, at 11:30 AM, Charles Srstka wrote: > On Apr 20, 2012, at 9:32 AM, Keary Suska wrote: > >>> Is there a way to reset the Language and Text Preferences? Is there an >>> associated Preferences I can throw away? >> >> I think it is part of com.apple.systempreferences.plist in >> ~

Re: NSDateFormatter problem

2012-04-24 Thread Keary Suska
On Apr 20, 2012, at 12:16 PM, Lorenzo Thurman wrote: > I agree. This should not happen, but here is my original code: > -(NSString*)formattedDate:(NSDate*)aDate{ > > NSDateFormatter * formatter = [[NSDateFormatter alloc] init]; > [formatter setDateFormat:@"mm-dd- hh

Re: NSDateFormatter problem

2012-04-24 Thread Lorenzo Thurman
On Apr 20, 2012, at 11:30 AM, Charles Srstka wrote: > On Apr 20, 2012, at 9:32 AM, Keary Suska wrote: > >>> Is there a way to reset the Language and Text Preferences? Is there an >>> associated Preferences I can throw away? >> >> I think it is part of com.apple.systempreferences.plist in >> ~

Re: NSDateFormatter problem

2012-04-24 Thread Lorenzo Thurman
"My Break-Dancing days are over, but there's always the Funky Chicken" -- The Full Monty On Apr 20, 2012, at 3:47 PM, Keary Suska wrote: > > On Apr 20, 2012, at 12:16 PM, Lorenzo Thurman wrote: > >> I agree. This should not happen, but here is my original code: >> -(NSString*)formattedDate:

Re: addsubview

2012-04-24 Thread Martin Wierschin
> I have searched high and low and can find no reason for a subview to not > display. Is this a trivial problem not worthy of list comment or is it truly > a difficult problem that cannot be dealt with as easily as more mundane > topics found here? You've waited only about 90 minutes since you

Re: addsubview

2012-04-24 Thread Jerry Krinock
On 2012 Apr 20, at 09:49, koko wrote: > Is this a trivial problem not worthy of list comment or is it truly a > difficult problem … ? When no one replies, it's usually the latter, but it might be something easy. When a programmatically-created subview doesn't show for me, it's usually because

Re: addsubview

2012-04-24 Thread Scott Ribe
On Apr 20, 2012, at 10:49 AM, koko wrote: > I have searched high and low and can find no reason for a subview to not > display. Is this a trivial problem not worthy of list comment or is it truly > a difficult problem that cannot be dealt with as easily as more mundane > topics found here? Ar

Re: Updating NSMenu while it's open

2012-04-24 Thread Ken Thomases
On Apr 20, 2012, at 1:32 PM, vinayak pai wrote: > Yes. I am facing the same problem. I am updating the menu in > performSelectorOnMainThread. If the menu is kept open without any > event then there is menu refreshing issue ie. sometimes some items > will be shown twice. When I move the mouse over

Displaying history - potential ways to do it

2012-04-24 Thread The Rhythmic
Hi, Am a newbie to iOS development. I want to display the DB history i.e. the changes the users make to a specific critical table in the DB, from bottom-up, i.e. the first update appears bottom-most ...something like ... ... Apr 10th - Changed 'status' field from 'boolean' to 'char' Apr 5th - Gran

Re: addsubview

2012-04-24 Thread Aaron Burghardt
On Apr 20, 2012, at 10:49 AM, koko wrote: > Ah, ain't Cocoa a great, modern (85?) environment. Ah yes, snarky potshots are time-proven way to get help from a forum. May I suggest you consider an alternative approach: http://www.catb.org/~esr/faqs/smart-questions.html. > > > On Apr 20, 2012

Adding cells from the bottom (like a stack) in UITableView

2012-04-24 Thread The Rhythmic
Hi, Am a newbie to iOS programming. This is what am trying to do: 1. The user enters some text in the screen and it keeps getting added to a UITableView. 2. As usual, it's getting added *from* the top. 3. But I want to add it from the bottom i.e. each new message that's added is added *above *th

How to get the embossed look of the entire cell in UITableView?

2012-04-24 Thread The Rhythmic
Hi, Am a newbie to iOS programming. In the app am writing, am adding user inputs dynamically/programmatically to UITableView. For each user input, I put it in a UITableViewCell and add it to the UITableView. I want the table cells to look like in the iPhone 'Messages' screen (like a bubble or some

Redrawing overlay views

2012-04-24 Thread Erik Stainsby
I have a window which owns a webview over which I place buttons (in their own subviews) where the user has clicked. However, because they are not part of the webview's hierarchy of objects, when the window is resized the webview content will likely reflow. I therefore need to reposition the but

Re: activating Delete menu item through binding

2012-04-24 Thread Koen van der Drift
On Apr 16, 2012, at 7:34 PM, Quincey Morris wrote: > Yes, that's an awkward case. Although a NSViewController *is* a responder, it > *isn't* automatically added to the responder chain. Therefore it cannot be > found as first responder, and so its action method is not recognized by menu > valid

Re: activating Delete menu item through binding

2012-04-24 Thread Quincey Morris
On Apr 21, 2012, at 19:18 , Koen van der Drift wrote: > So, I solved it as follows. I created a deleteObjects IBAction in my > AppController class invoked by the delete menuItem. To remove the objects, I > am more or less following the code in Hillegass' book, chapter 15 on > NSAlerts. In thi

Re: Guidelines on using NSJSONSerialization

2012-04-24 Thread Uli Kusterer
On 19.04.2012, at 19:39, Fritz Anderson wrote: > This confuses me. MKMapView.annotations is an NSArray. How can an NSArray be > nil-terminated? It has a count and there's no way to index into it that would > return anything but an object. There's no need and no way to terminate it. > > (...) If,

Re: NSDate value set in one method, vanishes when accessed from another

2012-04-24 Thread Uli Kusterer
On 19.04.2012, at 19:43, The Rhythmic wrote: > Am sorry to ask such a trivial question. Am a newbie to Objective-C, & > simply cannot see how to get this working, after having tried several > possible ways & google'd around for it. Please help! > My question is simple. I have a class-level NSDate o

Re: NSDate value set in one method, vanishes when accessed from another

2012-04-24 Thread Uli Kusterer
On 19.04.2012, at 20:02, Alex Zavatone wrote: > Make it a property so that it doesn't go away, but exists for the whole class. > > Check out how to define a property. There are lots of examples around. That's wrong. There are no properties on classes. There are only properties on instances of

Re: activating Delete menu item through binding

2012-04-24 Thread Koen van der Drift
On Apr 21, 2012, at 11:01 PM, Quincey Morris wrote: > It's not clear what went wrong with '[employeeController remove: nil]', but > that's a completely separate problem. For example, if you left the array > controller in Class mode rather than Entity mode, 'remove:' won't update Core > Data pr

Re: Guidelines on using NSJSONSerialization

2012-04-24 Thread Fritz Anderson
On 22 Apr 2012, at 6:51 AM, Uli Kusterer wrote: > It could be a CFArrayRef. CFArrayRef can handle *any* kind of pointer for its > values, if you give it the right callbacks, and it's toll-free-bridged to > NSArray. Of course, if you try to get an object out of it and it actually > contains some

Mail server test

2012-04-24 Thread tridiak
Mail server test ___ 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: https:

Re: Guidelines on using NSJSONSerialization

2012-04-24 Thread Alex Zavatone
What's odd is that I check the annotation array for nil termination earlier on and to alert me. No alerts. But I do a check when rebuilding the array to ignore nil results and that exports fine. I'm still thinking that nil termination is creeping in there but all I have inside are locatio

Problem with capturing view contents

2012-04-24 Thread Gideon King
Hi, I have a view I am trying to capture using the following code: NSBitmapImageRep *rep = [view bitmapImageRepForCachingDisplayInRect:[view bounds]]; [view cacheDisplayInRect:[view bounds] toBitmapImageRep:rep]; My view coordinates in a typical test case are as follows: "01_frame"

NSPopover ~ resize to match content?

2012-04-24 Thread Erik Stainsby
I'm trying to make a popover view resize to fit the content-of-the-moment. This is probably trivial and I have being over thinking myself into complications. I have three classes of information to display in turn in a popover. The user clicks a segment control to advance and may return if she

NSComboBox

2012-04-24 Thread koko
I have been spelunking all afternoon with mixed results. Some say I can put an image and text in an NSComboBoxCell. Can this be done … put an image and text in an NSComboBoxCell? I can find no examples and would appreciate one if possible. -koko __

Re: addsubview

2012-04-24 Thread Peter Ammon
Hi koko, This could be anything from "the view is added to the wrong subview" to "the view has a frame that moves it outside of its' parents bounds" to "the view is visible but does not draw anything." Two powerful tools that will help you with debugging: - Run with NSShowAllViews set to YES -

Re: addsubview

2012-04-24 Thread koko
Hi Peter … thanks for the debugging tips … I changed my approach, using instead of a view instanced in code a view from IB hooked up via outlet. Same view and it works just fine. -koko On Apr 23, 2012, at 7:30 PM, Peter Ammon wrote: > Hi koko, > > This could be anything from "the view is

Re: Updating NSMenu while it's open

2012-04-24 Thread vinayak pai
posting an application-defined event (NSEvent of type NSApplicationDefined) to the event queue doesn't solve the menu refreshing issue. On Sat, Apr 21, 2012 at 3:44 PM, Ken Thomases wrote: > On Apr 20, 2012, at 1:32 PM, vinayak pai wrote: > >> Yes. I am facing the same problem. I am updating the

Losing attachments when saving rtfd

2012-04-24 Thread Matthew Weinstein
Dear programmers, Trying to save an RTFD from an NSAttributedString with attachements. The text saves; the images don't... I've been scouring the web but can't seem to figure out what's wrong. I have a NSAttributedString with attachments. I check that the string really has the attachments by u

Re: Updating NSMenu while it's open

2012-04-24 Thread Dave DeLong
Yes. As I answered before, you have to get things scheduled in the right runloop mode. But once you do, it's quite easy: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { NSStatusItem *item = [[[NSStatusBar systemStatusBar] statusItemWithLength:24] retain]; [i

Re: How to set the foreground and background colors of selected text in a field editor (NSTextView)?

2012-04-24 Thread Michael Crawford
Thanks for the suggestion, Kyle. I subclassed NSTextViewCell and implemented -setUpFieldEditorAttributes. My apologies to anyone who initially followed this thread and has had to wait till now for a solution/outcome. This became a low-priority issue almost as soon as I posted it and I only go

Re: Updating NSMenu while it's open

2012-04-24 Thread Fritz Anderson
On 20 Apr 2012, at 1:32 PM, vinayak pai wrote: > Is there a way to update the menu while it's open > without any mouse movement like System WiFi menu? Others may have some magic for you (the list has only just come unstuck, and hasn't gotten beyond Friday as I write this), but you should be prep

Re: Updating NSMenu while it's open

2012-04-24 Thread Dave DeLong
On Apr 21, 2012, at 3:14 AM, Ken Thomases wrote: > On Apr 20, 2012, at 1:32 PM, vinayak pai wrote: > >> Yes. I am facing the same problem. I am updating the menu in >> performSelectorOnMainThread. If the menu is kept open without any >> event then there is menu refreshing issue ie. sometimes som

Re: addsubview

2012-04-24 Thread Graham Cox
On 21/04/2012, at 2:49 AM, koko wrote: > Ah, ain't Cocoa a great, modern (85?) environment. Don't blame the framework for your own incompetence. > But I never see thev iew! > > - (void)makeAndWrapViews > { >NSRect frame = [self frame]; >frame.size.width = 288; >frame.size.height =

Re: NSComboBox

2012-04-24 Thread Erik Stainsby
The menu portion of a combo box is just that an NSMenu so you ought to be able to everything you can with a regular menu item. Erik On 2012-04-23, at 5:53 PM, koko wrote: > I have been spelunking all afternoon with mixed results. Some say I can put > an image and text in an NSComboBoxCell.

Re: Updating NSMenu while it's open

2012-04-24 Thread Kyle Sluder
On Apr 24, 2012, at 2:50 PM, Fritz Anderson wrote: > On 20 Apr 2012, at 1:32 PM, vinayak pai wrote: > >> Is there a way to update the menu while it's open >> without any mouse movement like System WiFi menu? > > Others may have some magic for you (the list has only just come unstuck, and > has

Re: NSComboBox

2012-04-24 Thread koko
I changed to NSPopUpButton and use: [self addItemWithTitle:@"Title"]; [[self lastItem] setImage:image]; Easy, works great. Are you saying I could have made these calls on an instance of NSComboBox? I do not see addItem, lastItem or setImage in NSComboBox. How would I use 'the m