Re: [iPhone] Addressbook "group" problem

2009-07-12 Thread James Lin
Thank you Roland. Actually, I tried that function...but there is a problem that I can't figure out. the following is my code segment... ABAddressBookRef addressBook=ABAddressBookCreate(); CFArrayRef grpval= ABAddressBookCopyArrayOfAllGroups(addressBook); CFIndex groupCount = ABAd

Re: literal strings - who do they belong to?

2009-07-12 Thread BJ Homer
> > But then I saw the case where I have an object which returns, as a method > result or a property, one of its instance variables. The caller holds on to > it (without retaining it) then releases (and deallocs) my object. My object > releases its instance variables which results in the caller ho

Re: [iPhone] Addressbook "group" problem

2009-07-12 Thread Luke Hiesterman
Ditto that. Luke Sent from my iPhone. On Jul 12, 2009, at 10:15 PM, Roland King wrote: ABAddressBookCopyArrayOfAllGroups()? James Lin wrote: Hi, Sorry I didn't frame my question more clearly... The part I am having trouble with is finding out if a "group name" already exists in the add

RE: literal strings - who do they belong to?

2009-07-12 Thread Jeff Laing
> Unfortunately, this contract isn't always followed. Lots of people > "optimise" away this policy instead of doing a "superfluous" 'return > [[foo retain] autorelease]'. On initial read, I didn't quite follow this. If my method is returning a foo that I know I have "retained", what requirement

Re: literal strings - who do they belong to?

2009-07-12 Thread Wade Tregaskis
I know you guys probably know this, but to be technically accurate, there is no guarantee the return value of stringByAppendingString returns an autoreleased string. While your point is true, it's not actually a rebuttal - you can assume objects returned from such methods are autoreleased,

Re: [iPhone] Addressbook "group" problem

2009-07-12 Thread Roland King
ABAddressBookCopyArrayOfAllGroups()? James Lin wrote: Hi, Sorry I didn't frame my question more clearly... The part I am having trouble with is finding out if a "group name" already exists in the addressbook, is there a way to do this? the ABGroup documentation has no function that allo

Re: [iPhone] Addressbook "group" problem

2009-07-12 Thread James Lin
Hi, Sorry I didn't frame my question more clearly... The part I am having trouble with is finding out if a "group name" already exists in the addressbook, is there a way to do this? the ABGroup documentation has no function that allows this... any suggestions? Thank you in advance...

Re: NSError in NSDocument readFromURL

2009-07-12 Thread Quincey Morris
On Jul 12, 2009, at 15:50, Konrad Windszus wrote: If I set an NSError in the method readFromURL of my NSDocument, I am not able to overwrite the NSLocalizedDescriptionKey. ... Unfortunately only the strings of the keys NSLocalizedFailureReasonErrorKey and NSLocalizedRecoverySuggestionErr

Re: literal strings - who do they belong to?

2009-07-12 Thread Peter N Lewis
On 12/07/2009, at 23:23 , Ben Cox wrote: NSString +stringByAppendingString:(NSString*) returns an autoreleased string. If you release it explicitly, your application will crash. On 13/07/2009, at 0:02 , Bill Bumgarner wrote: After the second assignment, htmlString is no longer a literal strin

Re: Best 'Cocoa' File Preview

2009-07-12 Thread David Blanton
Still no work ... I go sleep now .. On Jul 12, 2009, at 7:18 PM, David Blanton wrote: Is it not the case that the UTI is defined in the info.plist CFBundleDocumentTypes? (which I have done). On Jul 12, 2009, at 6:01 PM, Julien Jalon wrote: On Mon, Jul 13, 2009 at 12:58 AM, David Bla

NSError in NSDocument readFromURL

