NSData from CGPDFPageRef

2010-05-20 Thread Christian Ziegler
Hi all, can anyone think of a way to get an NSData object out of a CGPDFPageRef? Cheers, Chris ___ 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

Re: NSData from CGPDFPageRef

2010-05-20 Thread Gustavo Pizano
Hello Christian This method was given to me yesterday by Jack Nutting... I dunno if its what you are looking for. On Wed, May 19, 2010 at 12:07 PM, Gustavo Pizano gustavxcodepic...@gmail.com wrote: Hello all. I would want to know if I can render pdf into iPad using quartz, or I have

Re: NSData from CGPDFPageRef

2010-05-20 Thread Christian Ziegler
Hi Gustavo, unfortunately that is not what I'm looking for. I want to be able to load an existing pdf file and create some byte representation of each page. Cheers, Chris On 20.05.2010, at 12:08, Gustavo Pizano wrote: Hello Christian This method was given to me yesterday by Jack

Re: Regarding MVC design pattern

2010-05-20 Thread Alexander Spohr
Am 19.05.2010 um 19:12 schrieb Kyle Sluder: On Wed, May 19, 2010 at 4:38 AM, Sherm Pendley sherm.pend...@gmail.com wrote: If you synthesize your ivars, you can get at the ivar using the self- syntax. self-myFoo = [aFoo retain]; [self-myFoo release]; Why not just using myFoo without

Re: Regarding MVC design pattern

2010-05-20 Thread Joanna Carter
Le 20 mai 2010 à 13:24, Alexander Spohr a écrit : Why not just using myFoo without the self-? To make it visible that you talk to an ivar? Yes, because the ivar is synthesised, addressing myFoo would send the release message to the property, which is not recommended. Apparently, self-myFoo

Re: Original iPhone animation performance

2010-05-20 Thread Rafael Cerioli
I would advise you to check the transparency in your image. Compositing is not a simple task to do. And with the Core Animation Instrument, you can see your FPS and you can color layers that are rendered offscreen. That might give you some clues. Rafael Cerioli Le 19 mai 2010 à 18:51,

Re: NSData from CGPDFPageRef

2010-05-20 Thread Kyle Sluder
On May 20, 2010, at 4:25 AM, Christian Ziegler chris.zieg...@me.com wrote: unfortunately that is not what I'm looking for. I want to be able to load an existing pdf file and create some byte representation of each page. This doesn't really make any sense. How is a PDF page meaningful

Re: Regarding MVC design pattern

2010-05-20 Thread Kyle Sluder
On Thu, May 20, 2010 at 5:44 AM, Joanna Carter cocoa...@carterconsulting.org.uk wrote: Le 20 mai 2010 à 13:24, Alexander Spohr a écrit : Yes, because the ivar is synthesised, addressing myFoo would send the release message to the property, which is not recommended. No. Send the release

[iPhone] How to scale a UITextView Properly with typing text shown

2010-05-20 Thread Tharindu Madushanka
I use following code in UITextView Delegate method to resize the text view. I want it to look like iPhone Messages. Still this doesn't show the already typed text on top. I mean it doesn't scroll to the correct typing position in text view. Could anyone kindly correct this code ? To scroll the

Re: Simulating Text Input

2010-05-20 Thread Flavio Donadio
Paul and Eiko, I just checked OSXvnc's source code. Their code led me to the right place, but it's fairly complex for a beginner (like myself) to learn how to post keyboard events (generate keystrokes or simulating keyboard input). The functions needed for this are in Quartz / Core Graphics.

Re: NSData from CGPDFPageRef

2010-05-20 Thread Christian Ziegler
Thanks for your reply Kyle! Well, I don't know the exact data structure of pdfs but I'm just figuring it out step by step. Anyways, what I am trying to achieve is, to create a kind of fingerprint of a pdf page and it should be as performant as possible and as platform independent as possible

Re: Simulating Text Input

