Re: Weird NSPredicate structure when using "first" in keypath

2017-01-17 Thread Chris Hanson
On Jan 9, 2017, at 8:29 PM, Jens Alfke wrote: > On Jan 9, 2017, at 6:38 PM, Aaron Tuller wrote: >> Try doing >> name.#first >> as FIRST and LAST are reserved words and need escaping: > > Thanks for the answer. Unfortunately this is a library that will

Re: Representing an object graph

2016-12-15 Thread Chris Hanson
On Dec 15, 2016, at 7:24 PM, Daryle Walker <dary...@mac.com> wrote: > > On Dec 6, 2016, at 10:18 PM, Chris Hanson <c...@me.com <mailto:c...@me.com>> > wrote: >> >> On Dec 5, 2016, at 4:18 PM, Daryle Walker <dary...@mac.com >> <mailto:dary...

Re: Representing an object graph

2016-12-06 Thread Chris Hanson
On Dec 5, 2016, at 4:18 PM, Daryle Walker wrote: > I've heard that Core Data is a object graph and persistence library. What if > you want just the first part? The graph seems like a neat way to save on > modeling code, the external format is not database-ish at all (so the

Re: CoreData headaches

2016-10-30 Thread Chris Hanson
On Oct 28, 2016, at 9:44 PM, Steve Mills wrote: > > On Oct 27, 2016, at 23:35:39, Dave Fernandes wrote: >> >> The managed objects exist in a MOC whether you have a reference to that MOC >> or not. You can get a reference to the MOC that an MO “belongs to"

Re: CoreData headaches

2016-10-30 Thread Chris Hanson
On Oct 27, 2016, at 9:02 PM, Steve Mills wrote: > > Yes, the Asset is an NSManagedObject. In this call chain, there is no > NSManagedObjectContext in sight. There is always an NSManagedObjectContext involved; an NSManagedObject doesn’t exist outside one. Fortunately, you

Re: SecStaticCodeCheckValidity fails when app is lauched from Terminal

2016-09-27 Thread Chris Hanson
On Sep 27, 2016, at 1:54 PM, Markus Spoettl <ms_li...@shiftoption.com> wrote: > > On 27/09/16 22:39, Chris Hanson wrote: >> How are you getting the URL that you pass to represent your application? >> >> Could it be that you’re constructing the URL from a

Re: SecStaticCodeCheckValidity fails when app is lauched from Terminal

2016-09-27 Thread Chris Hanson
How are you getting the URL that you pass to represent your application? Could it be that you’re constructing the URL from a relative path when run from the command line, rather than the full path? (You can’t depend on being run from any particular working directory.) -- Chris > On Sep 26,

Re: "Live" NSFetchRequest?

2016-09-24 Thread Chris Hanson
Are you asking about an NSFetchRequest that notices when objects are added to or changed in your persistent store by another process, or by another thread in the same process? In the latter case you can use the notifications posted by the NSManagedObjectContext that's being saved, and use that

MODERATOR: End of Thread (was Re: I am reluctant to file any more bugs until those already reported are fixed)

2015-07-21 Thread Chris Hanson
This is the place for neither rants nor personal attacks. Please keep it technical. Thanks. -- Chris Hanson (cocoa-dev co-moderator) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

Re: MODERATOR: End of Thread (was Re: I am reluctant to file any more bugs until those already reported are fixed)

2015-07-21 Thread Chris Hanson
://www.apple.com/feedback/ and the bug reporter at http://bugreport.apple.com/ http://bugreport.apple.com/. -- Chris Hanson (cocoa-dev co-mod) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

[MODERATOR] End of Thread: Re: Blurry is the New Sharp

2015-01-08 Thread Chris Hanson
Please stick to technical discussion on cocoa-dev. If there are remaining technical questions in this thread, please ask them in their own threads. (And avoid off-topic derails.) Thanks. -- Chris (cocoa-dev co-mod) ___ Cocoa-dev mailing list

Re: Converting SenTesting framework tests to XCTests

2014-07-10 Thread Chris Hanson
On Jul 10, 2014, at 12:31 PM, William Squires wsqui...@satx.rr.com wrote: I'm trying to convert some code that used the old(er) SenTesting framework. Now I want to use the XCTest stuff. I have the following line: STAssertEquals(int, int, NULL); // int is just a int-type variable or

Re: Opinion: Core Data or roll my own?