2009-07-12 Thread Konrad Windszus
If I set an NSError in the method readFromURL of my NSDocument, I am not able to overwrite the NSLocalizedDescriptionKey. If have the following code in that method: - (BOOL)readFromURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError { NSArray *objArray = [NSArray

Re: Best 'Cocoa' File Preview

2009-07-12 Thread David Blanton
Is it not the case that the UTI is defined in the info.plist CFBundleDocumentTypes? (which I have done). On Jul 12, 2009, at 6:01 PM, Julien Jalon wrote: On Mon, Jul 13, 2009 at 12:58 AM, David Blanton wrote: I am traveling down the QuickLook path ... I have followed all directions

Re: Capturing active state

2009-07-12 Thread Rob Keniger
On 13/07/2009, at 1:19 AM, Srinivas Prabhu G wrote: But the problem here is, as our application is active, when we read image from the frame buffer states of all other apps look disabled ie. scroller and buttons have greyish shade instead of blue. Similar problem is observed in SonOfGrab

RE: literal strings - who do they belong to?

2009-07-12 Thread Jeff Laing
> According to Cocoa/ObjC memory-management, if you get an object > (reference) via "alloc","new",any object that contains "copy", and > any object you send [ retain] to, is yours - it becomes your > responsibility to call [ release] on it when you're > done. Ditto for properties like > > @propert

Re: Best 'Cocoa' File Preview

2009-07-12 Thread Julien Jalon
On Mon, Jul 13, 2009 at 12:58 AM, David Blanton wrote: > I am traveling down the QuickLook path ... > > I have followed all directions but my code is not being called by qlmange > as evidenced here: > > 7/12/09 4:46:08 PM qlmanage[855] [QL] Thumbnailing > /users/davidblanton/Aibnb18.pes. Content t

Re: Best 'Cocoa' File Preview

2009-07-12 Thread David Blanton
I am traveling down the QuickLook path ... I have followed all directions but my code is not being called by qlmange as evidenced here: 7/12/09 4:46:08 PM qlmanage[855] [QL] Thumbnailing /users/davidblanton/ Aibnb18.pes. Content type UTI: dyn.ah62d4rv4ge81a3px. Generator used: None 7/12/09

CAKeyframeAnimation problem

2009-07-12 Thread David W. Berry
I'm having a problem with CAKeyframeAnimation in an iPhone application I'm developing. I'm using several flash-card style animations which just play a sequence of images created by chopping up a .png file. The animation creation looks like: - (id) initFromDescription:(NSDictionary*)descript

iPhone sdk 3.0 -> MKMapView linker error

2009-07-12 Thread sathish kumar
Hi, I have upgraded my iphone sdk from 2.2.1 to 3.0. I downloaded a sample code for MapKit and was able to run it successfully. But when I tried to write my own program I faced linker errors. The error is not thrown when I import MapKit/MapKit.h or when I declare a variable as MKMapView *mapView

Capturing active state

2009-07-12 Thread Srinivas Prabhu G
Hi All, I am working on application where there is feature to capture screen snap same as apples grab. In this user can select a region and can capture selected area as image. We have used a approach where selection is drawn on a transparent window and we capture the image by reading the d

Re: literal strings - who do they belong to?

2009-07-12 Thread Ben Cox
NSString +stringByAppendingString:(NSString*) returns an autoreleased string. If you release it explicitly, your application will crash. -- Ben On Sun, Jul 12, 2009 at 11:16 AM, William Squires wrote: > According to Cocoa/ObjC memory-management, if you get an object (reference) > via "alloc","ne

Re: [iPhone] Multi-touch gestures in table views?

2009-07-12 Thread Conrad Taylor
Hi, please this is the cocoa-dev mailing list and this thread belongs in the iPhone Developer Forums. Thanks, -Conrad On Sun, Jul 12, 2009 at 12:21 PM, Fritz Anderson wrote: > On 12 Jul 2009, at 1:37 PM, Påhl Melin wrote: > > Is there a way to stop table views interpret multi-finger gestures as

Re: Core Data fetch exception: keypath not found in entity

2009-07-12 Thread Fritz Anderson
On 12 Jul 2009, at 2:28 PM, Quincey Morris wrote: says: "Note that you cannot fetch using a predicate based on transient properties". I think that pretty much covers it. :) And so it should, and I'm ashamed I didn't find that. But removing the latestDate predicate didn't help. What did

Re: Core Data fetch exception: keypath not found in entity

2009-07-12 Thread Quincey Morris
On Jul 12, 2009, at 12:05, Fritz Anderson wrote: I have an entity, "Sale," that has a transient attribute "latestDate." It is marked optional/transient/indexed in the MOM; I've also tried it without setting optional. I set latestDate in awakeFromFetch and awakeFromInsert. I use [NSDate da

Re: [iPhone] Multi-touch gestures in table views?

2009-07-12 Thread Fritz Anderson
On 12 Jul 2009, at 1:37 PM, Påhl Melin wrote: Is there a way to stop table views interpret multi-finger gestures as "single-finger" scrolling? I don't know for sure, but my next experiment would be the delaysContentTouches property of UIScrollView (and therefore of UITableView).

Re: Core Data fetch exception... further

2009-07-12 Thread Fritz Anderson
On 12 Jul 2009, at 2:05 PM, Fritz Anderson wrote: I have an entity, "Sale," that has a transient attribute "latestDate." It is marked optional/transient/indexed in the MOM; I've also tried it without setting optional. I set latestDate in awakeFromFetch and awakeFromInsert. I use [NSDate d

Re: Printing a View

2009-07-12 Thread Matt Neuburg
On Sun, 12 Jul 2009 11:02:31 -0700, "K. Darcy Otto" said: >I'm trying to print a custom view. I've already customized that view >in -drawRect:, and everything seems to be displayed correctly. The >problem I'm having is that when it comes time to do -rectForPage, the >output to the printer seems

Core Data fetch exception: keypath not found in entity

2009-07-12 Thread Fritz Anderson
This is on iPhone 3.0, but should be of general applicability. I have an entity, "Sale," that has a transient attribute "latestDate." It is marked optional/transient/indexed in the MOM; I've also tried it without setting optional. I set latestDate in awakeFromFetch and awakeFromInsert. I us

[iPhone] Multi-touch gestures in table views?

2009-07-12 Thread Påhl Melin
Hi, I'm trying to implement application-wide multi-touch gestures (e.g. two and three finger swipes in various directions) as shortcuts to different functions in an iPhone app. When I try to recognize the gestures in a table view I cannot get the table view to stop interpret multi-finger gestures

Re: Cocoa Frontend to SDL App

2009-07-12 Thread Alexander Spohr
Am 11.07.2009 um 22:09 schrieb Anthony Smith: On Jul 11, 2009, at 11:51 AM, Alexander Spohr wrote: Am 10.07.2009 um 21:35 schrieb Anthony Smith: What I would like to do is be able to somehow make the binary of the SDL app use the Cocoa view as the output device and output all the video

Printing a View

2009-07-12 Thread K. Darcy Otto
I'm trying to print a custom view. I've already customized that view in -drawRect:, and everything seems to be displayed correctly. The problem I'm having is that when it comes time to do -rectForPage, the output to the printer seems to shift around. Here is the code: -(NSRect)rectForPag

Re: Undo without Redo

2009-07-12 Thread Dave Fernandes
I've found the same problem in a Core Data app where managed objects are changed by a background thread calling back to the main thread over several iterations of the event loop, and I need to cancel them as a group. Here is the trick I used... NSUndoManager* mgr = [moc undoManager]; // Un

Re: How to prevent NSTableView from reordering rows when clicking at a header cell?

2009-07-12 Thread Quincey Morris
On Jul 12, 2009, at 02:24, norio ota wrote: I don't want user to re-oder its rows. Would you tell me how to prevent NSTableView from re-ordering its rows when being clicked in its header column? This option is hard to find. :) In the "Value" binding for each table column, uncheck the "Crea

Re: literal strings - who do they belong to?

2009-07-12 Thread Bill Bumgarner
On Jul 12, 2009, at 8:16 AM, William Squires wrote: - (void)setWebView:(SomeAppDelegate *)appDelegate { NSString *htmlString; htmlString = @"font-size=48pt;\"align=\"center\">"; htmlString = [htmlString stringByAppendingString:appDelegate.savedNumber]; htmlString = [htmlString stringByAppendi

Re: literal strings - who do they belong to?

2009-07-12 Thread Fritz Anderson
On 12 Jul 2009, at 10:16 AM, William Squires wrote: - (void)setWebView:(SomeAppDelegate *)appDelegate { NSString *htmlString; htmlString = @"font-size=48pt;\"align=\"center\">"; htmlString = [htmlString stringByAppendingString:appDelegate.savedNumber]; htmlString = [htmlString stringByAppend

literal strings - who do they belong to?

2009-07-12 Thread William Squires
According to Cocoa/ObjC memory-management, if you get an object (reference) via "alloc","new",any object that contains "copy", and any object you send [ retain] to, is yours - it becomes your responsibility to call [ release] on it when you're done. Ditto for properties like @property (no

Re: Undo without Redo

2009-07-12 Thread Greg Titus
On Jul 12, 2009, at 7:10 AM, John Nairn wrote: I added an option to cancel some action in the middle of the action. The most convenient coding was to implement the cancel by calling undo in the NSUndoManager, but this adds a "Redo" action to redo the partial or incomplete changes (and leav

Re: Undo without Redo

2009-07-12 Thread Jean-Daniel Dupas
Le 12 juil. 09 à 16:10, John Nairn a écrit : I added an option to cancel some action in the middle of the action. The most convenient coding was to implement the cancel by calling undo in the NSUndoManager, but this adds a "Redo" action to redo the partial or incomplete changes (and leaves

Re: Undo without Redo

2009-07-12 Thread I. Savant
On Jul 12, 2009, at 10:10 AM, John Nairn wrote: I added an option to cancel some action in the middle of the action. The most convenient coding was to implement the cancel by calling undo in the NSUndoManager, but this adds a "Redo" action to redo the partial or incomplete changes (and leav

Undo without Redo

2009-07-12 Thread John Nairn
I added an option to cancel some action in the middle of the action. The most convenient coding was to implement the cancel by calling undo in the NSUndoManager, but this adds a "Redo" action to redo the partial or incomplete changes (and leaves the data in a poor state). I can either re-co

Re: Implementing previous, next, first, last controls in Core Data applications

2009-07-12 Thread I. Savant
On Jul 12, 2009, at 8:51 AM, Ian Piper wrote: Can anyone tell me whether there are any plug-ins or examples that show how to implement buttons to move forward and backward through a record set in a Core Data application? I am thinking of having a window that simply presents one record from

Implementing previous, next, first, last controls in Core Data applications

2009-07-12 Thread Ian Piper
Hi all, Can anyone tell me whether there are any plug-ins or examples that show how to implement buttons to move forward and backward through a record set in a Core Data application? I am thinking of having a window that simply presents one record from a collection, with forward, backward

Re: How to prevent NSTableView from reordering rows when clicking at a header cell?

2009-07-12 Thread Dave Keck
You can configure this in IB. Put IB in the list-view mode (click the center button of the 3-part button in the upper-left of the project window). Find and select your table view in the list, and uncheck 'Reordering' and perhaps 'Column' in the inspector. ___

How to prevent NSTableView from reordering rows when clicking at a header cell?

2009-07-12 Thread norio ota
Hi, I don't want user to re-oder its rows. Would you tell me how to prevent NSTableView from re-ordering its rows when being clicked in its header column? Norio ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requ

Re: Retain cycles with NIB instantiations, bindings

2009-07-12 Thread Ken Thomases
On Jul 10, 2009, at 2:19 AM, Half Activist wrote: I'm loading a NIB file at runtime and use a new instance of a class as its owner each time. Everything works fine, until I wish to delete an object. In my software, i'm using several instances of objects that have their own