2010-05-20 Thread Eiko Bleicher
Sure, CGEventCreateKeyboardEvent was the first obvious way (and probably the one I'll stick with). Just be warned that the codes are different for each keyboard layout, so already the stock code CGEventRef event1, event2, event3, event4; event1 = CGEventCreateKeyboardEvent (NULL,

Binding CoreData Managed Object to NSTextFieldCell subclass

2010-05-20 Thread Nial Giacomelli
I have an NSTableView which has its first column set to contain a custom NSTextFieldCell. My custom NSTextFieldCell needs to allow the user to edit a desc property within my Managed Object but to also display an info string that it contains (which is not editable). To achieve this, I followed this

Re: Regarding MVC design pattern

2010-05-20 Thread mmalc Crawford
On May 19, 2010, at 4:38 am, Sherm Pendley wrote: If you set the ivars directly, as above, the synthesized setters will NOT be called. For that to happen, you need to use dot-syntax, like this: - (void) dealloc { self.beginButton = nil; self.endButton = nil; // etc...

Re: Regarding MVC design pattern

2010-05-20 Thread mmalc Crawford
On May 19, 2010, at 1:48 am, Sai wrote: 1. Look at the awakeFromNib method of Controller, my output of the retain count to the console are myModel retain count: 5 controller retain count: 17 both number are very surprised me, why is that? I suppose they should be 2 or 1? Can anyone

Changing the view that's used for a print operation

2010-05-20 Thread Gideon King
It appears that when you create a print operation, it is directly associated with a view. In my print accessory, I can make changes that would make it much easier to render the data that the user is requesting by using a different view. Is there any way to change the view or maybe swap out the

Re: Regarding MVC design pattern

2010-05-20 Thread Thomas Davie
On 20 May 2010, at 15:24, mmalc Crawford wrote: On May 19, 2010, at 4:38 am, Sherm Pendley wrote: If you set the ivars directly, as above, the synthesized setters will NOT be called. For that to happen, you need to use dot-syntax, like this: - (void) dealloc { self.beginButton =

Re: Regarding MVC design pattern

2010-05-20 Thread Barry Skidmore
If you need to have it set you should create an initWithOptionName: and call that from your standard init, or return an error stating a missing value is needed. Your init should always call down tithe most specific init. Specific examples of this are available as best practice in several

Re: Regarding MVC design pattern

2010-05-20 Thread Thomas Davie
On 20 May 2010, at 15:45, Barry Skidmore wrote: If you need to have it set you should create an initWithOptionName: and call that from your standard init, or return an error stating a missing value is needed. Your init should always call down tithe most specific init. Specific

Re: Regarding MVC design pattern

2010-05-20 Thread Barry Skidmore
Ah I see. Not that I am aware of, in fact if you require a set property in your object then init is the best place for it to be. Sent from my iPhone On May 20, 2010, at 9:47 AM, Thomas Davie tom.da...@gmail.com wrote: On 20 May 2010, at 15:45, Barry Skidmore wrote: If you need to have

Re: Simulating Text Input

2010-05-20 Thread Flavio Donadio
Eiko, There's some code in OSXvnc that might help with this. Check this file: http://osxvnc.cvs.sourceforge.net/viewvc/osxvnc/OSXvnc/VNCBundle.m?revision=1.2view=markup It creates a keyTable with Unicode characters as indexes and CGKeyCodes as values, based on the selected keyboard layout.

Re: Regarding MVC design pattern

2010-05-20 Thread Kyle Sluder
On May 20, 2010, at 7:40 AM, Thomas Davie tom.da...@gmail.com wrote: Can I ask why you shouldn't use them in init? It makes a lot of sense to not use them in alloc/dealloc, but I'm not using them in init... after all, what if I replace the ivar with a derived property from another object?

Re: Simulating Text Input

2010-05-20 Thread Eiko Bleicher
Flavio, thanks! This should be a good starting point for the lookup table, it does what I wanted to do (at least it looks like it). :-) Eiko Am 20.05.2010 um 16:57 schrieb Flavio Donadio: Eiko, There's some code in OSXvnc that might help with this. Check this file:

Re: Regarding MVC design pattern

2010-05-20 Thread glenn andreas
On May 20, 2010, at 9:47 AM, Thomas Davie wrote: On 20 May 2010, at 15:45, Barry Skidmore wrote: If you need to have it set you should create an initWithOptionName: and call that from your standard init, or return an error stating a missing value is needed. Your init should always

Re: Regarding MVC design pattern

2010-05-20 Thread Dave Keck
I'll give you a concrete example. We have an NSController-like class that lives in a framework. Its designated intializer is -initWithContent:. In one of our apps, we have a subclass of this whose initializer is -initWithDocument:, and which uses the document to figure out its content. It

Re: Regarding MVC design pattern

2010-05-20 Thread Kyle Sluder
On Thu, May 20, 2010 at 8:27 AM, Dave Keck davek...@gmail.com wrote: Which could be solved with a simple if-statement within the subclass' -setContent:, allowing you to use accessors everywhere to avoid code duplication and giving your subclasses full control over the setting of the content

Re: Regarding MVC design pattern

2010-05-20 Thread Dave Keck
You can get away with a lot of things if you don't care about writing subclass-tolerant code. But since I don't have a crystal ball, I don't write code which I know will require hacky isInitialized flags to be correct. I'm not a fan of isInitialized either, but even less enthralled by

Re: Regarding MVC design pattern

2010-05-20 Thread Kyle Sluder
On Thu, May 20, 2010 at 9:27 AM, Dave Keck davek...@gmail.com wrote: I'm not a fan of isInitialized either, but even less enthralled by duplicated code. Furthermore, couldn't one make the case that a class that's well-fit for subclassing has exactly one technique for setting a property (the

Layer-hosting views and layer-backed scroll views

2010-05-20 Thread Kyle Sluder
We have a layer-hosting document view that is contained in a layer-backed scroll view. We have noticed that the scroll view does some funky stuff to the layer if the view's -isFlipped returns YES. This manifests itself in our app in the form of our document view being scrolled by the correct

Re: Regarding MVC design pattern

2010-05-20 Thread mmalc Crawford
On May 20, 2010, at 7:40 am, Thomas Davie wrote: However, you should typically not invoke accessor methods in init or dealloc methods. Can I ask why you shouldn't use them in init? It makes a lot of sense to not use them in alloc/dealloc, but I'm not using them in init... after all,

Re: Get controller from nib

2010-05-20 Thread James Maxwell
So, I decided to get rid of the NSArrayController, since it was driving me slightly crazy, and just do this manually. I've got the table **appearing** as I'd like it to, but I can't change the selection. There are 3 columns: 1) string, 2) NSPopUpButtonCell for MIDI ports, and 3)

Re: Layer-hosting views and layer-backed scroll views

2010-05-20 Thread Kyle Sluder
On Thu, May 20, 2010 at 9:52 AM, Kyle Sluder kyle.slu...@gmail.com wrote: I have uploaded a sample project to http://www.lanechng.com/ScrolledLayerHostingView.zip. Resize the window to see the problem in action; then click one of the scroll arrows to see it fix itself. Well, I've filed

How does NSSavePanel support UTIs?

2010-05-20 Thread James Walker
The Uniform Type Identifiers Overview claims that NSSavePanel supports UTIs, but the NSSavePanel class reference makes absolutely no mention of UTIs. What's up with that? I thought maybe there's be something like setAllowedFileTypes: but with UTIs instead of extensions. -- James W. Walker,

Re: Image from WebView is sometimes blank

2010-05-20 Thread Duncan Oliver
Thanks. I added the layout line, and that seems to have fixed it. I'll have to do some more testing, but so far, I haven't had the problem anymore. --- Duncan Oliver duncan.oli...@gmail.com On Fri, May 14, 2010 at 1:27 PM, Adam R. Maxwell amaxw...@mac.com wrote: On May 11, 2010, at 2:33 PM,

Listening for token deletion in NSTokenField

2010-05-20 Thread Duncan Oliver
Is there anyway to get some sort of notification for when a user deletes a token in a NSTokenField? That's to say, is there a way to know when a user has deleted a whole token when hitting the delete key once? I have a NSTokenField linked to a managed object's relationship, and need to nullify the

Re: How does NSSavePanel support UTIs?

2010-05-20 Thread Quincey Morris
On May 20, 2010, at 12:14, James Walker wrote: The Uniform Type Identifiers Overview claims that NSSavePanel supports UTIs, but the NSSavePanel class reference makes absolutely no mention of UTIs. What's up with that? I thought maybe there's be something like setAllowedFileTypes: but with

Re: semi modal view

2010-05-20 Thread B . J . Buchalter
Further to this, I have come up with appears to be a reasonable solution, but I would like to solicit feedback about the approach: Rather than insert a NSTextField directly, I am now inserting a NSView subclass (call it BJJCoverView) as a subview of the content view of the window. This

turning XMLString into XML nodes

2010-05-20 Thread Rainer Standke
Hello all, I am wondering how to turn XML string fragments into XMLNodes or XMLElements. So far, the only thing I have come up with is to create a new, temporary NSXMLDocument and detach the rootelement from it. This seems a little clunky... In the past I have used XMLLib in AppleScript, and

Displaying NSPopUpButtonCells in NSTableView

2010-05-20 Thread James Maxwell
I thought I'd change the topic on this, since the content really has changed. I have an table for setting up MIDI instruments with a name, port, and channel. I've got the initial display of options for the table row displaying correctly, and when I make changes to the name, port, and channel,

Re: Displaying NSPopUpButtonCells in NSTableView

2010-05-20 Thread Peter Ammon
On May 20, 2010, at 1:14 PM, James Maxwell wrote: I thought I'd change the topic on this, since the content really has changed. I have an table for setting up MIDI instruments with a name, port, and channel. I've got the initial display of options for the table row displaying correctly,

RE:EPS image in NSScrollView

2010-05-20 Thread jyoung79
I'm getting a little closer to figuring this out, but hope that someone can give me a little more info. I found some Apple documentation that shows how to programatically create an image in a scrollview. Below, I've included the code when the app starts up. I'd like to have the imageRect the

Re: Displaying NSPopUpButtonCells in NSTableView

2010-05-20 Thread James Maxwell
ah, that makes sense. I'll make the change and see if that fixes it. thanks, Peter. J. On 2010-05-20, at 1:28 PM, Peter Ammon wrote: On May 20, 2010, at 1:14 PM, James Maxwell wrote: I thought I'd change the topic on this, since the content really has changed. I have an table for

RE:EPS image in NSScrollView

2010-05-20 Thread jyoung79
One other quick question. What I'm really trying to achieve is something similar to how the pdfkit works. I like how the image/text enlarges within the scrollview when the window is resized. The code is pretty simple as well: [pdfView setDocument:[[[PDFDocument alloc] initWithData:[fileMan

Error 134100 - Core Data models incompatible

2010-05-20 Thread Brad Gibbs
Hi, I'm writing an iPad app with an OS X-based configuration utility. The user enters data in the OS X-based config utility and exports it. The iPad then picks up the SQLite file and uses it as its persistent store. This was working fine 2 months ago. I took a break on the iPad app to make

Re: Displaying NSPopUpButtonCells in NSTableView

2010-05-20 Thread James Maxwell
hmm... Well, I've tried returning the cell's selectedItem, indexOfSelectedItem, and also: [[inst MIDI_Inst_Ports] objectAtIndex:[ports indexOfSelectedItem]] (that is, the port name at indexOfSelectedItem). If I NSLog the [ports indexOfSelectedItem] it's always zero. So I'm obviously not

Re: Error 134100 - Core Data models incompatible

2010-05-20 Thread Fritz Anderson
On 20 May 2010, at 4:13 PM, Brad Gibbs wrote: Mac OS X 10.6.2, iPhone OS 4.0 beta 2 (although the iPad client started life before the first OS 4 beta was released). And here is why you won't get any answers. The NDA you agreed to in order to get the 4.0 SDK forbids you, and anyone who knows

migrating CoreData data model doesn't work

2010-05-20 Thread Rainer Standke
Hello, when I select my data model in the xcode project, and then select Design/Data Model/Add Model Version I do get a new bundle in Xcode project, but now copy of the existing datamodel. The bundle, both in Xcode and on the Finder level, is empty. The app does not compile any more. The only

Re: Error 134100 - Core Data models incompatible

2010-05-20 Thread eric dolecki GMail
Well said. Sent from my iPad On May 20, 2010, at 6:54 PM, Fritz Anderson fri...@manoverboard.org wrote: On 20 May 2010, at 4:13 PM, Brad Gibbs wrote: Mac OS X 10.6.2, iPhone OS 4.0 beta 2 (although the iPad client started life before the first OS 4 beta was released). And here is why

Calling allObjects memory allocation problem

2010-05-20 Thread Vassilis Pantazis
Hello, I have in my code the following statement: NSDirectoryEnumerator* dirEnum; NSArray* inDirContents; dirEnum = [[NSFileManager defaultManager] enumeratorAtPath:inPath]; // inPath is a valid path inDirContents = [dirEnum allObjects]; I have noticed that when the path

Re: Notifications on main thread

2010-05-20 Thread Jonny Taylor
- I could try acquiring the NSNotificationQueue for the main thread, but there does not appear to be a standard way of doing that. I have seen this suggested as a strategy elsewhere, but I think I have also read that one is not meant to post to queues other than that of the current thread

Re: iPhone/iPad: Desktop wallpaper can't be set.

2010-05-20 Thread Phil Hystad
I hope this feature is not supported. The last thing I want is some application changing my desktop background which is my choice, not one of the application. Yes, I know this can be done with some kind of dialog for approval but then that really stresses the logic of why you would want to do

Re: Adding Mutiple Lines to a UITableView

2010-05-20 Thread Shao Xianbiao
Hi, the following may be what you want: - (id) initWithStyle:(UITableViewStyle)style { [self.tableView setRowHeight:SOME_PROPER_HEIGHT]; . } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { . [cell.textLabel

NSWindowController for Prefs XIB Question (Core Data involved)

2010-05-20 Thread Steve Cronin
Folks; I have a feeling that this is an embarrassing one so try and go easy on me… XC 3.2.2 I have a main nib that opens a window and that works fine. I used to have an NSPanel in this nib to handle preferences. I've decided it's a good idea to split the nib into two different nibs: the main

View manipulation problem

2010-05-20 Thread ico
Hi All, I have a little iPhone app which has the following UI: 1. 2 buttons, use to manipulate my model object. 2. 2 switches, let's call them infoSwitch and optionSwitch respectively 3. A custom view, its subview includes 4 UILabel, those labels are used to display infomation of my model object.

Re: Calling allObjects memory allocation problem

2010-05-20 Thread Nick Zitzmann
On May 19, 2010, at 5:36 AM, Vassilis Pantazis wrote: Hello, I have in my code the following statement: NSDirectoryEnumerator* dirEnum; NSArray* inDirContents; dirEnum = [[NSFileManager defaultManager] enumeratorAtPath:inPath]; // inPath is a valid path inDirContents =

Re: EPS image in NSScrollView

2010-05-20 Thread Adam R. Maxwell
On May 20, 2010, at 1:43 PM, jyoun...@kc.rr.com wrote: One other quick question. What I'm really trying to achieve is something similar to how the pdfkit works. I like how the image/text enlarges within the scrollview when the window is resized. The code is pretty simple as well:

Re: Notifications on main thread

2010-05-20 Thread Adam R. Maxwell
On May 19, 2010, at 4:02 AM, Jonny Taylor wrote: I've noticed a slight issue (with both NSInvocation and NSOpQ) when a menu is pulled down and posting styles NSPostASAP or NSPostWhenIdle are used. While the menu is visible, the notifications are posted ok (on the main thread), but objects