How To Fully Test Cleanup Code Paths (iOS)?

2011-07-01 Thread Jeffrey Walton
Hi All, My apologies if this is more appropriate for another group. Please point me in the right direction. I'm interested in testing cleanup and shutdown code (this is a little different than 'save state in -didEnterBackground'). For example, MyViewController -viewDidUnload and -dealloc. From th

Re: key equivalents question

2011-07-01 Thread Jerry Krinock
On 2011 Jul 01, at 17:12, Brian Gardner wrote: > Is there something that I need to do, in addition to > setting the key equivalent in Interface Builder? No. > And why does that work for some choices of keys but not other choices? The short answer is: that's the way it is, and you need to rest

-[NSManagedObjectContext save:] takes 30 minutes, then crashes out of memory

2011-07-01 Thread Jerry Krinock
I have an app which writes a log to a Core Data SQLite store. I just got a Logs.sql file from a user. It is 270 KB, containing 1251 log entries. Upon launch, the app finds that 284 entries are expired and deletes them. Nothing out of the ordinary so far. App then executes -[NSManagedObjectC

Re: From a view rect to a screen rect

2011-07-01 Thread Andy Lee
On Jul 1, 2011, at 5:47 PM, Development wrote: > These don't seem to work. The origin is still way way way off > > > NSRect n1=[imageView convertRect:selection toView:nil]; > NSPoint p1 = [window convertBaseToScreen:n1.origin]; > > Does any one know how to take a selected area within

key equivalents question

2011-07-01 Thread Brian Gardner
Newbie, here... hope I'm posting to the correct list. In Interface Builder of Xcode 4, I set a key equivalent for my menu items. Sometimes they work, but sometimes they don't. What am I doing wrong? For Example, setting a key equivalent of command-6 for my View->Full Screen menu item works. But,

Re: From a view rect to a screen rect

2011-07-01 Thread Andy Lee
On Jul 1, 2011, at 4:52 PM, Lee Ann Rucker wrote: > http://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/6b989dcbb79e9ba/029eeb633c5287cc > > Quote: > If you want to convert to/from the window's base coordinate system, use the > original -convert[xx]:[to|from]View: and

Re: From a view rect to a screen rect

2011-07-01 Thread Development
These don't seem to work. The origin is still way way way off NSRect n1=[imageView convertRect:selection toView:nil]; NSPoint p1 = [window convertBaseToScreen:n1.origin]; Does any one know how to take a selected area within a view and translate it so that it resizes itself and t

Re: Getting Image from plist

2011-07-01 Thread Wayne Packard
Hi, What is stored in the "cover" object? If it's the name of a file that is bundled with the app, you can use cell.coverAuthor.image = [UIImage imageNamed:[[data objectAtIndex:index] objectForKey:@"cover"]]; If it's the name of a file stored on "disk" some place (e.g., the Application Suppor

Re: Getting Image from plist

2011-07-01 Thread Jens Alfke
On Jul 1, 2011, at 1:55 PM, Fernando Aureliano wrote: > cell.coverAuthor.image = [UIImage imageWithContentsOfFile:[data > objectAtIndex:index] objectForKey:@"cover"]; That’s not going to compile. You probably want the RHS to be: [UIImage imageWithContentsOfFile:[[data objectAtIndex:index] obj

Re: tableview, button with view and bindings

2011-07-01 Thread R
Quincey, Thanks! All now working as planned. I had to learn about tableview column identifiers to make sure I was adding the image to the correct column. Thanks again for taking the time to respond. Hopefully I'll soon be able to help more than beHelped! Have a great weekend -- Ron On Jul 1,

Re: From a view rect to a screen rect

2011-07-01 Thread Lee Ann Rucker
On Jul 1, 2011, at 1:14 PM, Andy Lee wrote: > On Jul 1, 2011, at 2:43 PM, Development wrote: >> I have tried having the view itself use convertRectToBase passing the screen >> bounds. > > That method doesn't do what you think it does. The docs say pretty clearly > you should pass it a rect "in

Getting Image from plist

2011-07-01 Thread Fernando Aureliano
Hi, I'm reading data from an plist, and I'm having problems for get the image. The code for text look like this: cell.auhorLabel.text = [[data objectAtIndex:index] objectForKey:@"author"]; Works fine. The code to get a image em put in uiimageview look like this: cell.coverAuthor.image = [UII

Re: From a view rect to a screen rect

2011-07-01 Thread Andy Lee
On Jul 1, 2011, at 2:43 PM, Development wrote: > I have tried having the view itself use convertRectToBase passing the screen > bounds. That method doesn't do what you think it does. The docs say pretty clearly you should pass it a rect "in the receiver’s coordinate system". This is a method of

Re: From a view rect to a screen rect

2011-07-01 Thread Jeff Kelley
UIView has some convenience methods you can use to convert a CGRect to and from different views’ coordinate systems. Look at the documentation for -convertRect:fromView:

From a view rect to a screen rect

2011-07-01 Thread Development
I am sure I am missing something simple but I've tried everything I can find I need to convert a rectangle in a NSView to a corresponding rectangle in screen coordinates. originally I was using this code: selected.origin.x = selection.origin.x / ([imageView frame].size.width/

Re: Windows cryptography

2011-07-01 Thread Daniel Wambold
Hello. After further pain, I found the solution: openSSL allows -K (for the key in hex) and -iv (for the initialization vector in hex). (BOTH must be supplied if -K is used.) Consider this thread closed. Thanks to those who assisted. -Dan___ Cocoa-dev

How to tell if NSServices launched my app

2011-07-01 Thread Mark Munz
Is there any way to know (at app startup) if my app's launch was initiated because a user invoked one of my NSServices items? Any insight into this would be much appreciated. -- Mark Munz unmarked software http://www.unmarked.com/ ___ Cocoa-dev mailing

Re: Placing NSComparator into Dictionary

2011-07-01 Thread Jens Alfke
On Jul 1, 2011, at 5:50 AM, Appa Rao Mulpuri wrote: > Is there any way to put the NSComparator pointers into Dictionary? I have > tried put NSValue using [NSValue valueWithPointer:] , but giving me nil in > get operation. An NSComparator is a type of block, and blocks can be directly used as Ob

Re: Instance Variables of NSManagedObject Subclasses

2011-07-01 Thread Jerry Krinock
On 2011 Jun 30, at 15:36, Allen Ingling wrote: > Am I not supposed to add instance variables to NSManagedObject sublcasses? There is no problem in adding instance variables to NSManagedObject subclasses. I have done so many times. ___ Cocoa-dev mai

Re: tableview, button with view and bindings

2011-07-01 Thread Quincey Morris
On Jul 1, 2011, at 07:33, R wrote: > throwing exceptions when the binding controller key is > "arrangeObjects". Note that all other data is using arrangedObjects > fine. But, placing an image on the button with this config is > failing. > > I can get an image to display using the "selection" co

Re: CIImage directly to CALayer contents?

2011-07-01 Thread David Duncan
On Jul 1, 2011, at 3:16 AM, Oleg Krupnov wrote: > Now suppose that I have a CIImage constructed with +imageWithContentsOfURL. > The image is loaded (lazily) directly to VRAM. Not quite. There is still a trip through RAM that is necessary to get to VRAM (basically it is nearly impossible to go d

Re: Windows cryptography

2011-07-01 Thread Jeffrey Walton
On Fri, Jul 1, 2011 at 7:30 AM, Daniel Wambold wrote: > Hello. I have an iPhone app (SDK 4.3) that uses symmetric key encryption (AES > 256, through the CommonCrypto library). I have the parameters set to use > pkcs7 padding, and an iv of all zeros (CBC mode). My question (somewhat off > the li

Re: How Do I get informed when -showHelp: has been called?

2011-07-01 Thread Matt Neuburg
On Wed, 29 Jun 2011 16:06:36 +0100, Angus Hardie said: > >On 29 Jun 2011, at 14:22, Ulf Dunkel wrote: > >> Am 27.06.2011 22:58, schrieb Ulf Dunkel: >>> In a simple app of mine, I use the standard Help menu and MyApp Help >>> menu item, which is bound to -showHelp:. >>> >>> I would like to have m

Re: tableview, button with view and bindings

2011-07-01 Thread R
throwing exceptions when the binding controller key is "arrangeObjects". Note that all other data is using arrangedObjects fine. But, placing an image on the button with this config is failing. I can get an image to display using the "selection" controller key. But of course the wrong image will

Re: Windows cryptography

2011-07-01 Thread Daniel Wambold
OpenSSL is available for Windows, but I can't see how to feed it an encryption key, just a passphrase which is (apparently) converted to a key. However, since CommonCrypto's CCCrypt uses the key directly, that's what I've got. I'll check Cygwin out. Thanks. (Anyone know how to feed OpenSSL a key

Re: tableview, button with view and bindings

2011-07-01 Thread R
Thanks. I'm currently displaying an image with success. I want to use a button and an image instead. I did what you said and am covered up with errors. Will dig deeper. Much thanks On Jul 1, 12:44 am, Quincey Morris wrote: > On Jun 30, 2011, at 23:13, R wrote: > > > Can anyone give me some g

Placing NSComparator into Dictionary

2011-07-01 Thread Appa Rao Mulpuri
Is there any way to put the NSComparator pointers into Dictionary? I have tried put NSValue using [NSValue valueWithPointer:] , but giving me nil in get operation. Apparao Mulpuri This email is sent for and on behalf of Ivy Comptech Private Limited. Ivy Comptech Private Limited is a limited lia

Re: Quicklook thumbnails vs previews, API for previews?

2011-07-01 Thread Mike Abdullah
Have a look at QLPreviewPanel. On 30 Jun 2011, at 07:04, Oleg Krupnov wrote: > Hi, > > The QuickLook API documentation defines and contrasts "thumbnails" and > "previews", but all I see on the client side is the only function > QLThumbnailImageCreate. I assume this is for creating "thumbnails",

Re: [Q] Will the be any problem in implementing an NSArray method using fast enumeration?

2011-07-01 Thread Mike Abdullah
On 30 Jun 2011, at 22:41, Quincey Morris wrote: > > On Jun 30, 2011, at 13:51, JongAm Park wrote: > >> The rationale behind "enumerator" pattern is to unify the way to access >> collection classes no matter what they actually look like. >> So, enumerator pattern is actually written in index ba

Re: [Q] Will the be any problem in implementing an NSArray method using fast enumeration?

2011-07-01 Thread Mike Abdullah
On 1 Jul 2011, at 12:59, Gregory Weston wrote: > Dave DeLong wrote: > >> You can just do: >> >> NSArray *objectsArray = [theArray valueForKey:key]; >> >> And it'll do pretty much the same thing (except that it'll call >> -valueForKey: on each item in the array, and not objectForKey:. However

Re: [Q] Will the be any problem in implementing an NSArray method using fast enumeration?

2011-07-01 Thread Gregory Weston
Dave DeLong wrote: > You can just do: > > NSArray *objectsArray = [theArray valueForKey:key]; > > And it'll do pretty much the same thing (except that it'll call -valueForKey: > on each item in the array, and not objectForKey:. However, if the objects > are NSDictionaries, that's pretty much

Re: Windows cryptography

2011-07-01 Thread Jeff Kelley
I would have a look at what's available through Cygwin. With any luck something like OpenSSL is available and has the features you're looking for. Jeff Kelley On Friday, July 1, 2011, Daniel Wambold wrote: > Hello. I have an iPhone app (SDK 4.3) that uses symmetric key encryption (AES > 256, th

Windows cryptography

2011-07-01 Thread Daniel Wambold
Hello. I have an iPhone app (SDK 4.3) that uses symmetric key encryption (AES 256, through the CommonCrypto library). I have the parameters set to use pkcs7 padding, and an iv of all zeros (CBC mode). My question (somewhat off the lists's topic, I'm afraid) is that I need to help our IT people g

CIImage directly to CALayer contents?

2011-07-01 Thread Oleg Krupnov
Hi, I'm a little shaky in this area, so I beg your pardon. CALayer has a "contents" property which is a CGImageRef, i.e. a Core Graphic image. CGImages are stored in RAM. CALayer is built on top of OpenGL and uses VRAM to store its bitmap image internally (a texture). Now suppose that I have a

Re: How to cancel an asynchronous GCD block?

2011-07-01 Thread Oleg Krupnov
>> I am migrating my code to use GCD blocks instead of NSOperations. > > Why? I should have said, I'm writing a new app and I am migrating my knowledge of implementing multi-threading from NSOperation to GCD :) (And I should say, I'm beginning to like the easiness of GCD, even though I was initia

Re: How to cancel an asynchronous GCD block?

2011-07-01 Thread Ken Thomases
On Jul 1, 2011, at 2:54 AM, Oleg Krupnov wrote: > I am migrating my code to use GCD blocks instead of NSOperations. Why? > But this seems a bit clunky (compared to the elegance of GCD code), It's pretty much your only option. GCD doesn't have a notion of canceling a task, so you can only set

Re: How to cancel an asynchronous GCD block?

2011-07-01 Thread Charles Srstka
On Jul 1, 2011, at 2:54 AM, Oleg Krupnov wrote: > But this seems a bit clunky (compared to the elegance of GCD code), > and also I'm not sure if it will be thread-safe to set m_isCancelled > from the main thread, while the async block may be racing to query it > (though it should be fine, setting

How to cancel an asynchronous GCD block?

2011-07-01 Thread Oleg Krupnov
Hi, I am migrating my code to use GCD blocks instead of NSOperations. NSOperation has a -cancel method to thread-safely notify the NSOperation thread that it needs to be canceled. How do you do this for an async GCD block? I.e. suppose I have the following code: @implementation MyClass - (void

RE: How to get the applicaiton name that loads bundle

2011-07-01 Thread Chen, Jeff (SDCC)
Dear Scott, Thank you so much! mainBundle() works well. Best Regards Jeff Chen -Original Message- From: Scott Ribe [mailto:scott_r...@elevated-dev.com] Sent: Friday, July 01, 2011 2:46 PM To: Chen, Jeff (SDCC) Cc: 'cocoa-dev@lists.apple.com' Subject: Re: How to get the applicaiton name t