2014-04-09 Thread Chris Hanson
On Apr 8, 2014, at 4:20 PM, Jens Alfke j...@mooseyard.com wrote: I’m not a big fan of Core Data, but if you’ve worked with it before I suspect you’ll find it more efficient to use it for this than to roll your own. Even if you haven't worked with it before, it'll still probably wind up being

Re: SQLite Question

2014-03-28 Thread Chris Hanson
On Mar 28, 2014, at 9:19 AM, Dave d...@looktowindward.com wrote: If I need to access SQLite Directly on Mac and iOS, do I need to include my own SQLite Library or can I use the in-built SQLite? You should use the SQLite that is part of the OS, and not build a separate version. The same goes

Re: NSInteger/NSUInteger Considerations (64 bit)

2014-03-26 Thread Chris Hanson
On Mar 25, 2014, at 4:55 PM, Jens Alfke j...@mooseyard.com wrote: So if something is supposed to be a particular size (as seems to happen in your app) declare it as a type of that size. If you don’t care about the size and it won’t ever exceed a few billion, use `int` or `unsigned`. If it

Re: VC# vs. ObjC and partial abstract classes

2014-03-18 Thread Chris Hanson
On Mar 18, 2014, at 7:29 PM, Luther Baker lutherba...@gmail.com wrote: A _better_ analogy to an Objective-C @protocol would be a formal Java interface. In their design, Java’s interfaces were explicitly modeled on Objective-C’s @protocol construct. -- Chris

MODERATOR: End of Thread (was Re: NSSavePanel?)

2014-03-06 Thread Chris Hanson
This is off-topic for cocoa-dev. -- Chris Hanson, cocoa-dev co-moderator ___ 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

Re: Deadlock during NSCache flush

2013-10-23 Thread Chris Hanson
What Greg says on this topic is authoritative. -- Chris Sent from my iPad On Oct 23, 2013, at 4:35 PM, Maxthon Chan xcvi...@me.com wrote: There are still situations that you may want a little touch-up so from time to time a manual call to these is still needed. On Oct 24, 2013, at

MODERATOR: (Temporary) End of Thread (was Re: I can't use man command to find c api manuals in Mavericks GM)

2013-10-22 Thread Chris Hanson
Until OS X Mavericks becomes available to everyone via the App Store, it's still under NDA. Once it's available it can be discussed here, until then it can't. -- Chris, Cocoa-Dev co-mod ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: MODERATOR: (Temporary) End of Thread (was Re: I can't use man command to find c api manuals in Mavericks GM)

2013-10-22 Thread Chris Hanson
OS X Mavericks is available on the App Store now. -- Chris, cocoa-dev co-mod -- who would like to point out the timestamp when he posted the original message ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: Determine keys used in NSPredicate

2013-10-20 Thread Chris Hanson
On Oct 19, 2013, at 9:44 PM, Trygve Inda cocoa...@xericdesign.com wrote: How can I look at myPredicate and determine that it uses dynamicPropertyA? Is it enough and safe to use [myPredicate predicateFormat] and then search the resulting string for dynamicPropertyA? Once you have an

Re: Core Data with ODBC databases?

2013-10-17 Thread Chris Hanson
On Oct 17, 2013, at 9:49 AM, Jens Alfke j...@mooseyard.com wrote: But NSIncrementalStore doesn’t have a notion of a transaction, because CoreData doesn’t care about concurrency, because it’s not multi-user. This is not the case. - NSIncrementalStore’s notion of a transaction is an instance

MODERATOR: End of Thread (was Re: [OT] Buttons in iOS 7)

2013-10-10 Thread Chris Hanson
Please keep posts on-topic for this list and do not continue this off-topic thread. Thanks. -- Chris Hanson, cocoa-dev co-moderator ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

MODERATOR: End of Thread (was Re: iOS7 Controls)

2013-09-24 Thread Chris Hanson
Please remember that the cocoa-dev list is for technical discussion of Cocoa and Cocoa Touch development, and keep the discussion on-topic. -- Chris Hanson cocoa-dev co-mod ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do

Re: Is it possible to define class from interface builder?

2013-08-15 Thread Chris Hanson
On Aug 13, 2013, at 11:34 AM, Izak van Langevelde eezac...@xs4all.nl wrote: A user interface contains several instances of a specific form, which is easily created in Interface Builder. Is there any way to derive a subclass of NSView from this form, so that it can be reused? A good way to

MODERATOR: End of Thread (was Re: There must be a live human at Apple?)

