Core Data: How to find the NSPersistentStore of a managed object

2009-09-13 Thread Peter Ferrett
Hi, I have a model that comprises two stores. 1. A read only store of a large data-set (this is read only as it is a public dataset shared among users) and 2. A read-write store that is the result of creation by user actions. One of my managed objects can belong to either store. Du

How to determine if a PDFPage is image based? (A scanned page)

2009-09-13 Thread DairyKnight
Hi all, Is there a way to determine if a PDFPage contains only a picture? There seems to be plenty of routines for rendering/drawing in Core Graphics, but none for extracting PDF information? Regards, Dairyknight ___ Cocoa-dev mailing list (Cocoa-dev@l

Re: How to determine if a PDFPage is image based? (A scanned page)

2009-09-13 Thread Antonio Nunes
On 13 Sep 2009, at 13:01, DairyKnight wrote: Is there a way to determine if a PDFPage contains only a picture? There seems to be plenty of routines for rendering/drawing in Core Graphics, but none for extracting PDF information? You need to parse and analyse the page streams. Look up the d

CoreData multiple contexts and threads

2009-09-13 Thread malcom
Hello, I have a stream of data (some messages) from a socket and I need to save it in a CoreData db. I would to optimize this thing by using more than a managedobjectcontext for each N messages arrived. The problem is that I need to link these message between (parent/childs). How can I check if a m

Re: NSString and UIWebView load

2009-09-13 Thread Jens Alfke
The crash log shows the crash is in a background thread running Data Detectors code: Thread 3 Crashed: 0 libobjc.A.dylib 0x93ca268c objc_msgSend + 28 1 CoreFoundation 0x30288bb4 __CFSTUnitWordSentenceLineSetString + 1204 2 DataDetectorsCore

Re: KVO can be unsafe in -init?

2009-09-13 Thread John Chang
On 13 sep 2009, at 05.33, Jerry Krinock wrote: I'd be interested to know how John is going to fix this problem. I myself have used the performSelector:withObject:afterDelay:0.0 solution in situations like this I think the problem really only happens with the NSKeyValueObservingOptionIni

CoreData Bug? (SQLite vs XML)

2009-09-13 Thread Milen Dzhumerov
Hi all, I've been trying to track down a bug and it *seems* that it might be CoreData's fault (I highly doubt it but there's a small chance). I have the following configuration: - A base class, let's call it Base - A subclass of Base, let's call it Subclass Subclass has a to-many relationsh

Re: Core Data: How to find the NSPersistentStore of a managed object

2009-09-13 Thread Mike Abdullah
[[foo objectID] persistentStore]; Note that this only applies to saved objects which have been persisted to a store (or maybe have had a persistent ID generated?). Sadly I don't think there's any API for knowing which store an object will be assigned to when saved, short of calling -assignO

Grand Central Dispatch vs CFRunLoop

2009-09-13 Thread Filip van der Meeren
Good evening, I am using NSTask objects in a Command Line Tool project, to be able to intercept notifications I need a runloop to the best of my knowledge. And ever since I installed Mac OS X 10.6, I wondered if I could replace that entire runloop by a dispatch_queue. Does anyone know how

Re: CoreData Bug? (SQLite vs XML)

2009-09-13 Thread mmalc Crawford
On Sep 13, 2009, at 9:14 AM, Milen Dzhumerov wrote: -(void)awakeFromFetch { for(id base in [self relationship]) Log(@"%@", base); ... } awakeFromFetch [...] Important: Subclasses must invoke super’s implementation before performing their own initialization.

Re: CoreData Bug? (SQLite vs XML)

2009-09-13 Thread Milen Dzhumerov
On 13 Sep 2009, at 17:45, mmalc Crawford wrote: On Sep 13, 2009, at 9:14 AM, Milen Dzhumerov wrote: -(void)awakeFromFetch { for(id base in [self relationship]) Log(@"%@", base); ... } awakeFromFetch [...] Important: Subclasses must invoke super’s implementa

Bug: CalendarStore framework adding events with alarms with email address.

2009-09-13 Thread jon
I will be making a bug report for this, but this is here on the list to show that this can work, if you ignore the result displayed in iCal. If you have your address book filled out with your own card with your own email of for example "myem...@me.com", not other emails in your card. a

sprintf and 64-bit integers

2009-09-13 Thread slasktrattena...@gmail.com
Hi, I'm updating my code for Snow Leopard and ran into this problem. The app crashes at this line: sprintf(str, "%d", val); where val is a CFIndex. According to the string programming guide here... http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Strings/Articles/formatSpec

Re: sprintf and 64-bit integers

2009-09-13 Thread Bill Bumgarner
On Sep 13, 2009, at 10:59 AM, slasktrattena...@gmail.com wrote: I'm updating my code for Snow Leopard and ran into this problem. The app crashes at this line: sprintf(str, "%d", val); where val is a CFIndex. According to the string programming guide here... http://developer.apple.com/mac/li

Re: sprintf and 64-bit integers

2009-09-13 Thread slasktrattena...@gmail.com
On Sun, Sep 13, 2009 at 8:01 PM, Bill Bumgarner wrote: > On Sep 13, 2009, at 10:59 AM, slasktrattena...@gmail.com wrote: > I'm updating my code for Snow Leopard and ran into this problem. The >> >> app crashes at this line: >> >> sprintf(str, "%d", val); >> >> where val is a CFIndex. According to

Re: sprintf and 64-bit integers

2009-09-13 Thread Steve Christensen
On Sep 13, 2009, at 11:10 AM, slasktrattena...@gmail.com wrote: On Sun, Sep 13, 2009 at 8:01 PM, Bill Bumgarner wrote: On Sep 13, 2009, at 10:59 AM, slasktrattena...@gmail.com wrote: I'm updating my code for Snow Leopard and ran into this problem. The app crashes at this line: sprintf(str,

Re: sprintf and 64-bit integers

2009-09-13 Thread Clark Cox
On Sun, Sep 13, 2009 at 8:10 PM, slasktrattena...@gmail.com wrote: > On Sun, Sep 13, 2009 at 8:01 PM, Bill Bumgarner wrote: >> On Sep 13, 2009, at 10:59 AM, slasktrattena...@gmail.com wrote: >> I'm updating my code for Snow Leopard and ran into this problem. The >>> >>> app crashes at this line:

Re: sprintf and 64-bit integers

2009-09-13 Thread Greg Guerin
char str[10]; sprintf(str, "%d", val); What is the value of val at the time the crash occurs? Will it always convert to 9 digits or less? What value is sprintf() returning? You might want to use snprintf() or asprintf(). -- GG ___ Cocoa-dev

Re: sprintf and 64-bit integers

2009-09-13 Thread slasktrattena...@gmail.com
In this case val was exactly nine digits: 213294334. But it can also be greater sometimes. Sprintf() is returning the same value, using %d on 10.5. On Sun, Sep 13, 2009 at 8:21 PM, Greg Guerin wrote: >> char str[10]; >> sprintf(str, "%d", val); > > What is the value of val at the time the crash

Re: sprintf and 64-bit integers

2009-09-13 Thread Greg Guerin
Sprintf() is returning the same value, using %d on 10.5. I meant sprintf()'s returned int value, which is the count of formatted output chars, not including the trailing null. Read 'man sprintf'. Or just try the simple expedient: char str[80]; -- GG _

Re: sprintf and 64-bit integers

2009-09-13 Thread Jens Alfke
It would be best to convert all your sprintf calls to snprintf, which is a safer equivalent that won't overflow the buffer. If the value is too long to fit, it'll be truncated instead of overflowing and corrupting the stack. (This type of overflow is one of the main causes of security holes

Re: sprintf and 64-bit integers

2009-09-13 Thread slasktrattena...@gmail.com
On Sun, Sep 13, 2009 at 8:42 PM, Greg Guerin wrote: > Or just try the simple expedient: > >  char str[80]; > >  -- GG Right, it was a buffer overrun. Simple as that. Thanks guys! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not pos

Re: How to display AboutBox window in Agent Application

2009-09-13 Thread Nathan Kinsinger
On Sep 12, 2009, at 10:02 PM, cocoa learner wrote: Hi All, I have created an Agent Application using key - Application is agent (UIElement) = true in Info.plist file. Problem # 1). my AboutBox window is not getting displayed. Here is my code snippet - AppController.h @interface AppController

Mac Mini or iMac for Cocoa Development?

2009-09-13 Thread Michael Rogers
Hi, All: I've been given a short deadline for choosing between a Mac Mini or iMac for Cocoa development (especially iPhone apps) at a university that will remain nameless unless you read my signature :-) I am leaning towards iMacs, because these computers will serve as ambassadors as well

Re: Mac Mini or iMac for Cocoa Development?

2009-09-13 Thread Jesse Armand
Mac Mini with 4 GB of RAM is definitely enough to develop iPhone apps. The newest Mac Mini is already using NVIDIA graphics processor, Intel Core 2 Duo, and up to 320 GB HDD. You might need better Macs, if you're planning to build complex software like computer simulation with heavy graphics proc

CALayer renderInContext not rendering all sublayers

2009-09-13 Thread Christopher J Kemsley
Hi all, I've been unable to find anything on this through Google searches... I'm building for x86_64 on Snow Leopard. I have a window containing a view whose layer has two sublayers, set up like this: - (void)awakeFromNib { [self setWantsLayer:YES] ; points

Re: Mac Mini or iMac for Cocoa Development?

2009-09-13 Thread Jens Alfke
On Sep 13, 2009, at 12:53 PM, Michael Rogers wrote: I am leaning towards iMacs, because these computers will serve as ambassadors as well as development machines; I want to double-check that if we have to go to Mac Minis, say with 4 GB of RAM, we won't be waiting forever to compile a simp

Circular references

2009-09-13 Thread DKJ
I've got a MyViewController and a bunch of MySubview objects that are subviews of its view. I want MyViewController to keep track of certain things, such as the last MySubview that was clicked. So MySubview has to know about MyViewController to tell it it's been clicked; and MyViewControlle

Re: Circular references

2009-09-13 Thread Joar Wingfors
On 13 sep 2009, at 15.00, DKJ wrote: I've got a MyViewController and a bunch of MySubview objects that are subviews of its view. I want MyViewController to keep track of certain things, such as the last MySubview that was clicked. So MySubview has to know about MyViewController to tell it

Re: Circular references

2009-09-13 Thread Jay Reynolds Freeman
A classic (but non-traditionally-Cocoa) way to deal with this problem is with #ifndef preprocessor statements. You make up a preprocessor symbol for each include file -- I often use the include-file name in all capitals, with some "__"s bracketing it. Then you use it as follows. Suppose

Re: Circular references

2009-09-13 Thread Kyle Sluder
This does not solve the problem at hand (two interfaces need a declaration of each other's symbols). The mechanism you describe is obsoleted by #import. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: Circular references

2009-09-13 Thread Kyle Sluder
We already know the cause and the solution: MyViewController.h imports MySubview.h, and MySubview.h imports MyViewController.h. The standard C header preprocessor trick does not help in this situation, and neither does import. The solution is to use a forward declaration. For ObjC classes t

Re: Mac Mini or iMac for Cocoa Development?

2009-09-13 Thread Paul Bruneau
The iMac is so much prettier plus can drive a second display. Refurb store = $999 or even sometimes $849 ones show up. On Sep 13, 2009, at 3:53 PM, Michael Rogers wrote: Hi, All: I've been given a short deadline for choosing between a Mac Mini or iMac for Cocoa development (especially iPho

Re: Mac Mini or iMac for Cocoa Development?

2009-09-13 Thread Kyle Sluder
On Sep 13, 2009, at 4:28 PM, Paul Bruneau lite.com> wrote: The iMac is so much prettier plus can drive a second display. Refurb store = $999 or even sometimes $849 ones show up. Ooh, that brings up an important point: if you decide to go the refurb route on a Mini, make sure that it has a C

NSCell setControlSize:NSSmallControlSize doesn't show change

2009-09-13 Thread BareFeet
Hi all, I'm programmatically building an NSTable. I add columns in a loop and am trying to set various attributes. All of it works except setControlSize:NSSmallControlSize. When I get the value after setting (ie using controlSize), it seems to have changed, but the actual cell/ column is s

Shark newbie needs help with perf-opt

2009-09-13 Thread Randall Meadows
I'm trying to optimize an iPhone app. I have dozens of objects (as many as 60 at a time) moving around the screen at once. Under certain conditions, these objects will collide, and during these collisions, the rest of the objects (the ones not involved in the collisions) slow down noticea

adding a page curl transition

2009-09-13 Thread Matt Neuburg
My extremely simple Core Data app represents a bunch of "flashcards", shown one at a time; in other words, I change the selected entity and presto, a different card's contents are displayed in the various fields of my single window. I'm thinking it would be cute to add a page curl transition, so t

Re: Mac Mini or iMac for Cocoa Development?

2009-09-13 Thread Ryan Thompson
Hey Jesse, Just my two bits -- I've been writing Cocoa apps on a lowly Mac Mini with only 1GB of RAM -- and while a little slow it's more than enough for me to create and test my apps. You should be able to rock the casba on a Mini with 2GB RAM or more! However, my domain of interest is

Re: Mac Mini or iMac for Cocoa Development?

2009-09-13 Thread Graham Cox
On 14/09/2009, at 5:53 AM, Michael Rogers wrote: I am leaning towards iMacs, because these computers will serve as ambassadors as well as development machines; I want to double-check that if we have to go to Mac Minis, say with 4 GB of RAM, we won't be waiting forever to compile a simple

Re: adding a page curl transition

2009-09-13 Thread Graham Cox
On 14/09/2009, at 1:31 PM, Matt Neuburg wrote: My question is simply this: what's the best strategy for implementing this? Unlike the Reducer tab view example, I don't have a view in advance representing the future state of the window (i.e. what it will look like after the transition). I'm

Re: Mac Mini or iMac for Cocoa Development?

2009-09-13 Thread Kyle Sluder
You will be far more likely to run into overheating issues if you want to take advantage of OpenCL. If your work will benefit from parallelization of floating point operations (as a lot of academic work does, especially anything that reduces to a system of linear equations), OpenCL is going

Re: Circular references

2009-09-13 Thread Henry McGilton (Boulevardier)
On Sep 13, 2009, at 4:17 PM, Kyle Sluder wrote: We already know the cause and the solution: MyViewController.h imports MySubview.h, and MySubview.h imports MyViewController.h. The standard C header preprocessor trick does not help in this situation, and neither does import. The solution

Re: Grand Central Dispatch vs CFRunLoop

2009-09-13 Thread Ken Thomases
On Sep 13, 2009, at 10:09 AM, Filip van der Meeren wrote: I am using NSTask objects in a Command Line Tool project, to be able to intercept notifications I need a runloop to the best of my knowledge. Don't confuse two different things. Notifications do not require a run loop in order to

re: CoreData multiple contexts and threads

2009-09-13 Thread Ben Trumbull
Hello, I have a stream of data (some messages) from a socket and I need to save it in a CoreData db. I would to optimize this thing by using more than a managedobjectcontext for each N messages arrived. The problem is that I need to link these message between (parent/childs). How can I check if a

re: CoreData Bug? (SQLite vs XML)

2009-09-13 Thread Ben Trumbull
I've been trying to track down a bug and it *seems* that it might be CoreData's fault (I highly doubt it but there's a small chance). I have the following configuration: - A base class, let's call it Base - A subclass of Base, let's call it Subclass Subclass has a to-many relationship to Base. He

testing ppc on intel

2009-09-13 Thread Chris Idou
Every program that I build universal but run on intel (OS 10.5) with "arch -ppc" option, crashes with a report like the following, and I've tested quite a few, even simple ones. Is it unreasonable to try to test ppc programs on intel, or am I doing something wrong, or what? Version:

Developing a Stand-Alone Service in Snow Leopard

2009-09-13 Thread Steve Cronin
Foks; I'm trying to develop a stand alone service in Snow Leopard. The issue I'm running into is how to update the system as I compile a new version. The pbs command shows that the bundle path is the one in my Release Build folder "pbs -dump_pboard" { NSBundleId

Re: Developing a Stand-Alone Service in Snow Leopard

2009-09-13 Thread John C. Randolph
On Sep 13, 2009, at 10:55 PM, Steve Cronin wrote: I have convinced myself that the only way to get Snow Leopard to recognize the newer version of the service is to log out and back in. This is tedious. Is there something I'm missing? As I recall, each app builds its services menu when it l

Re: Developing a Stand-Alone Service in Snow Leopard

2009-09-13 Thread Steve Cronin
John; That's good information but I don't see how it helps with a stand- alone service - how do I (or user) launch the .service bundle? Steve On Sep 14, 2009, at 1:12 AM, John C. Randolph wrote: On Sep 13, 2009, at 10:55 PM, Steve Cronin wrote: I have convinced myself that the only way