• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSToolbar messing with strings?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSToolbar messing with strings?


  • Subject: Re: NSToolbar messing with strings?
  • From: j o a r <email@hidden>
  • Date: Mon, 29 Jul 2002 19:42:02 +0200

On Monday, Jul 29, 2002, at 19:01 Europe/Stockholm, Jeremy Dronfield wrote:

1. At compile, I get a warning "SKNotepad does not respond to -setupToolbar", but only the FIRST TIME. When I build again (without running), the warning goes away, and the app runs just fine, complete with functioning toolbar. Is this a PB bug, or is there some declaration or definition I should be putting in my controller's header file?

I think that it's very unlikely that this would be caused by a bug in the frameworks or in PB...
You only get warnings the first time you build after having changed a source file - after the source file is compiled it will no longer get compiled (and hence no warnings) until you change it again. The reason for this is to save compile time.
The most likely problem is that you have implemented the method just fine, but not included the method declaration in the header file - OR - you have the method declaration in the header file but you have forgotten to import that header file in the class where you call the method. Look at the warning message, it will tell you where the error occured.

2. The toolbar has an item which inserts the current date/time in the visible note. Sometimes - only sometimes - clicking it causes the app to throw a sig 10 or 11, caused by an "invalid" string. Somehow, strings within the program are getting invalidated more or less at random: the date string to be inserted; the date formatting string; even the WindowNibName. And the invalidation isn't always consistent; sometimes a few of them survive. I've checked all my ivars, and there's nothing wrong with them that I can see. It's a little difficult getting a clear pattern, because the app only throws this error about 1 in 20 times (highly variable) the toolbar button is clicked - the rest of the time, it happily inserts its date string in the text view.

This is probalby caused by one of your objects having been released and the pointer that pointed to that object is now pointing to some random piece of data in memory.
Look carefully at the method that is triggered by the action method from that toolbar item. Look at all the objects and instance variables used. You are probably assigning an _autoreleased_ item to some variable (using a "class method") and not retaining it.

If you cannot solve these problems send me a copy of the project and I'll take a look at it.

j o a r
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re:NSToolbar messing with strings?[SOLVED]
      • From: Jeremy Dronfield <email@hidden>
References: 
 >NSToolbar messing with strings? (From: Jeremy Dronfield <email@hidden>)

  • Prev by Date: Re: NSTextField annoyances
  • Next by Date: NSOpenPanel question
  • Previous by thread: NSToolbar messing with strings?
  • Next by thread: Re:NSToolbar messing with strings?[SOLVED]
  • Index(es):
    • Date
    • Thread