2013-08-03 Thread Chris Hanson
Please do not continue this thread. As per the list guidelines, please keep discussion on the list to technical topics related to Cocoa development, and do not cross-post to multiple lists. -- Chris Hanson cocoa-dev co-mod ___ Cocoa-dev

MODERATOR: End of Thread (was Re: Apple Developer Update)

2013-07-26 Thread Chris Hanson
Sorry, but this is off-topic for the cocoa-dev list. Please keep discussion here to technical topics related to Cocoa development. To provide feedback to Developer Support, visit the contact page at https://developer.apple.com/contact/. Thanks. -- Chris, cocoa-dev co-moderator

MODERATOR NOTE: Re: NSOutlineViews and Mountain Lion

2013-07-10 Thread Chris Hanson
There is no supported way to disable the various controls' animations on a system-wide basis. *** Any discussion of unsupported/reverse-engineered ways to do so (or to do anything else) is against the list rules, and therefore should not take place on the list. *** Furthermore, requests for a

Re: Concurrent MOCs

2013-06-10 Thread Chris Hanson
On Jun 10, 2013, at 6:28 AM, Roland King r...@rols.org wrote: How about the objects which are then owned by the MOC, the managed objects? Do any messages sent to them, even a property or relationship lookup, need also to be in a performBlock: call on the MOC owning those objects? For an

Re: How to read the deployment target of a .plugin?

2013-02-12 Thread Chris Hanson
On Feb 10, 2013, at 7:09 PM, Jerry Krinock je...@ieee.org wrote: In an .app project, the Build Setting named Deployment Target in Xcode gets compiled into the product's Info.plist as LSMinimumSystemVersion, and this is the minimum Mac OS X version in which the product will launch. That is a

Re: How to read the deployment target of a .plugin?

2013-02-12 Thread Chris Hanson
On Feb 10, 2013, at 10:40 PM, Jerry Krinock je...@ieee.org wrote: On 2013 Feb 10, at 21:12, Charles Srstka cocoa...@charlessoft.com wrote: On my machine, Compiler Default makes it 10.8. Same here. Those Compiler Default and Current/Latest OS X Build Settings values are going to kill me

Re: NSTask Explodes. Clueless.

2013-02-06 Thread Chris Hanson
On Feb 5, 2013, at 10:39 AM, Seth Willits sli...@araelium.com wrote: Does your crash log show multiple threads? I would expect that the crash log shows only one thread because NSTask called fork() already. Hmm. Yes, there's only one thread. I didn't notice that. That explains the crash

Re: NSTask Explodes. Clueless.

