Hey Weydson -
NSDictionary equates keys by using -[NSObject isEqual:] and -[NSObject
hash], so a number with a different pointer address but the same value
as determined by isEqual: is fine.
If identity vs value does become an important distinction for you,
CFDictionary gives you control
On May 4, 2009, at 11:52 PM, Weydson Lima wrote:
when I use
the removeObjectForKey, how can I make a reference to a specific
key? Let's
say I want to remove key that was initialized with [NSNumber
numberWithInt:1]. If I call removeObjectForKey:[NSNumber
numberWithInt:1],
that method won't
Sorry for jumping in, but I have a question in the following line:
For other objects, you'll have to use a convenience method like:
[myArray addObject:[NSNumber numberWithInt:7]];
When you add a NSNumber object, how can you quickly reference back to it?
Let's say you want to find the
Oops, wrong list :)
On Tue, May 5, 2009 at 1:05 AM, Weydson Lima weys...@gmail.com wrote:
Sorry for jumping in, but I have a question in the following line:
For other objects, you'll have to use a convenience method like:
[myArray addObject:[NSNumber numberWithInt:7]];
When you
I am fully aware of the security issues having already written several helper
tools. Stating that a temp text file written to /tmp is a security hole is
really stretching it a bit.
NSTemporaryDirectory can't be used because there is no way to specify that path
in Packagemaker. I did indeed
On 05/05/2009, at 4:05 PM, Weydson Lima wrote:
When you add a NSNumber object, how can you quickly reference back
to it?
Let's say you want to find the index in the array of the object you
just
created. If you use indexOfObject:[NSNumber numberWithInt:7] that
wouldn't
work, right?
No
On 05/05/2009, at 4:05 PM, Weydson Lima wrote:
If you use indexOfObject:[NSNumber numberWithInt:7] that wouldn't
work, right?
D'oh. Engage brain...
Yes, this would work, because objects are compared using -isEqual:
I read that as -objectAtIndex:, not -indexOfObject:
--Graham
On 05/05/2009, at 3:57 PM, Greg Parker wrote:
Two answers:
1. Retain it. Conceptually, you're balancing the [self release] that
you did to the old-self. The old-self came in with one retain count
that was not your responsibility to release. That means the new-self
needs to go back out
i am developing a client/server app using Distributed objects, i
register my client to server. when server pings the client the
following exception occurs.
Can any one suggest me why this exception occurs,
2009-05-05 12:12:29.023 Project X[5278:10b] *** NSDistantObject
initWithCoder: 0x1
Am 05.05.2009 um 07:44 schrieb Jerry Krinock:
I have a tree of managed objects with parent -- child
relationships, and Delete Rule set to Cascade children when a parent
is deleted.
But sometimes, after deleting a parent, I need to restore a deleted
child under a new parent. So I set
Wow, I'm learning a lot from this list. Thanks all for everything, now my
code is finally working as I had wanted. :)
Weydson
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Hello,
In an entity A, I have a toMany relationship to an entity B named
relB. relB has a inverse toOne relationship relA.
NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease];
[request setEntity:[NSEntityDescription entityForName:@A
inManagedObjectContext:moc]];
On Tue, May 5, 2009 at 2:11 AM, ERG Consultant erg_consult...@yahoo.com wrote:
I am fully aware of the security issues having already written several helper
tools. Stating that a temp text file written to /tmp is a security hole is
really stretching it a bit.
I didn't say it was a security
You may find this series of articles on ASL useful as well:
http://boredzo.org/blog/archives/2008-01-20/why-asl
Regards,
Dave
On 5 May 2009, at 01:05, Torsten Curdt wrote:
Have a look here:
Thank you again for your helpful replies!
On a different note, when you comment out the for (VetVisit code,
does it still crash on a VetVisit, or does it crash on a
Medication object?
It still crashes on a VetVisit object.
I don't think I've solved the problem, but I have stopped it
I also had (have actually) this problem. The issue appears to be that
CoreImage seems to do its own caching. If you watch the retain counts
on the underlying image data that you pass to CoreImage, it leave
retains in place for a long time. Under testing, when I repeatedly
passed an image
Hi,
I'm trying to print a customView which is part of an NSDocument.
As soon as the print panel appears I get the following slew of errors:
-[NSView(NSPrinting)
beginPrologueBBox:creationDate:createdBy:fonts:forWhom:pages:title:]
was deprecated before Mac OS 10.0 and overrides of it are
Hi,I'm a little confused with retain counts and properties. I would
appreciate some help in understanding this. I have a class setup as follows
@interface Cell : NSObject {
NSImage *image;
}
@property (copy) NSImage *image;
@end
Now, in my code, I do the following
NSImage *img =
Hi!
I have a WebView in which I call JavaScript functions using [[webView
windowScriptObject] callWebScriptMethod:.
When I do it for the first time everything works fine and my script runs
like it should. When I call it from another (objc) function my JS function
can not access the DOM elements
Creating socket as below in the server side gives the exception. Can
any one guide why this happens so.
int newSocket = socket(AF_INET, SOCK_STREAM, 0);
struct sockaddr_in serverAddress;
int namelen = sizeof(serverAddress);
memset(serverAddress, 0,
Yes...
Begin forwarded message:
From: Ben Trumbull trumb...@apple.com
Date: March 28, 2009 1:47:07 AM EDT (CA)
To: Nick Zitzmann n...@chronosnet.com
Cc: Cocoa Developers cocoa-dev@lists.apple.com
Subject: re: Un-deleting objects in an NSManagedObjectContext?
-insertObject: is the reciprocal
If the retain count confuses you, you stop to using it as it's almost
never relevant.
That said, have a look at the atomic section in the property references:
http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocProperties.html
Le 5 mai 09 à 06:34, Malayil George
Hi,
I'm using an Image Well as a button... such as:
- (void)mouseDown:(NSEvent *)theEvent
{
theEvent = [[self window]
nextEventMatchingMask: NSLeftMouseUpMask];
switch([theEvent type])
{
case NSLeftMouseUp:
DoVariousImportantThingsHere();
NSTreeController and CFTree is not exactly what I'm searching for. I
would like to have a *pure*, simple and effective but complete tree
data structure which comprises a hierarchy of objects:
root
|- object1
|- object2
|- object4
|- object5
The container shall be sequential,
On May 5, 2009, at 8:10 AM, Andreas Grosam wrote:
NSTreeController and CFTree is not exactly what I'm searching for. I
would like to have a *pure*, simple and effective but complete tree
data structure which comprises a hierarchy of objects:
[...]
Well, first of all, it's easy enough to
Application that's been running a long time, now one user out of dozens gets
this crash first thing after logging in (and, obviously, going to select a
menu item to get started):
Thread 0 Crashed:
0 com.apple.QD 0x91757360 SetOrigin + 136
1 com.apple.HIToolbox
Sorry to bother, got it all fixed with:
[[self window] discardEventsMatchingMask:NSLeftMouseDraggedMask
beforeEvent:theEvent];
On Tue, May 5, 2009 at 6:09 AM, Henrietta Read readhenrie...@gmail.comwrote:
Hi,
I'm using an Image Well as a button... such as:
-
Hi,
I'm working on a project that accepts user input via an NSTextView
instance, but I would like to have a user-defined number of spaces
inserted when the tab key is pressed. Similar to how TextMate allows.
What is the best way to acheive this ? NSLayoutManager or key press events ?
Any help
You may be interested the CHDataStructures framework, hosted by the BYU
CocoaHeads group. It has a number of such structures that should work for
you.
http://cocoaheads.byu.edu/code/CHDataStructures
http://cocoaheads.byu.edu/code/CHDataStructures-BJ Homer
On Tue, May 5, 2009 at 7:10 AM, Andreas
On May 5, 2009, at 6:40 AM, Scott Ribe wrote:
Application that's been running a long time, now one user out of
dozens gets
this crash first thing after logging in (and, obviously, going to
select a
menu item to get started):
Thread 0 Crashed:
0 com.apple.QD
Now I have come to implement Undo. It actually works, but there is a
problem (see below). The code to implement Undo is in my view class:
- (void)removePath:(PathElement *)oldPath
{
NSUndoManager *undo = [[self window] undoManager];
[undo registerUndoWithTarget:self
On Tue, May 5, 2009 at 12:45 AM, Graham Cox graham@bigpond.com wrote:
If I retain the object before returning it in -awakeAfterUsingCoder:, the
problem goes away, but this appears to violate normal memory management
rules, so it's not clear that this is the correct solution. The
Does the app just work for a long while when the same user restarts
it?
No, sorry about being unclear. What I meant was that the app has been
installed working for a while since the last update, that users typically
leave it running for days on end. But this is happening immediately after
On Tue, May 5, 2009 at 2:05 AM, Weydson Lima weys...@gmail.com wrote:
Sorry for jumping in, but I have a question in the following line:
For other objects, you'll have to use a convenience method like:
[myArray addObject:[NSNumber numberWithInt:7]];
When you add a NSNumber object,
On May 5, 2009, at 3:21 PM, Ken Thomases wrote:
On May 5, 2009, at 8:10 AM, Andreas Grosam wrote:
NSTreeController and CFTree is not exactly what I'm searching for.
I would like to have a *pure*, simple and effective but complete
tree data structure which comprises a hierarchy of
Hi Ammar,
I use the connection kit all the time, what are your questions?
-Jason
On May 3, 2009, at 7:02 AM, Ammar Ibrahim wrote:
I'm building a client/server app. The client and server communicate
using
FTP. I added my own custom commands, since this application will be
in a
controlled
On 06/05/2009, at 1:28 AM, Andreas Grosam wrote:
Please don't underestimate the effort to just roll your own.
Nor overestimate it ;-)
Bear in mind that a simple tree can be implemented using multiple
instances of just one small object, the node itself. Usually that's
all you have to
On 5/5/09 9:28 AM, Yvan BARTHÉLEMY said:
Changing predicates raises other exceptions, but I couldn't make this
work. I need to switch from XML to SQLite because my model needs to
scale.
Here is the other variants I tried and their associated exceptions :
[request setPredicate:[NSPredicate
On May 5, 2009, at 9:42 AM, Mic Pringle wrote:
I'm working on a project that accepts user input via an NSTextView
instance, but I would like to have a user-defined number of spaces
inserted when the tab key is pressed. Similar to how TextMate allows.
What is the best way to acheive this ?
Hi list,
I have a iPhone program. The main interface is Tab Bar based and
consist of 3 Tab Bar views.
On two of the tab bar views, I'll have a table view on each of them.
Once the table view cell is clicked, I need to do a pushview to show
details of the item selected.
Basically I am
You should put navigation controllers inside of your tab bar
controller. That is, on the tab you want to contain navigation
features, set that tab's view controller to be a
UINavigationController. Then when you need to push a view, you can
simply call pushViewController:animated: on that
On May 5, 2009, at 5:52 PM, Graham Cox wrote:
On 06/05/2009, at 1:28 AM, Andreas Grosam wrote:
Please don't underestimate the effort to just roll your own.
Nor overestimate it ;-)
Bear in mind that a simple tree can be implemented using multiple
instances of just one small object, the
I found this thread:
http://www.iphonedevsdk.com/forum/iphone-sdk-development/2447-tab-bar-controller-navigation-controller-tableview.html
...to be very helpful when trying to accomplish the same thing.
Brian
On May 5, 2009, at 11:38 AM, James Lin wrote:
Hi list,
I have a iPhone program.
I am looking to save and read name/score pairs and started looking at SQLite
to do this. I'm checking the Books sample application and there seems to be
tons of code in there to basically provide the solution. Is there a better
option than SQLite to do this in Obj-C (iPhone)?
Eric
On May 5, 2009, at 11:18 AM, Eric E. Dolecki wrote:
I am looking to save and read name/score pairs and started looking
at SQLite
to do this. I'm checking the Books sample application and there
seems to be
tons of code in there to basically provide the solution. Is there a
better
option
On Nov 24, 2008, at 11:45 AM, Nirias wrote:
I have a garbage collected application that runs (apparently)
flawlessly
with a debug build. But with a release build it promptly fails with
an
EXC_BAD_ACESS error. My guess is that somehow the GC is not seeing
a clear
reference to some
In a custom NSBezierView, I fill the view with a background color then set a
clip path that will eventually be drawn as a map. I do this so that I can
color-code the map (in a complicated way) without going outside the lines.
If I then draw the map, external boundaries are drawn as half-width
Probably only 10... however I understand that a plist can't store complex
data... how would this work for pairs? Normally I'd only be able to store
just a list of scores, not paired with names, correct?
On Tue, May 5, 2009 at 2:23 PM, Bill Bumgarner b...@mac.com wrote:
On May 5, 2009, at 11:18
On May 5, 2009, at 12:47 PM, McLaughlin, Michael P. wrote:
In a custom NSBezierView, I fill the view with a background color
then set a
clip path that will eventually be drawn as a map. I do this so that
I can
color-code the map (in a complicated way) without going outside the
lines.
If
On May 5, 2009, at 12:50 PM, Eric E. Dolecki wrote:
Probably only 10... however I understand that a plist can't store
complex
data... how would this work for pairs? Normally I'd only be able to
store
just a list of scores, not paired with names, correct?
Wrong. A plist can contain an
Naturally, I came up with a solution two minutes after posting my query to
this list :-(
My solution is
[[NSBezierPath bezierPathWithRect:rect] setClip];
where rect is the viewRect. This works for me. It might not be the best
solution in all cases.
*** Original post ***
In a custom
On Tue, 2009/05/05, WT jrca...@gmail.com wrote:
From: WT jrca...@gmail.com
Subject: Re: A tree data structure?
To: Cocoa-Dev List cocoa-dev@lists.apple.com
Date: Tuesday, 2009 May 5, 12:19
Please let's not forget that a tree data structure
is often pretty much useless without some form of
Thanks for your reply, there is still so much I need to learn.
I thought adding an autorelease pool wasn't necessary when garbage
collection was turned on?
I suppose making the NSBitmapRep image is taking so long to convert to
because I have seven CISourceOverCompositing filters to combine
You could store it as an array of dictionaries or arrays, for example.
On 5-May-09, at 2:50 PM, Eric E. Dolecki wrote:
Probably only 10... however I understand that a plist can't store
complex
data... how would this work for pairs? Normally I'd only be able to
store
just a list of scores,
hi Eric,
On May 5, 2009, at 8:23 PM, Bill Bumgarner wrote:
On May 5, 2009, at 11:18 AM, Eric E. Dolecki wrote:
I am looking to save and read name/score pairs and started looking
at SQLite
to do this. I'm checking the Books sample application and there
seems to be
tons of code in there to
On May 5, 2009, at 11:57 AM, McLaughlin, Michael P. wrote:
Naturally, I came up with a solution two minutes after posting my
query to
this list :-(
My solution is
[[NSBezierPath bezierPathWithRect:rect] setClip];
where rect is the viewRect. This works for me. It might not be
the best
On May 5, 2009, at 11:50 AM, Eric E. Dolecki wrote:
Probably only 10... however I understand that a plist can't store
complex data... how would this work for pairs? Normally I'd only be
able to store just a list of scores, not paired with names, correct?
A property list is composed of a
Note that this will do a non-language-sensitive case conversion. If
you care about handling languages like Turkish correctly, use
CFStringUppercase.
Deborah Goldsmith
Apple Inc.
golds...@apple.com
On May 4, 2009, at 10:13 PM, Graham Cox wrote:
On 05/05/2009, at 3:04 PM, rethish wrote:
Thanks for the answers, yes and no, but I've found a problem doing
so
1. Insert a managed object.
2. Set an attribute in the object.
3. Delete the object from its moc.
4. Execute a fetch request in the moc with no predicate.
5. Get the attribute from the object.
Expected Result: The
I don't think I have a leak...quite the opposite. I think the sample app I'm
playing with is crashing because I might be releasing an object too soon.
Which is why I resorted to retainCounts to try and track it down...
George
On Tue, May 5, 2009 at 7:01 PM, Nick Zitzmann n...@chronosnet.com
On May 5, 2009, at 5:04 PM, Malayil George wrote:
I don't think I have a leak...quite the opposite. I think the sample
app I'm
playing with is crashing because I might be releasing an object too
soon.
Which is why I resorted to retainCounts to try and track it down...
You can track that
Beyond the fact that retain counts are useless for debugging...
On Tue, May 5, 2009 at 5:54 PM, Malayil George georg...@gmail.com wrote:
NSLog(@Cell image pointer: %x, retain count: %d, [cell image], [[cell
image] retainCount]); //retain count 4
NSLog(@Cell image pointer: %x, retain count:
On 06/05/2009, at 4:47 AM, McLaughlin, Michael P. wrote:
In a custom NSBezierView, I fill the view with a background color
then set a
clip path that will eventually be drawn as a map. I do this so that
I can
color-code the map (in a complicated way) without going outside the
lines.
If
I have some code that grabs an app icon from an app bundle's .icns file and
then sets it onto another file using -setIcon:forFile. Under 10.5 it works
fine. Under 10.4 the icon gets set but is garbled. I tried all the options but
still get the same result. Does anyone know why this happens on
Hi, I'm trying to expand on Styling an NSTableView at katidev.com in a
test app of mine. The modification that I have made is that in my subclass
of NSCell, I have included a new NSImage data element
@interface CustomCell : NSCell {
NSImage *image;
}
@end
In my appController, I set the
just found
http://developer.apple.com/samplecode/ImageBackground/listing3.html after
posting this...going through it to see if I can figure it out :-)
On Tue, May 5, 2009 at 8:41 PM, Malayil George georg...@gmail.com wrote:
Hi, I'm trying to expand on Styling an NSTableView at katidev.com in
Interestingly changing the property type from copy as I had it to
retain @property
(retain) NSImage *image;
seems to have fixed the problem
Not entirely sure why tho. I would imagine that with copy, my cell would
be getting a copy of the image with a retain count of 1. When dealloced it
goes
On 5 maj 2009, at 17.41, Malayil George wrote:
The modification that I have made is that in my subclass of NSCell
A couple of points:
* NSCell already have an image property. Why are you adding an
additional image property? If you're adding an additional image
property, you should give
Hi List,
I've got a problem when I try to bind the enabled attribute of an
NSPopUpButtonCell.
I have set up an NSArray of custom objects, these custom objects
provide two keys that I want to use for binding (and other keys for
other uses). The two keys are optionTitle and optionAllowed. I
have
On May 5, 2009, at 8:46 PM, Dave Geering wrote:
I've got a problem when I try to bind the enabled attribute of an
NSPopUpButtonCell.
I have set up an NSArray of custom objects, these custom objects
provide two keys that I want to use for binding (and other keys for
other uses). The two keys
Bindings are wonderful. I try and use bindings whenever available --
except when I'm dealing with menus.
You see from Ken's response that there are things that just don't fit,
or if they do fit, it might take a long time to figure out how.
My advice is to not use bindings to create
Hello,
I changed the target on my program from 10.4 to 10.5, built it
fine but now the following line of code fails:
[[self nib] instantiateNibWithOwner:self
topLevelObjects:topLevelObjects];
where [self nib] is simply
-(NSNib*)nib
{
static NSNib *nib=nil;
if
I have a UITextfield that I have set the delegate for. I have a
default keyboard and when you hit the send key (I've set the return to
send) nothing happens. I have the - (void)textFieldDone:(id)sender
method implemented but the didendediting notification is never sent
and the
I'm working on a project where I'm reading in a file that contains a
list of coordinates that are used to define a stitch pattern for
embroidery machines. Think of those machines you see at the mall that
stitch names and logos on hats and t-shirts. To display the images, I
created a
Hi,
I am working on a program where I plan to put a mode selector in the
upper right corner.
I hope to implement this using a toolbar and a custom view. The custom
view contains the mode selector, which is a NSSegmented control.
So far, I have managed to display the custom view in the
The doc for NSNotificationQueue says:
When the thread where a notification is enqueued terminates before
the notification queue posts the notification to its notification
center, the notification goes unposted.
My question is, do the NSOperationQueue thread(s) stay around long
enough so
On Wed, May 6, 2009 at 12:57 PM, Jerry Krinock je...@ieee.org wrote:
Bindings are wonderful. I try and use bindings whenever available -- except
when I'm dealing with menus.
You see from Ken's response that there are things that just don't fit, or if
they do fit, it might take a long time
I'll also ask a follow-up question, and that is, if one puts an
NSNotification onto the thread's NSNotificationQueue in a method
called by performSelectorInBackground..., then is it safe to assume
this notification will probably never get sent because the thread
spawned automatically by
On 06/05/2009, at 12:28 PM, Tom Roehl wrote:
I'm working on a project where I'm reading in a file that contains a
list of coordinates that are used to define a stitch pattern for
embroidery machines. Think of those machines you see at the mall
that stitch names and logos on hats and
On Tue, May 5, 2009 at 11:44 PM, Eric Hermanson zmons...@mac.com wrote:
I'll also ask a follow-up question, and that is, if one puts an
NSNotification onto the thread's NSNotificationQueue in a method called by
performSelectorInBackground..., then is it safe to assume this notification
will
In a Cocoa app when I click Window - Minimize -[NSWindow
performMiniaturize:] is called, which then calls -[NSWindow
miniaturize:].
When I click the yellow button of a window, -[NSWindow miniaturize:]
is called directly.
Seen and checked in Debugger.
But what is called when I
On 2009 May 05, at 20:40, Dave Geering wrote:
It'd be nice if I could somehow hook into whatever is responsible for
making the menu . . .
- (void) willAddMenuItem:(NSMenuItem *) aMenuItem
toPopUpButton:(NSPopUpButton *)
forObject:(id) yourObject
{
[aMenuItem setEnabled:[[yourObject
On 06/05/2009, at 11:01 AM, Gerriet M. Denkmann wrote:
But what is called when I Option-click Window - Minimize (the Menu
Item changes to Minimize All)?
I cannot find any information in Interface Builder.
And see no obvious methods in NSWindow.
NSApplication:
-
On Wed, May 6, 2009 at 2:30 PM, Jerry Krinock je...@ieee.org wrote:
But then there would have to be another API to give it the items, and
another to localize the titles. Don't wish for that.
Well, it's still not too bad an idea for me. optionTitle is already
localised in my custom object
Hey Philip -
Have you tried running with a breakpoint on objc_exception_throw?
Looking at the backtrace when you hit the exception could shed some
light on what is happening. If that doesn't work, you could try a
breakpoint on NSLog(), or even write(). After you hit the breakpoint,
a
I'm trying to find a good way of associating an Objective-C object
with an arbitrary Java object, so that you could essentially delegate
the Objective-C method call to a Java object. I envision that this
would have to be done using JNI. However, I don't know the specifics
of how it can
86 matches
Mail list logo