2013-02-06 Thread Chris Hanson
On Feb 4, 2013, at 11:26 AM, Seth Willits sli...@araelium.com wrote: Looking around the open source code for exec(), it appears EINVAL (22) can be returned if the task was exec()'d when not called from a vfork()'d process, with the comment /* If we're not in vfork, don't permit a

Re: Issue with Core Data Model

2013-01-12 Thread Chris Hanson
On Jan 11, 2013, at 8:12 AM, Alex Zavatone z...@mac.com wrote: Back as of Xcode 4.2, many classes would not implicitly support po in the debugger unless you wrote your own description method to return the properties you wanted to expose. What leads you to this conclusion? Many, but not

Re: Issue with Core Data Model

2013-01-12 Thread Chris Hanson
On Jan 11, 2013, at 5:22 AM, Amy Gibbs a...@willowtreecrafts.co.uk wrote: One of the issues is I called and attribute of an entity 'description'. This didn't appear as an error in Xcode 3 which I was using, and didn't create a problem using the app. Now in Xcode 4 the model won't even open

Re: Custom initWithFrame?

2013-01-05 Thread Chris Hanson
On Jan 3, 2013, at 5:28 PM, Eric Dolecki edole...@gmail.com wrote: I am creating a UIView-based control that I would also like to pass in parameters at the time of creation. Is this doable? I don't want to keep calling methods on my object if I can pass all with initwithframe somehow. This

Re: Beachballing 2

2012-12-04 Thread Chris Hanson
Please don't create lots of different message threads for a single issue/discussion. Sticking to a single thread makes it much easier to follow by keeping all of the context together. Thanks. -- Chris -- cocoa-dev's other moderator ___

Re: Best data source for table view in document window

2012-09-05 Thread Chris Hanson
On Sep 5, 2012, at 5:39 AM, Jerry Krinock je...@ieee.org wrote: (2) Separate, standalone object. Fancy housekeeping is needed to avoid retain cycles, and crashes in corner cases as the document window is closing. This is the way to go. That housekeeping doesn’t need to be so fancy; you just

Re: Best data source for table view in document window

2012-09-05 Thread Chris Hanson
On Sep 5, 2012, at 11:53 AM, Seth Willits sli...@araelium.com wrote: In a complex window where there a multiple tabbed views like you have, think of the window controller as doing nothing more than managing the view controllers for each of the tabs, not the actual views in each tab. If your

Re: KVG generic enough?

2012-07-21 Thread Chris Hanson
On Jul 18, 2012, at 4:46 PM, William Squires wsqui...@satx.rr.com wrote: For example, an effect could be called fireball and do 1d6 HP to a player caught in the blast radius. My 'effect' class has an @property of type NSMutableArray (which holds 'codons' in NSStrings) of the form:

Re: Core Data Multiuser

2012-07-17 Thread Chris Hanson
On Jul 17, 2012, at 7:05 AM, Flavio Donadio fla...@donadio.com.br wrote: I already took a look at NSIncrementalStore and it seems to solve one of my problems. I am fairly good with PHP, but I could always create a web service with Rails or something else… On the client side, it doesn’t

Re: Core Data Multiuser

2012-07-16 Thread Chris Hanson
On Jul 16, 2012, at 2:39 PM, Jens Alfke j...@mooseyard.com wrote: (1) Client-server. The database lives on one server machine, as does the business logic (I hate that term) that manages your app. This could definitely be implemented with Core Data if you like. The client app just focuses

Re: Equation style display

2012-07-02 Thread Chris Hanson
Mathematical typesetting is actually incredibly complex, and people like Donald Knuth have dedicated significant portions of their careers to it. There's no simple way to go from a textual representation of a formula to a typeset version, not least of which because there's no universally

Re: NSInteger vs int vs int32_t

2012-07-02 Thread Chris Hanson
NSInteger and NSUInteger also have the advantage of having the same @encode() on 32-bit and 64-bit, which can be important for binary compatibility of archives and IPC between architectures, depending on how you do it. -- Chris On Jul 2, 2012, at 8:58 AM, Jens Alfke j...@mooseyard.com wrote:

Re: Nested XML - CoreData

2012-05-15 Thread Chris Hanson
On May 15, 2012, at 7:29 AM, Koen van der Drift koenvanderdr...@gmail.com wrote: However, the data read with the parser needs to end up in my Core Data model. Obviously I already created a Person entity, but how do I add the phone numbers to it? Create a PhoneNumber entity with two

Re: Minimal document-based app

2012-05-02 Thread Chris Hanson
On May 2, 2012, at 6:19 AM, ecir hana ecir.h...@gmail.com wrote: As I said above, I don't want the question to be whether I should better use NIBs, or whether Cocoa is more suitable than assembler. I somewhat know already what the role of NIB is, that it can save time and so on. What I would

Re: Minimal document-based app

2012-05-02 Thread Chris Hanson
On May 2, 2012, at 6:19 AM, ecir hana ecir.h...@gmail.com wrote: - I saw that Xcode named the Info.plist differently (it prepends my project name to it) - is it ok just to call it Info.plist? Is there any convention? Xcode is actually prepending the target name, not the project name: A project

Re: Cocoa equivalent for SetWindowProperty in Carbon

2012-04-18 Thread Chris Hanson
What end goal do you want to accomplish with an equivalent to SetWindowProperty? There isn't necessarily a 1:1 correspondence between API in different frameworks; describing your desired goal is more likely to lead to a solution. -- Chris On Apr 17, 2012, at 11:53 PM, Sanjay Arora

Re: Installing running Xcode

2012-03-22 Thread Chris Hanson
Xcode 3.0 and 3.1 are for Mac OS X 10.5 Leopard. For Mac OS X 10.4 Tiger, you want Xcode 2.0 through 2.5. I recommend Xcode 2.5 in the strongest possible terms; it fully supports development for Mac OS X on both PowerPC- and Intel-based 32-bit Macs, and basic libSystem development for 64-bit

Re: Missing header files/folders?

2012-03-22 Thread Chris Hanson
On Mar 22, 2012, at 11:24 AM, Eric Wing wrote: Correct. Note that when setting the path, you can get away with just pointing to the copy of Xcode that you'd like to bless: sudo xcode-select -switch /Applications/Xcode.app Interesting, but as a courtesy note to everybody, those of us

Re: [Q] Why is the threading and UI updating designed to be done only on a main thread?

2012-03-18 Thread Chris Hanson
On Mar 14, 2012, at 2:09 PM, Wade Tregaskis wadesli...@mac.com wrote: I don't like the idea of a multithreaded aproach by default, because as a general rule, you should not make your application multithreaded unless you have a good reason. b) This convenientional wisdom is, in my humble

Re: Core Data nested managed object contexts and frequent deadlocks

2012-01-13 Thread Chris Hanson
On Jan 13, 2012, at 12:39 AM, Michael Link wrote: the docs seem to indicate that using a main thread concurrency type MOC on the main thread without performBlock: is fine. It is, otherwise you couldn't (say) bind to a managed object you fetched via a main-queue context on OS X. What OS

Re: Copying objects between CoreData stores

2012-01-04 Thread Chris Hanson
On Jan 3, 2012, at 11:32 PM, Rick Mann wrote: I'm working on a Core Data-based CAD app. The schema includes Parts and PartInstances. There is a to-many relationship from Part to PartInstance. The Library contains Parts, but a CAD file contains Parts and PartInstances. When the user

Re: Static variables reset inside CFPlugin code

2012-01-01 Thread Chris Hanson
I have to wonder why you're using CFPlugIn in the first place. I strongly recommend using NSBundle and Objective-C for your plug-in architecture, or plain CFBundle and functions structs if you absolutely must use C rather than objects for your plug-in architecture. -- Chris

Re: Q: An App for both OS X and iOS

2011-12-21 Thread Chris Hanson
On Dec 21, 2011, at 7:50 AM, Peter Teeson wrote: I want to start a new workspace for an app that will be for both Mac OS X and iOS. This will be my first iOS app. The model part of MVC is going to be common but obviously the UIs are different. Am I correct in this plan outline: (1)

Re: Handling UTIs from a Cocoa protocol

2011-12-18 Thread Chris Hanson
You're still instantiating every handler class just to see whether one applies to a given file. This is exactly why class methods exist: You can implement a class method on your handler classes like Can this handler class be used for files of this type? Then, for the class answers yes, that's

Re: Handling UTIs from a Cocoa protocol

2011-12-17 Thread Chris Hanson
On Dec 17, 2011, at 6:02 PM, C.W. Betts wrote: Is there a way to put classes into some sort of array to go through and check if the UTI of a file matches up to any of the UTIs that the class can handle? Classes are objects too, so you can put them in arrays and so on. -- Chris

Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?

2011-09-07 Thread Chris Hanson
On Sep 6, 2011, at 11:19 PM, Oleg Krupnov wrote: So, gentlemen, the OP has ended up completely baffled with your discussion :) Do I have to build and ship two separate versions of my app, for 10.6 and for 10.7??! This would be a nightmare! No. At the bottom line, what is the legitimate

Re: Strange issue with NSPanel @visible keypath observeValueForKeyPath

2011-09-07 Thread Chris Hanson
On Sep 7, 2011, at 5:58 PM, vade wrote: I have an NSWindow, which my app controller is observing the value of @visible keypath, with the following line [previewWindow addObserver:self forKeyPath:@visible options:NSKeyValueObservingOptionNew context:NULL]; How did you determine

Re: using AppKit additions in background threads

2011-09-06 Thread Chris Hanson
On Sep 6, 2011, at 11:53 AM, Jens Alfke wrote: The background tool will need to link against WebKit and AppKit, so it won’t be strictly-speaking ‘background’. You can mark its bundle with a special key (LSBackgroundOnly?) to keep it from showing up in the Dock or getting a menu-bar though.

Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?

2011-09-06 Thread Chris Hanson
On Sep 6, 2011, at 3:33 AM, Oleg Krupnov wrote: I'm implementing a new Lion's API, namely the resume. I need to make the following call: [window setRestorationClass:someClass]; I'd like my app to also work on Snow Leopard, so I do this: if ([window

Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?

2011-09-06 Thread Chris Hanson
On Sep 6, 2011, at 4:44 PM, Ken Thomases wrote: On Sep 6, 2011, at 6:31 PM, Chris Hanson wrote: Furthermore, Xcode 3.2.6 and 4.0 added Latest Mac OS X and Latest iOS options to the Base SDK pop-up, which is preferable to specifying a particular OS version for the SDK against which you

Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?

2011-09-06 Thread Chris Hanson
On Sep 6, 2011, at 4:50 PM, Shane Stanley wrote: On Sep 7, 2011, at 9:31 AM, Chris Hanson wrote: You should set your Base SDK to the most recent OS whose features you are going to use (in this case 10.7) and set your Deployment Target to the least recent OS you want to run

Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?

2011-09-06 Thread Chris Hanson
On Sep 6, 2011, at 8:52 PM, Ken Thomases wrote: And has been discussed in the rest of the thread, you should not leave your Base SDK set to an earlier OS and then invoke methods introduced in a later OS, because the new methods may require new-OS framework behavior. When did I say

Re: compiling app for 10.6 and 10.7

2011-08-17 Thread Chris Hanson
On Aug 15, 2011, at 2:30 PM, Sean McBride s...@rogue-research.com wrote: It's probably a bit early to require a 7 week old OS (10.6.8) as a minimum. Anyone running anything older will see a crash, and quite possibly toss your app out. You can specify your minimum system in your Info.plist,

Re: Strategies for reusing NSPopover

2011-08-13 Thread Chris Hanson
On Aug 13, 2011, at 8:38 AM, Martin Hewitson martin.hewit...@aei.mpg.de wrote: As I'm writing this I realise it would be much nicer to pass a reference to the model object to the view-controller before launching the popup, then have the view controller update the model object. I'll play with

Re: Using #define a good way for String constants, like enums for NSIntegers?

2011-08-10 Thread Chris Hanson
If you're exporting symbols, you could have the visibility attribute be part of the macro you wrap around 'extern' anyway: #if defined(__cplusplus) #define MY_EXTERN extern C #else #define MY_EXTERN extern #endif #define MY_EXPORT MY_EXTERN __attribute__((visibility(default))) (The

Re: Using #define a good way for String constants, like enums for NSIntegers?

2011-08-09 Thread Chris Hanson
On Aug 9, 2011, at 3:47 AM, Devraj Mukherjee wrote: I am writing an API client for a REST service, parts of the REST API returns fixed String values. E.g. status of an order. I want to represents these fixed responses as constants. I have represented fixed numeric values using enums and

Re: Using #define a good way for String constants, like enums for NSIntegers?

2011-08-09 Thread Chris Hanson
On Aug 9, 2011, at 10:10 AM, Gregory Weston wrote: I'm still generally in favor of named constants over pre-processor substitution. Gives you types and no worry about parentheses. You can also use the global constant in the debugger (including in command completion) because it has a symbol

Re: Making NSCache evict only unreferenced objects

2011-06-17 Thread Chris Hanson
On Jun 17, 2011, at 9:40 AM, Jens Alfke wrote: Basically this is a cache of database records, where the dictionary key is the primary key and the value is a parsed version of the row data. I want to cache these to minimize database calls. I also want to ensure that the value objects are

Re: ObjC stdin equivalent? and other questions

2011-06-10 Thread Chris Hanson
On Jun 10, 2011, at 7:56 PM, William Squires wsqui...@satx.rr.com wrote: Hi! 1st question: In the future, please just start a separate thread for separate questions. Thanks! -- Chris ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: How to extract files from zip archive?

2011-05-30 Thread Chris Hanson
On May 30, 2011, at 8:45 AM, Vyacheslav Karamov wrote: NSString * listsPath = STR_ADDPATH([[NSBundle mainBundle] resourcePath], @lists.zip); What is STR_ADDPATH? There's already Cocoa API for what it looks like it does: NSString *listsPath = [[NSBundle mainBundle] pathForResource:@lists

Re: A Return NSString Problem

2011-05-29 Thread Chris Hanson
On May 29, 2011, at 8:19 PM, Bing Li lbl...@gmail.com wrote: + (NSString *) Read:(NSString *)xml Path:(NSString *)xPath You need to start following the Cocoa naming and other conventions. They may be different than what you're used to, but it will help you a lot in the long term to write code

Re: Communicate Between CocoaAsyncSocket and Java Socket

2011-05-07 Thread Chris Hanson
On May 7, 2011, at 1:50 PM, Bing Li wrote: I attempt to use CocoaAsyncSocket to communicate with Java server/client. Is it possible to achieve the goal? Yes, at least in the abstract; TCP is TCP. You don't need to use CocoaAsyncSocket if you don't want to - you can just use the BSD-level

Re: Threading synchronization: does a primitive exists?

2011-05-07 Thread Chris Hanson
The thing to remember about NSConditionLock is that it's a lock that can only be acquired when it's in the specified condition. So for example, the lock can start in condition 0. Thread B can lock when in condition 0 while thread A can simultaneously lock when the condition is 1. This means

Re: Programming Context Menu

2011-04-04 Thread Chris Hanson
On Apr 4, 2011, at 12:38 PM, Bing Li lbl...@gmail.com wrote: if (nil == defaultMenu) { @synchronized(self) { if (nil == defaultMenu) Don't do this. I don't mean just in Cocoa either, I mean don't do it ever. It's an

Error reporting in Cocoa (was Re: Exception not being caught)

2011-03-21 Thread Chris Hanson
On Mar 21, 2011, at 2:19 PM, Rick Mann wrote: You can't currently throw an exception across a forwarded call. When the exception unwinder hits the forwarding frame, it stops and the exception goes uncaught. You'll need to put your exception handler at a different level. Hrm. This is

Re: SDK 10.6 with Target 10.5

2011-03-13 Thread Chris Hanson
On Mar 13, 2011, at 4:19 PM, Leonardo wrote: on Xcode 4.0, I have noticed, just accidentally, that when the Base SDK is set to Mac OS X 10.6 and the deployment target to 10.5, I don't get any alert about the use of not-available-APIs. This is how the Base SDK and Deployment Target build

Re: how to redraw a view

2010-11-26 Thread Chris Hanson
On Nov 24, 2010, at 9:50 AM, Artemiy Pavlov artemiy.pav...@ukrpost.ua wrote: I have a view whose drawRect method draws a plot according to a few parameters which are global variables. When I change these variables according to the user input, I want to update that plot, so I need the

Re: Core data fetch and multithreading

2010-11-23 Thread Chris Hanson
On Nov 23, 2010, at 12:38 PM, vincent habchi vi...@macports.org wrote: However, I have now a repeated memory management crash when I release the moc (apparently, one managed object get released one time too much: it is destroyed in the main MOC, while the secondary MOC has a copy of it. When

Re: Core data fetch and multithreading

2010-11-22 Thread Chris Hanson
On Nov 21, 2010, at 11:47 AM, vincent habchi vi...@macports.org wrote: briefly speaking, I have a Core Data Entity bearing a to-many relationship (therefore an NSSet * iVar). A dialog on the main thread can modify this set, while it may be simultaneously enumerated on a background GCD

Re: Core data fetch and multithreading

2010-11-22 Thread Chris Hanson
On Nov 22, 2010, at 1:08 PM, Quincey Morris quinceymor...@earthlink.net wrote: On Nov 22, 2010, at 07:58, Hunter Hillegas wrote: I think someone somewhere told me that if you create a MOC on the main thread, there's some special runloop integration that is included, hence one of the

Re: unit test exit's abnormally with code 5

2010-11-19 Thread Chris Hanson
I suspect what’s going on is that your unit tests are built non-GC, but the framework you’re linking against is GC-only. You’ll need to enable GC for your unit tests too, if you want to test a GC-only framework; Objective-C garbage collection is on a per-process not per-binary basis. --

Re: How to create secondary Thread that listens to event taps?

2010-10-19 Thread Chris Hanson
On Oct 19, 2010, at 12:41 PM, Rainer Brockerhoff wrote: A too-low value will make your thread activate too often (making it use more CPU when idle) and a too-high value will make it too slow to react to condition being set to NO. I usually set something between 0.5 and 1; it's optimal in

Re: NSOutline and NSTreeController using bindings

2010-10-15 Thread Chris Hanson
. Hrishi On 13-Oct-2010, at 12:43 AM, Chris Hanson wrote: This implies that you’re not manipulating your “myListRoot” property in a way compliant with Key-Value Observing. Just manipulating the instance variable will not post KVO notifications for the property. You need to manipulate

Re: NSOutline and NSTreeController using bindings

2010-10-12 Thread Chris Hanson
This implies that you’re not manipulating your “myListRoot” property in a way compliant with Key-Value Observing. Just manipulating the instance variable will not post KVO notifications for the property. You need to manipulate the property (for example, by working with the proxy

Re: I want a window's file owner that's not a NSWindowController

2010-09-28 Thread Chris Hanson
On Sep 28, 2010, at 10:47 AM, Shawn Bakhtiar wrote: Question, why not just derive the camera class from NSWindow? A camera is not a different kind of window. The only significant reason to subclass NSWindow is to create a new kind of window - not a window for a specific task. There is no

Re: [ANN] Release: NanoStore 1.0 for Mac and iOS

2010-09-23 Thread Chris Hanson
On Sep 22, 2010, at 11:39 PM, Tito Ciuro wrote: I believe (please correct me if I'm wrong) that Core Data stores the data atomically for both, XML and binary formats. That, if I'm not mistaken requires the datafile to be read in memory. Not so with NanoStore: Not really so with Core Data

Re: What's the point of @properties?

2010-09-20 Thread Chris Hanson
On Sep 20, 2010, at 3:30 AM, Stefan Nobis wrote: Bill Bumgarner b...@mac.com writes: Thus, with the latest bleeding edge compiler, all you need is the @property() (and cleanup in -dealloc) to declare a fully KVO compliant attribute of your class. Is this also supported by the debugger?

Re: What's the point of @properties?

2010-09-20 Thread Chris Hanson
On Sep 19, 2010, at 12:52 PM, Jim Thomason wrote: I'm refactoring and updating a lot of my older code, and one of the things I'm finally looking into is declaring things as properties. But...what's the point? I've been trying to read up on the subject and have found a lot of posts and

Re: Question about architecture

2010-09-11 Thread Chris Hanson
On Sep 9, 2010, at 7:32 AM, Daniel Lopes wrote: My idea for organization is separate the entire content on the left side in a new Nib called sidebar and set the FileOwner to a controller in Window Nib. Also do the same thing for the right part of the Split View. That behavior the behavior

Re: Core Data and REST

2010-08-29 Thread Chris Hanson
On Aug 28, 2010, at 10:00 AM, Andy Bell andy.b...@allbabel.com wrote: At a later date I want to use something like REST using JSON to be the backend to Core Data in the application. Is this going to be possible? Core Data only has API for creating your own atomic persistent stores - that

Re: Erratic Cocoa Behavior

2010-08-17 Thread Chris Hanson
Are you using threads, operations or queues (dispatch)? — Chris On Aug 16, 2010, at 8:14 PM, k...@highrolls.net wrote: Thanks. I am not doing any Quartz debug, so I rule that out. I have nothing set in info.plist for NSShowAllDrawing. -koko On Aug 16, 2010, at 8:16 PM, John C.

Re: Array controllers in code?

2010-07-23 Thread Chris Hanson
On Jul 22, 2010, at 1:15 PM, Quincey Morris quinceymor...@earthlink.net wrote: Incidentally, if you're dealing with currency, it's better to use integers (the number of cents, rather than the number of dollars, essentially) rather than floating point. Actually, the OP has said that her data

Re: Sanity Check

2010-07-07 Thread Chris Hanson
On Jul 7, 2010, at 1:25 PM, k...@highrolls.net wrote: Ok that was my concern. I am not assigning [[SewAndColorController alloc] init...] into a variable ergo I thought I should [self retain] and the release it when the panel is closed. Better style would be to still assign the new instance

Re: merging NSWindow and NSView controllers

2010-06-19 Thread Chris Hanson
What kind of drawing in their NSView do these controllers do right now? Perhaps that code should be in an NSView subclass and that subclass should be used in both controllers' nibs. -- Chris On Jun 19, 2010, at 4:58 PM, Shane software.research.developm...@gmail.com wrote: I have an

Re: six things I wasn't able to do with Cocoa

2010-05-29 Thread Chris Hanson
On May 27, 2010, at 12:43 PM, Bill Appleton wrote: *5)** **I **can't create a simple list* I did it the only way I could -- with a table that has one column, etc. Man that was painful for a simple list. Is there a better way? In what way did you find creating an NSTableView with one column

Re: Loading iPhone bundle in Mac OS X application

2010-05-05 Thread Chris Hanson
You're thinking of otool, not otest. OCUnit's otest does load bundles, but it doesn't open (say) ARM bundles on Intel-based Macs. You can't load a bundle for one platform on another. They're different platforms... -- Chris On May 5, 2010, at 1:10 PM, Bill Bumgarner b...@mac.com wrote:

Re: converting resources, icons, and dialogs to interface builder

2010-05-04 Thread Chris Hanson
On May 4, 2010, at 12:51 PM, Jens Alfke j...@mooseyard.com wrote: On May 4, 2010, at 7:34 AM, Bill Appleton wrote: i am converting many rsrc dialogs from carbon to cocoa (DITL, DLOG) is there any automatic tool for converting a dialog to interface builder? I would ask on carbon-dev, since

Re: CoreData in predicate

2010-05-02 Thread Chris Hanson
On May 2, 2010, at 6:03 AM, Rick Mann wrote: I saw that, I had hoped that by not specifying an attribute, it would mean the object itself, not an attribute on the object. Predicates have the “self” keyword for that. — Chris ___ Cocoa-dev

  1   2   3   >