Re: Strange NSFileManager file replacement issue

2011-08-19 Thread Ken Thomases
On Aug 19, 2011, at 12:43 AM, Ken Thomases wrote:

 On Aug 19, 2011, at 12:38 AM, Ken Thomases wrote:
 
 Although it is easy to interpret a temporary directory as provided by the 
 OS being compatible with NSTemporaryDirectory(), I suspect it really means 
 a directory returned by 
 -URLForDirectory:inDomain:appropriateForURL:create:error: with 
 NSItemReplacementDirectory passed for the directory and your ultimate 
 destination URL passed for the url parameter.
 
 Hmm.  Didn't follow the link to StackOverflow early enough.  Post there 
 claims it was tried and didn't help.

Sorry to reply to myself twice, but the StackOverflow post passed NO for the 
shouldCreate parameter of -URLForDirectory:...  It's worth trying with YES.

The other thing to try is the suggestion from the -replaceItemAtURL: docs for 
newItemURL.  Use a uniquely named directory placed in the same directory as 
the original item if the temporary directory is not available.

Regards,
Ken

___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSCache objects not being collected under GC?

2011-08-19 Thread jonat...@mugginsoft.com

On 19 Aug 2011, at 03:26, Nick Zitzmann wrote:

 Short version: Have any of you ever used NSCache in a GC-enabled app? If so, 
 then how did you get the garbage collector to collect them?
 
 Long version: I have a framework that is used in a traditional retain-release 
 app and a different GC-enabled app. The framework creates NSCache objects for 
 storage of throw-away objects, and stores these NSCache objects in a 
 CFDictionaryRef. At some point, the CFDictionaryRef is instructed to remove 
 the entire cache when the app no longer needs that cache.
 
 That pops the NSCache and deallocates it in the retain-release app, but in 
 the GC app, I ran an Instruments test and found that the NSCache objects and 
 their contents were never being finalized. If I change the code so the code 
 uses NSMutableDictionary instead of NSCache, then the dictionaries and their 
 objects are properly finalized when popped. I want to use NSCache and not 
 NSMutableDictionary, but I can't do this in the GC-enabled app if the 
 collector is going to let the caches live forever. How do I make it so that 
 the collector collects them?
 
 I already tried using Instruments to monitor the GC object graph, but the 
 results made no sense. According to Instruments, the NSCache objects were 
 rooted by a non-object memory address created before main() was called, a 
 long time before the objects were made. Also, I noticed that objects in the 
 cache would not identify the cache as their root. (Is that normal?)

I don't use NSCache but I have used instruments to effectively debug GC memory 
collection problems.
The described rooting behaviour of NSCache sounds peculiar to me.

What happens if you call -removeAllObjects. Are the cached objects finalised 
correctly?
I know this isn't the same as collecting the NSCache instance but at least, as 
a workaround if the issue persists, you can recycle the NSCache instances.


Regards

Jonathan Mitchell

Developer
Mugginsoft LLP
http://www.mugginsoft.com___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


SKPaymentTransaction has no receiptData property for Mac In App Purchase

2011-08-19 Thread XiaoGang Li
Hello List,

I have a question about the Mac In App Purchase. After reading the In App
Purchase Programming Guide and also other reference document via Google, I
found this guide is mainly focus on the iOS platform, actually, no one can
tell me what’s the difference of the StoreKit.framework on Mac and iOS. My
question is about the verifying Store Receipts, the document says that I can
retrieve the receipt data from the transaction’s transactionReceipt
property, but seems the SKPaymentTransaction have no such property for the
StoreKit.framework on Lion. Does anyone know how to retrieve the receipt
data after finished the transaction?

http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/VerifyingStoreReceipts/VerifyingStoreReceipts.html#//apple_ref/doc/uid/TP40008267-CH104-SW1



After reading the document

http://developer.apple.com/library/mac/#releasenotes/General/ValidateAppStoreReceipt/_index.html#//apple_ref/doc/uid/TP40010573

I found that the In App Purchase receipt data is inserted to the original
receipt data file, which is generated after installed from App Store. That’s
to say, there really has an In App Purchase receipt returned from app store,
but I can not get it by following the guide  In App Purchase Programming
Guide .



Thanks ahead if any one can point out my mistake. I am sure that there is no
receipt data property, please take a look at the head file here:

/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/StoreKit.framework/Versions/A/Headers/SKPaymentTransaction.h


Thanks, XiaoGang.
___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Noob question about .a files

2011-08-19 Thread Eric E. Dolecki
Okay - most of the warnings are for .o files  some for .a files:

*Apple Mach-O Linker Warning*
CPU_SUBTYPE_ARM_ALL subtype is deprecated

I also see a bunch of
*Uncategorized* (doesn't contain architecture information for armv6)

Since this thing compiles are runs alright, I won't worry too much. These
are .o files (object?) so I can't edit these.




On Thu, Aug 18, 2011 at 5:16 PM, Eric E. Dolecki edole...@gmail.com wrote:

 I'll be able to do that tomorrow when I get back in the office. I actually
 *think* they might have been linker warnings (wrong about the depreciated
 stuff) - not sure until I see them again. I might have had depreciation on
 the brain as I was fixed tons of those in inits, etc.

 Thanks,
 Eric


 On Thu, Aug 18, 2011 at 5:10 PM, Jens Alfke j...@mooseyard.com wrote:


 On Aug 18, 2011, at 1:50 PM, Eric E. Dolecki wrote:

 I have a project that compiles fine, but I get a slew of warnings about
 depreciated stuff in a few .a files in the project.


 That’s weird; usually it’s the C/ObjC compiler that warns about
 deprecation, not the linker. Are you using any 3rd party libraries?
 Could you copy and paste one of these messages?

 —Jens



___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


NSData Mime Types...

2011-08-19 Thread Kevin Muldoon
I've developed an application using EDMessage Frameworks which sends  
emails with attached PDF to a OSX fax server (running 4-Sight FAX v  
7.x). The fax server converts the attached PDF into a 1-bit tiff and  
sends it to a fax number specified in the body of the email.


This email w/attachment works very well with all sorts of email  
systems, however the fax server 4-Sight FAX v 7.x rejects the  
EDMessage email saying it's not formatted properly. After examining  
the raw headers of a successful email-fax to 4-Sight FAX vs. an  
unsuccessful email-fax which EDMessage created, I have the following  
question.


I suspect my Content-Type needs to be specified as Content-Type:  
application/pdf rather than Content-Type: application/octet-stream;  
What methods/techniques are available in NSData to set Mime-Types and  
other such things? Below is example of code I'm using with EDMessage.


	NSString *text = @Kevin Muldoon;Company;1-267-363-7401\r##\rMy fax  
cover letter!\r##\r;
	NSData *documentData =[NSData dataWithContentsOfFile:@/Users/kevin/ 
Documents/example.pdf];

NSMutableArray *attachmentList = [NSMutableArray array];
	[attachmentList addObject:[EDObjectPair  
pairWithObjects:documentData:@example.pdf]];

NSMutableDictionary * headerFields = [NSMutableDictionary dictionary];
	[headerFields setObject:@Kevin Muldoon caoimgh...@gmail.com   
forKey:EDMailFrom];
	[headerFields setObject:@Center4Sight faxser...@center4sight.com  
forKey:EDMailTo];
	[headerFields setObject:@Hi there, with attachment...  
forKey:EDMailSubject];
	EDMailAgent *mailAgent = [EDMailAgent  
mailAgentForRelayHostWithName:@mail.centerforsight.net port:1234];

[mailAgent setUsesSecureConnections:NO];
	[mailAgent sendMailWithHeaders:headerFields body:[text  
stringWithCanonicalLinebreaks] andAttachments:attachmentList];


And here is the raw result of that email which fails...

--EDMessagePart-13136997390
Content-Type: text/plain;
charset=US-ASCII;
format=flowed
Content-Transfer-Encoding: 7bit

Kevin Muldoon;Company;1-267-363-7401
##
My fax cover letter!
##


--EDMessagePart-13136997390
Content-Type: application/octet-stream;
name=waitforit.pdf
Content-Transfer-Encoding: base64





Kevin Muldoon
e: caoimgh...@gmail.com

___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Dug a hole with NSCGSImageRep...

2011-08-19 Thread Graham Cox
Due to a bug in my code, we shipped an app that unintentionally archives an 
NSImage obtained from the Picture Taker. I can fix the bug alright, but I'm 
wondering if I can dig myself out of the hole we're in in some way so that 
users can rescue these archives.

During dearchiving, I first get a logged warning:

Warning - attempting to decode NSCGSImageRep

Shortly followed by an out of range exception from NSKeyedDearchiver:

exception while reading file: *** -[__NSArrayI objectAtIndex:]: index 0 
beyond bounds for empty array

This exception prevents the document from being opened at all.


Does anyone know if this image can be dearchived in any way? I can easily catch 
the exception and allow the document to open without the image, but ideally I'd 
like to find a way to keep the image if at all possible, if only for our 
customers' sake.

--Graham
___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Specify valid values for a Core Data attribute

2011-08-19 Thread Martin Hewitson
Hi Brian,

I've normally solved this using an integer for the value and enumerate that to 
stand for different states of the bug. I'm not sure if there's a clever way to 
use an enum in conjunction with core data, so it may become a headache to 
'remember' what each value stands for, but if you only have a few states, then 
it should be straightforward. Then you bind the selectedIndex of the popup 
button, say, rather than the selectedObject.

Cheers,

Martin

On Aug 19, 2011, at 3:40 PM, Brian Norh wrote:

 Hello.
 
 When I'm using Core Data I'm sometimes in a situation where I have an
 attribute than can only have a specific set of possible values. As an
 example let's say that you make a bug tracker and you have an entity
 called Bug. Then it's possible that you want an attribute for the
 state that the bug is in. Let's say that possible states are Open,
 Closed and In Progress.
 
 What I've done so far is that I've had attributes like that defined as
 strings. Usually I've had a combo box or a radio group in the user
 interface and the possible input values have been defined by what the
 possible selections the combo box or radio group offers.
 
 One of the problems with this approach is that it doesn't work if the
 application is localized it into a different language. Then the word
 which indicates the state is stored differently depending on the
 current language. I need to save the selection in a language
 independent manner.
 
 How would you do that?
 
 I've tried to find an answer in the Core Data Programming Guide and
 I've also searched the list archives. I'm not really sure what the
 appropriate terminology for this specific kind of attribute would be
 so it could be that I'm just using the wrong search terms or I'm just
 not looking at the right place. So if this question have already been
 answered then a link to that thread or even a let-me-google-it-for-you
 would be helpful.
 
 Brian
 ___
 
 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(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/martin.hewitson%40aei.mpg.de
 
 This email sent to martin.hewit...@aei.mpg.de


Martin Hewitson
Albert-Einstein-Institut
Max-Planck-Institut fuer 
Gravitationsphysik und Universitaet Hannover
Callinstr. 38, 30167 Hannover, Germany
Tel: +49-511-762-17121, Fax: +49-511-762-5861
E-Mail: martin.hewit...@aei.mpg.de
WWW: http://www.aei.mpg.de/~hewitson






___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Strange NSFileManager file replacement issue

2011-08-19 Thread Sixten Otto
On Thu, Aug 18, 2011 at 10:14 PM, Quincey Morris 
quinceymor...@rivergatesoftware.com wrote:

 a. What version of iOS did this fail on?


The 4.3 simulator (running on Snow Leopard, Xcode 4.0.2).


 b. Can you assert that the receiver of the 'replace…' method is not nil?
 (If it was nil, the method call would behave exactly as you describe.)


Good thing to check, but since it's returning YES for the -fileExistsAtPath:
calls, and works in some of the other cases, I doubt that the NSFileManager
is nil.


 c. Can you show us the actual line of code that does the replacement?


I'll post my code when I get in to the office. (I got about this far before
I had to leave last night.)

Sixten
___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Strange NSFileManager file replacement issue

2011-08-19 Thread Sixten Otto
On Thu, Aug 18, 2011 at 10:38 PM, Ken Thomases k...@codeweavers.com wrote:

 My thinking is that -replaceItemAtURL:... is a wrapper around
 exchangedata() or FSExchangeObjects().  Those functions, and the general
 operation that they perform, require that the files to be exchanged be on
 the same file system.  It would seem that, on iOS, the application's
 Document folder is on a different file system from the temporary directory.
  This is exactly the problem which
 -URLForDirectory:NSItemReplacementDirectory... is intended to solve.  It's
 to give you a temporary directory that's appropriate for a subsequent
 -replaceItemAtURL:... call.


If true, that certainly makes that method far less useful in the general
case than I expected, and really seems restricted to the saving a new copy
of an in-memory document and swapping it case. I really don't want to put
the in-process download into the Documents tree. (Both because it's
potentially visible to the user through iTunes, and because
NSTemporaryDirectory() will be swept up occasionally.) I'll see what I can
do to test this this morning.

I guess the question then becomes:
- Abandon the use of the atomic swap altogether, and roll my own
copy+remove?
- Or introduce an extra step, where I copy the temp file into
NSItemReplacementDirectory,
and then call replaceItemAtURL?
- Or is there some better pattern altogether?


 I recommend that you file bugs against the documentation for not adequately
 explaining the requirements on the newItemURL parameter and against the
 implementation for failing to provide a valid NSError pointer on failure in
 this case.


Definitely. I want to verify that I *can* make it work if the replacement
item is already in the Documents tree / replacement directory, and then I'll
be spending some time on the bug reporter.

Sixten
___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Scripting Bridge header file problem

2011-08-19 Thread Leo

Hi all,

I'm trying to use Scripting Bridge to send AppleScript to InDesign CS5.5.

I created the header file from scripting definitions... It's a huge file 
- 10.2 MB.


Added it to the project.

Now the project won't compile because the InDesign header file contains 
tons of duplicate declarations of various methods.


For example, mergeWith: declared 3 times for various InDesign classes.

It's unthinkable to correct all of them - there's over 500 errors

Is there a way to deal with it?

Obviously, I don't need all the classes. So I guess I just should delete 
whatever I don't need from the header file and correct a few remaining 
matching methods (if any).


Or is there a better way to fix it?

Thanks,
Leo

___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Noob question about .a files

2011-08-19 Thread Kyle Sluder
On Aug 19, 2011, at 5:46 AM, Eric E. Dolecki edole...@gmail.com wrote:

 Okay - most of the warnings are for .o files  some for .a files:
 
 *Apple Mach-O Linker Warning*
 CPU_SUBTYPE_ARM_ALL subtype is deprecated
 
 I also see a bunch of
 *Uncategorized* (doesn't contain architecture information for armv6)
 
 Since this thing compiles are runs alright, I won't worry too much. These
 are .o files (object?) so I can't edit these.

They're build products. Xcode is producing them from your source code. 
Something about your project settings needs fixing.

I'd suggest taking this over to the xcode-users list, and also familiarizing 
yourself with the compilation and linking process.

--Kyle Sluder___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Noob question about .a files

2011-08-19 Thread Eric E. Dolecki
Okay - I'll do that.

Checking the debug and release architectures for the Project I
see $(ARCHS_STANDARD_32_BIT) listed with Standard (armv7). Thanks for
pointing this out to me.

- Eric


On Fri, Aug 19, 2011 at 10:47 AM, Kyle Sluder kyle.slu...@gmail.com wrote:

 On Aug 19, 2011, at 5:46 AM, Eric E. Dolecki edole...@gmail.com wrote:

  Okay - most of the warnings are for .o files  some for .a files:
 
  *Apple Mach-O Linker Warning*
  CPU_SUBTYPE_ARM_ALL subtype is deprecated
 
  I also see a bunch of
  *Uncategorized* (doesn't contain architecture information for armv6)
 
  Since this thing compiles are runs alright, I won't worry too much. These
  are .o files (object?) so I can't edit these.

 They're build products. Xcode is producing them from your source code.
 Something about your project settings needs fixing.

 I'd suggest taking this over to the xcode-users list, and also
 familiarizing yourself with the compilation and linking process.

 --Kyle Sluder
___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Transparency of textured controls

2011-08-19 Thread Andreas Mayer

Am 13.08.2011 um 18:41 schrieb Leo:

 For some reason, the textured controls are now transparent (e.g., Textured 
 Rounded and Textured Square of NSSegmentedControl etc.)

From the AppKit Release Notes:

--
Button Appearance Changes (New since early 2011 seed)

As part of an ongoing refresh of Aqua in Mac OS X Lion, some buttons look 
different and may not look the same in every context in your application. 
Specifically, the “Round Textured” button is not appropriate in any context 
other than directly on the background of a textured window. If you are using 
this kind of button in a table view or other context, please consider changing 
it to a “Round Rect” button.
--


Andreas___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Strange NSFileManager file replacement issue

2011-08-19 Thread Sixten Otto
On Thu, Aug 18, 2011 at 10:14 PM, Quincey Morris
quinceymor...@rivergatesoftware.com wrote:
 c. Can you show us the actual line of code that does the replacement?

Here's the original code (plus the addition of an assert on the file
manager). The property self.filePath has the path to the current
version of the file that's already on disk (from a previous pass
through this code). In my current test case, the paths look something
like:

self.filePath: 
/Users/sixten/Library/Application%20Support/iPhone%20Simulator/4.3.2/Applications/840B5926-8107-458E-87ED-ABF0F084BC12/Documents/Subdir/MyFile.pdf
tempFilePath: /var/folders/KP/KPl-d+TMHGaIJ6QIjMYNQTI/-Tmp-/2212

// start original code
NSFileManager* fileManager = [[NSFileManager alloc] init];
NSAssert(fileManager != nil, @File manager wasn't created.);

NSString* directoryPath = [fileManager
rd_documentsSubdirectory:self.document.volume];
BOOL isDirectory;
NSAssert1([fileManager fileExistsAtPath:tempFilePath
isDirectory:isDirectory]  isDirectory == NO, @Bad temp file path
%@, tempFilePath);
NSAssert1([fileManager fileExistsAtPath:directoryPath
isDirectory:isDirectory]  isDirectory == YES, @Bad document
directory %@, directoryPath);

if( [desiredName length] == 0 ) {
  if( self.filePath ) {
desiredName = [self.filePath lastPathComponent];
  }
  else {
desiredName = [tempFilePath lastPathComponent];
  }
}

NSString* finalPath = [directoryPath
stringByAppendingPathComponent:desiredName];
NSError* error = nil;
if( [finalPath isEqualToString:self.filePath] || [self.filePath
hasPrefix:directoryPath] ) {
  NSURL* existingFileURL = [NSURL fileURLWithPath:finalPath];
  NSURL* newFileURL = [NSURL fileURLWithPath:tempFilePath];
  NSString* backupItemName = [NSString
stringWithFormat:@__%@__.bak, self.documentId];
  NSURL* resultURL = nil;

  // *** 1
  if( [fileManager replaceItemAtURL:existingFileURL
withItemAtURL:newFileURL backupItemName:backupItemName options:0
resultingItemURL:resultURL error:error] ) {
self.filePath = [resultURL path];
success = YES;
  }
  else {
// *** ends up here, with no error == nil
LOG_GENERAL(LOG_PRIORITY_HIGHEST, @Error attempting to
replace »%@« with »%@«: %@\n%@, tempFilePath, finalPath, [error
localizedDescription]);
NSAssert(NO, @Couldn't move file to designated location);
  }
  // *** 2
}
else {
  // ... move the temp file to finalPath, which works just fine,
and update self.filePath
}

[fileManager release];
// end original code


This morning, I replaced the code between the *** 1 and *** 2 with
the following, which still failed in exactly the same way. It does get
create a replacement directory and return it, my temp file moves into
that directory without issue, but the swap still mysteriously fails.
The value of swapURL looks like:

file://localhost/Users/sixten/Library/Application%20Support/iPhone%20Simulator/4.3.2/Applications/840B5926-8107-458E-87ED-ABF0F084BC12/Documents/Subdir/(A%20Document%20Being%20Saved%20By%20MyApp)/MyFile.pdf

  // *** 1
  NSURL* swapURL = [fileManager
URLForDirectory:NSItemReplacementDirectory inDomain:NSUserDomainMask
appropriateForURL:existingFileURL create:YES error:error];
  if( swapURL ) {
swapURL = [swapURL URLByAppendingPathComponent:desiredName];
if( [fileManager moveItemAtURL:newFileURL toURL:swapURL error:NULL] ) {
  if( [fileManager replaceItemAtURL:existingFileURL
withItemAtURL:swapURL backupItemName:backupItemName options:0
resultingItemURL:resultURL error:error] ) {
self.filePath = [resultURL path];
success = YES;
  }
  else {
// *** still gets here, with no error set!
LOG_GENERAL(LOG_PRIORITY_HIGHEST, @Error attempting to
replace »%@« with »%@«: %@\n%@, tempFilePath, finalPath, [error
localizedDescription]);
NSAssert(NO, @Couldn't move file to designated location);
  }
}
  }
  else {
LOG_GENERAL(LOG_PRIORITY_HIGHEST, @Error attempting to
replace »%@« with »%@«: %@\n%@, tempFilePath, finalPath, [error
localizedDescription]);
NSAssert(NO, @Couldn't find/create swap location);
  }
  // *** 2
___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Specify valid values for a Core Data attribute

2011-08-19 Thread Sean McBride
On Fri, 19 Aug 2011 15:40:55 +0200, Brian Norh said:

One of the problems with this approach is that it doesn't work if the
application is localized it into a different language. Then the word
which indicates the state is stored differently depending on the
current language. I need to save the selection in a language
independent manner.

Yes, you do.  Either an enum as Martin said, or a string with unique values, 
like com.brian.bugstate.open, etc.  integer enums have the advantage of mapping 
to 'tag's in an NSPopupButton, and you can then specify min and max values in 
your xcdatamodel.

answered then a link to that thread or even a let-me-google-it-for-you
would be helpful.

You should also read about 'key value validation'.

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSData Mime Types...

2011-08-19 Thread Jens Alfke

On Aug 19, 2011, at 5:51 AM, Kevin Muldoon wrote:

 I suspect my Content-Type needs to be specified as Content-Type: 
 application/pdf rather than Content-Type: application/octet-stream; What 
 methods/techniques are available in NSData to set Mime-Types and other such 
 things?

None. NSData is a simple uninterpreted blob of bytes. You’ll have to look at 
the docs for the EDMessage framework to see how you can customize the MIME type 
of your attachment.

—Jens___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Lion - CopiesOnScroll Bug with table view

2011-08-19 Thread Raleigh Ledet
A) Does the scrollview overlap your side view by a pixel or more?
B) What is the frame of the scrollview? Is it integral?

-raleigh


On Aug 18, 2011, at 5:23 PM, Seth Willits wrote:

 
 I have an NSTableView in a scrollview, and on Lion it's now smearing all of 
 the drawing when scrolling:
 http://sethwillits.com/temp/upshot/upshot_nHnDbrLB.jpg
 
 
 Some things to note:
 
 
 A) This doesn't happen on Snow Leopard
 B) Yes, I am using a custom cell in the table view, but using a standard 
 NSTextFieldCell has the same problem
 C) [[tableView enclosingScrollView] setCopiesOnScroll:NO]  fixes it
 D) copiesOnScroll is YES on Snow Leopard
 E) For some reason it seems to only happen when scrolling new rows in from 
 the top (scrolling up)
 
 
 Any ideas? I'm really stumped on why this is broken all of a sudden.
 
 
 --
 Seth Willits
 
 
 
 
 ___
 
 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(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/ledet%40apple.com
 
 This email sent to le...@apple.com

___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSData Mime Types...

2011-08-19 Thread Kevin Muldoon

Alright. Makes sense. Thanks for replying everyone.

On Aug 19, 2011, at 12:47 PM, Jens Alfke wrote:



On Aug 19, 2011, at 5:51 AM, Kevin Muldoon wrote:

I suspect my Content-Type needs to be specified as Content-Type:  
application/pdf rather than Content-Type: application/octet-stream;  
What methods/techniques are available in NSData to set Mime-Types  
and other such things?


None. NSData is a simple uninterpreted blob of bytes. You’ll have to  
look at the docs for the EDMessage framework to see how you can  
customize the MIME type of your attachment.


—Jens



Kevin Muldoon
e: caoimgh...@gmail.com

___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Printing [SOLVED]

2011-08-19 Thread koko
The bounds of my print view did not contain the rect returned in rectForPage.

-koko



On Aug 18, 2011, at 7:05 PM, Graham Cox wrote:

 shrugs
 
 Show your code. How are we supposed to debug something we can't even see?
 
 perhaps -rectForPage: is returning an empty rect? Perhaps you're not setting 
 up the printing view correctly? Perhaps you've written the code in a strange 
 dialect of Swahili?
 
 --Graham
 
 
 On 19/08/2011, at 10:45 AM, koko wrote:
 
 I have view that I use for printing.
 
 knowsPageRange is called
 
 rectForPage is called
 
 BUT
 
 drawRect is not called
 
 What in the name of HP am I missing?
 
 -koko
 ___
 
 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(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/graham.cox%40bigpond.com
 
 This email sent to graham@bigpond.com
 
 

___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Looking for sample code to support NSRect resize in a view

2011-08-19 Thread Jeff Schriebman
Hello,
In a new project I am developing in Lion I display a number of items in a 
standard view. Each of these items is bounded by a NSRect. I would like to be 
able to click on an item, display the rectangle around it and then click on the 
right, left, top or bottom of the rectangle and drag it to change its size. I 
think that support for the NSCursor Class is pretty much what I need although 
this class seems to lack the very useful four corner diagonal resize cursor 
icons. I have found some code using google that at least contains the cursor 
types resizeLeftCursor, resizeRightCursor, resizeUpCursor and resizeDownCursor 
that I can adapt for my purpose but I was wondering if I am overlooking some 
class or sample code that implements this functionality.
Thank you.

Jeff Schriebman




___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Lion - CopiesOnScroll Bug with table view

2011-08-19 Thread Seth Willits

Sweet. Thanks.

It turned out to be non-integral frame of the scrollview's content view. Oddly, 
the scrollview itself had an integral frame, and it's the scrollview's frame 
that I set to be non-integral accidentally, through my custom split view. The 
non-integral numbers comes from the mouse dragged event. I noticed this 
somewhere else; it seems that mouse dragged events now have fractional values 
in Lion. 


-- Seth




On Aug 19, 2011, at 9:48 AM, Raleigh Ledet wrote:

 A) Does the scrollview overlap your side view by a pixel or more?
 B) What is the frame of the scrollview? Is it integral?
 
 -raleigh
 
 
 On Aug 18, 2011, at 5:23 PM, Seth Willits wrote:
 
 
 I have an NSTableView in a scrollview, and on Lion it's now smearing all of 
 the drawing when scrolling:
 http://sethwillits.com/temp/upshot/upshot_nHnDbrLB.jpg
 
 
 Some things to note:
 
 
 A) This doesn't happen on Snow Leopard
 B) Yes, I am using a custom cell in the table view, but using a standard 
 NSTextFieldCell has the same problem
 C) [[tableView enclosingScrollView] setCopiesOnScroll:NO]  fixes it
 D) copiesOnScroll is YES on Snow Leopard
 E) For some reason it seems to only happen when scrolling new rows in from 
 the top (scrolling up)
 
 
 Any ideas? I'm really stumped on why this is broken all of a sudden.
 
 
 --
 Seth Willits
___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSCache objects not being collected under GC?

2011-08-19 Thread Nick Zitzmann

On Aug 19, 2011, at 2:40 AM, jonat...@mugginsoft.com wrote:

 I don't use NSCache but I have used instruments to effectively debug GC 
 memory collection problems.
 The described rooting behaviour of NSCache sounds peculiar to me.

I just reproduced the problem in another project, so this is probably a GC bug 
unless someone else knows what's going on. I've filed a bug report.

 What happens if you call -removeAllObjects. Are the cached objects finalised 
 correctly?
 I know this isn't the same as collecting the NSCache instance but at least, 
 as a workaround if the issue persists, you can recycle the NSCache instances.


Yes, they are finalized if the code calls -removeAllObjects instead of removing 
the dictionary. I guess that'll have to do for now.

Nick Zitzmann
http://www.chronosnet.com/

___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Transparency of textured controls

2011-08-19 Thread Leo

On 8/19/11 11:00:44 AM, Andreas Mayer wrote:

Am 13.08.2011 um 18:41 schrieb Leo:

For some reason, the textured controls are now transparent (e.g., Textured 
Rounded and Textured Square of NSSegmentedControl etc.)

 From the AppKit Release Notes:

--
Button Appearance Changes (New since early 2011 seed)

As part of an ongoing refresh of Aqua in Mac OS X Lion, some buttons look 
different and may not look the same in every context in your application. 
Specifically, the “Round Textured” button is not appropriate in any context 
other than directly on the background of a textured window. If you are using 
this kind of button in a table view or other context, please consider changing 
it to a “Round Rect” button.
--

Thanks Andreas!

Actually, I finally realized what the real issue is: Apple for some 
reason didn't refresh NSSegmentedControl Rounded style to match the 
new appearance of NSTabView controls on Lion.


So NSSegmentedControl still looks like the old Aqua blueish liquified 
controls. Which will look totally out of place on Lion.


I'll submit an appropriate request to Apple. Like - hello Apple! This is 
something you really had to update. And please bring back the colorful  
Finder sidebar with custom icons and Devices on top, so that it becomes 
user-friendly again (you did not have to ruin it really)!!


Best,
Leo
___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Looking for sample code to support NSRect resize in a view

2011-08-19 Thread Mike Abdullah
There's nothing built into cocoa for this. I wrote KSSelectionBorder to 
implement a decent chunk of the functionality:

https://github.com/karelia/KSSelectionBorder

Sent from my iPad

On 19 Aug 2011, at 07:00 PM, Jeff Schriebman j...@leapfrogproductions.com 
wrote:

 Hello,
 In a new project I am developing in Lion I display a number of items in a 
 standard view. Each of these items is bounded by a NSRect. I would like to be 
 able to click on an item, display the rectangle around it and then click on 
 the right, left, top or bottom of the rectangle and drag it to change its 
 size. I think that support for the NSCursor Class is pretty much what I need 
 although this class seems to lack the very useful four corner diagonal resize 
 cursor icons. I have found some code using google that at least contains the 
 cursor types resizeLeftCursor, resizeRightCursor, resizeUpCursor and 
 resizeDownCursor that I can adapt for my purpose but I was wondering if I am 
 overlooking some class or sample code that implements this functionality.
 Thank you.
 
 Jeff Schriebman
 
 
 
 
 ___
 
 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(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net
 
 This email sent to cocoa...@mikeabdullah.net
___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Strange NSFileManager file replacement issue

2011-08-19 Thread Steve Christensen
On Aug 19, 2011, at 7:17 AM, Sixten Otto wrote:

 On Thu, Aug 18, 2011 at 10:38 PM, Ken Thomases k...@codeweavers.com wrote:
 
 Those functions, and the general operation that they perform, require that
 the files to be exchanged be on the same file system.
 
 If true, that certainly makes that method far less useful in the general
 case than I expected, and really seems restricted to the saving a new copy
 of an in-memory document and swapping it case. I really don't want to put
 the in-process download into the Documents tree. (Both because it's
 potentially visible to the user through iTunes, and because
 NSTemporaryDirectory() will be swept up occasionally.)

Is there any reason why you can't put the downloaded file in your app's private 
cache directory (.../appdir/Library/Caches), i.e., what gets returned by 
NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES)? 
That should certainly be within the bigger app directory hierarchy, and thus a 
peer of the app's Documents directory.


___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Crash Reporter for Lion

2011-08-19 Thread Wilker
Hi Guys,

I'm trying to setup a crash reporter on my Mac Application.

I tried the UKCrashReporter, but it seems to not be working here (compiling
with 10.7 target, 64 bits).

You have any recommendations on what I could use for that?

Thanks,
---
Wilker Lúcio
http://about.me/wilkerlucio/bio
Kajabi Consultant
+55 81 82556600
___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


iPhone app behaves differently on every other launch

2011-08-19 Thread Rick Mann
One of my colleagues at work wrote a small test app to work on a bit of custom 
UI. It's a simple app based on the View-based app stationery.

She has run into a vexing problem: on one run of the app, it works fine. On the 
second, her view controller's view does not appear. The next run, all is fine. 
The next, broken. It is exactly every other time that it works.

This is all in the sim. I've tried quitting the sim, resetting it, etc. It 
always, without fail, alternates behavior every other launch, no matter what 
else you do.

What little debugging I've done shows that -didFinishLaunching is always 
called, but that the view fails to load every other time. That is, the view 
controller's -viewDidLoad is only called every other launch. 
-didFinishLaunching installed the view controller as the window's root view 
controller, then calls -makeKeyAndVisible. Both those outlets are never nil.

Any ideas?

Thanks,
Rick

___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Looking for sample code to support NSRect resize in a view

2011-08-19 Thread Jeff Schriebman
Thanks for the pointer Mike.

On Aug 19, 2011, at 1:00 PM, Mike Abdullah wrote:
 There's nothing built into cocoa for this. I wrote KSSelectionBorder to 
 implement a decent chunk of the functionality:
 
 https://github.com/karelia/KSSelectionBorder
 
 On 19 Aug 2011, at 07:00 PM, Jeff Schriebman j...@leapfrogproductions.com 
 wrote:
 In a new project I am developing in Lion I display a number of items in a 
 standard view. Each of these items is bounded by a NSRect. I would like to 
 be able to click on an item, display the rectangle around it and then click 
 on the right, left, top or bottom of the rectangle and drag it to change its 
 size. I think that support for the NSCursor Class is pretty much what I need 
 although this class seems to lack the very useful four corner diagonal 
 resize cursor icons. I have found some code using google that at least 
 contains the cursor types resizeLeftCursor, resizeRightCursor, 
 resizeUpCursor and resizeDownCursor that I can adapt for my purpose but I 
 was wondering if I am overlooking some class or sample code that implements 
 this functionality.

Jeff




___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Crash Reporter for Lion

2011-08-19 Thread Sean McBride
On Fri, 19 Aug 2011 17:18:14 -0300, Wilker said:

I'm trying to setup a crash reporter on my Mac Application.

I tried the UKCrashReporter, but it seems to not be working here (compiling
with 10.7 target, 64 bits).

You have any recommendations on what I could use for that?

This is working well for me:
https://github.com/tcurdt/feedbackreporter

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Lion - CopiesOnScroll Bug with table view

2011-08-19 Thread Raleigh Ledet
You never could assume mouse coordinates were always integral. Tablets for 
example output non-integral mouse coordinates and have since 10.2. In Lion, hi 
res mice (such as Apple's trackpads and Magic Mice) will output non-integral 
mouse coordinates as well.

-raleigh

On Aug 19, 2011, at 12:14 PM, Seth Willits wrote:

 
 Sweet. Thanks.
 
 It turned out to be non-integral frame of the scrollview's content view. 
 Oddly, the scrollview itself had an integral frame, and it's the scrollview's 
 frame that I set to be non-integral accidentally, through my custom split 
 view. The non-integral numbers comes from the mouse dragged event. I noticed 
 this somewhere else; it seems that mouse dragged events now have fractional 
 values in Lion. 
 
 
 -- Seth
 
 
 
 
 On Aug 19, 2011, at 9:48 AM, Raleigh Ledet wrote:
 
 A) Does the scrollview overlap your side view by a pixel or more?
 B) What is the frame of the scrollview? Is it integral?
 
 -raleigh
 
 
 On Aug 18, 2011, at 5:23 PM, Seth Willits wrote:
 
 
 I have an NSTableView in a scrollview, and on Lion it's now smearing all of 
 the drawing when scrolling:
 http://sethwillits.com/temp/upshot/upshot_nHnDbrLB.jpg
 
 
 Some things to note:
 
 
 A) This doesn't happen on Snow Leopard
 B) Yes, I am using a custom cell in the table view, but using a standard 
 NSTextFieldCell has the same problem
 C) [[tableView enclosingScrollView] setCopiesOnScroll:NO]  fixes it
 D) copiesOnScroll is YES on Snow Leopard
 E) For some reason it seems to only happen when scrolling new rows in from 
 the top (scrolling up)
 
 
 Any ideas? I'm really stumped on why this is broken all of a sudden.
 
 
 --
 Seth Willits
 ___
 
 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(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/ledet%40apple.com
 
 This email sent to le...@apple.com

___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Lion - CopiesOnScroll Bug with table view

2011-08-19 Thread Kyle Sluder
On Fri, Aug 19, 2011 at 1:33 PM, Raleigh Ledet le...@apple.com wrote:
 You never could assume mouse coordinates were always integral. Tablets for 
 example output non-integral mouse coordinates and have since 10.2. In Lion, 
 hi res mice (such as Apple's trackpads and Magic Mice) will output 
 non-integral mouse coordinates as well.

And, on Snow Leopard and earlier, if the user had used
Ctrl-Scrollwheel to zoom in the screen, the window server would hand
you non-integral event coordinates.

--Kyle Sluder
___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Lion - CopiesOnScroll Bug with table view

2011-08-19 Thread Seth Willits
On Aug 19, 2011, at 1:40 PM, Kyle Sluder wrote:

 On Fri, Aug 19, 2011 at 1:33 PM, Raleigh Ledet le...@apple.com wrote:
 You never could assume mouse coordinates were always integral. Tablets for 
 example output non-integral mouse coordinates and have since 10.2. In Lion, 
 hi res mice (such as Apple's trackpads and Magic Mice) will output 
 non-integral mouse coordinates as well.
 
 And, on Snow Leopard and earlier, if the user had used
 Ctrl-Scrollwheel to zoom in the screen, the window server would hand
 you non-integral event coordinates.



Good to know. Thanks.


--
Seth Willits



___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


How do you create a QTMovieView programmatically?

2011-08-19 Thread Charles Srstka
Looking through the docs for QTMovieView, it seems that not only is its only 
initializer, -initWithFrame: deprecated, but according to the docs it’s not 
even available past OS X 10.5. Surely there must be a way to initialize a 
QTMovieView in code, right? Or is there some other class we’re supposed to use 
instead of QTMovieView to view AV content?

Thanks,
Charles___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How do you create a QTMovieView programmatically?

2011-08-19 Thread Kyle Sluder
On Fri, Aug 19, 2011 at 1:54 PM, Charles Srstka
cocoa...@charlessoft.com wrote:
 Looking through the docs for QTMovieView, it seems that not only is its only 
 initializer, -initWithFrame: deprecated, but according to the docs it’s not 
 even available past OS X 10.5. Surely there must be a way to initialize a 
 QTMovieView in code, right? Or is there some other class we’re supposed to 
 use instead of QTMovieView to view AV content?

Does -initWithFrame: followed by -setMovie: not do the job?

--Kyle Sluder
___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How do you create a QTMovieView programmatically?

2011-08-19 Thread Charles Srstka
On Aug 19, 2011, at 4:00 PM, Kyle Sluder wrote:

 On Fri, Aug 19, 2011 at 1:54 PM, Charles Srstka
 cocoa...@charlessoft.com wrote:
 Looking through the docs for QTMovieView, it seems that not only is its only 
 initializer, -initWithFrame: deprecated, but according to the docs it’s not 
 even available past OS X 10.5. Surely there must be a way to initialize a 
 QTMovieView in code, right? Or is there some other class we’re supposed to 
 use instead of QTMovieView to view AV content?
 
 Does -initWithFrame: followed by -setMovie: not do the job?

I haven’t tried it yet, but I would assume this would not be a good way to go 
about doing it, given that -[QTMovieView initWithFrame:] is both listed as 
deprecated and also as “Available Mac OS X 10.3 through 10.5” in the docs, 
suggesting that it probably won’t work at all in 10.6 and up, and even if it 
did, it’s deprecated.

So how are we supposed to make a QTMovieView in code?

Charles___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Strange NSFileManager file replacement issue

2011-08-19 Thread Sixten Otto
On Fri, Aug 19, 2011 at 1:14 PM, Steve Christensen puns...@mac.com wrote:

 Is there any reason why you can't put the downloaded file in your app's
 private cache directory (.../appdir/Library/Caches), i.e., what gets
 returned by NSSearchPathForDirectoriesInDomains(NSCachesDirectory,
 NSUserDomainMask, YES)? That should certainly be within the bigger app
 directory hierarchy, and thus a peer of the app's Documents directory.


Can't? No. My preference for NSTemporaryDirectory() was mainly the notion
that I had help from the OS in clearing out any old partial downloads that
whatever weird circumstances might have orphaned.

But I'm not sure that it'd matter. Even when I moved the file from there to
the NSItemReplacementDirectory given by the file manager,
-replaceItemAtURL:... was still behaving identically. (See my previous
message for the details.)

Sixten
___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Strange NSFileManager file replacement issue

2011-08-19 Thread Ken Thomases
On Aug 19, 2011, at 10:29 AM, Sixten Otto wrote:

 This morning, I replaced the code between the *** 1 and *** 2 with
 the following, which still failed in exactly the same way. It does get
 create a replacement directory and return it, my temp file moves into
 that directory without issue, but the swap still mysteriously fails.

I realize this is getting further and further from what you actually want, but 
you might try using the exchangedata() or FSExchangeObjects() functions 
directly.  At least that way, you should receive a clearer error result.  For 
the latter, you can get FSRefs from NSURLs via CFURLGetFSRef(), since NSURL and 
CFURLRef are toll-free bridged.

The ability to exchange objects has to be supported by the file system.  Maybe 
the file system on an iOS device simply doesn't support it.  The errors you get 
back from the above functions ought to make that clear.

Regards,
Ken

___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


[SOLVED] iPhone app behaves differently on every other launch

2011-08-19 Thread Rick Mann
Here's an interesting one for ya...

My colleague had two NIB files with the same name, but one lacked all the 
content of the other. Xcode 3.2.6 would alternate which was included in the 
bundle on each build/run (running without building resulted in consistent 
behavior).

Hence, exactly every other launch (build/run) would result in alternating 
behavior.

A warning that two entries in the project collide would be helpful.

-- 
Rick

On Aug 19, 2011, at 13:20 , Rick Mann wrote:

 One of my colleagues at work wrote a small test app to work on a bit of 
 custom UI. It's a simple app based on the View-based app stationery.
 
 She has run into a vexing problem: on one run of the app, it works fine. On 
 the second, her view controller's view does not appear. The next run, all is 
 fine. The next, broken. It is exactly every other time that it works.
 
 This is all in the sim. I've tried quitting the sim, resetting it, etc. It 
 always, without fail, alternates behavior every other launch, no matter what 
 else you do.
 
 What little debugging I've done shows that -didFinishLaunching is always 
 called, but that the view fails to load every other time. That is, the view 
 controller's -viewDidLoad is only called every other launch. 
 -didFinishLaunching installed the view controller as the window's root view 
 controller, then calls -makeKeyAndVisible. Both those outlets are never nil.
 
 Any ideas?
 
 Thanks,
 Rick
 
 ___
 
 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(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/rmann%40latencyzero.com
 
 This email sent to rm...@latencyzero.com

___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How do you create a QTMovieView programmatically?

2011-08-19 Thread Seth Willits
On Aug 19, 2011, at 2:19 PM, Charles Srstka wrote:

 Looking through the docs for QTMovieView, it seems that not only is its 
 only initializer, -initWithFrame: deprecated, but according to the docs 
 it’s not even available past OS X 10.5. Surely there must be a way to 
 initialize a QTMovieView in code, right? Or is there some other class we’re 
 supposed to use instead of QTMovieView to view AV content?
 
 Does -initWithFrame: followed by -setMovie: not do the job?
 
 I haven’t tried it yet, but I would assume this would not be a good way to go 
 about doing it, given that -[QTMovieView initWithFrame:] is both listed as 
 deprecated and also as “Available Mac OS X 10.3 through 10.5” in the docs, 
 suggesting that it probably won’t work at all in 10.6 and up, and even if it 
 did, it’s deprecated.
 
 So how are we supposed to make a QTMovieView in code?


Ignore the documentation; it's a bug. Use initWithFrame:

initWithFrame: used to be explicitly listed in the QTMovieView header, and my 
guess is when it was removed, it was marked as deprecated in the documentation 
which was wrong. initWithFrame: is a valid initializer.


--
Seth Willits



___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: How do you create a QTMovieView programmatically?

2011-08-19 Thread Stephane Sudre
On Fri, Aug 19, 2011 at 11:51 PM, Seth Willits sli...@araelium.com wrote:
 On Aug 19, 2011, at 2:19 PM, Charles Srstka wrote:

 Looking through the docs for QTMovieView, it seems that not only is its 
 only initializer, -initWithFrame: deprecated, but according to the docs 
 it’s not even available past OS X 10.5. Surely there must be a way to 
 initialize a QTMovieView in code, right? Or is there some other class 
 we’re supposed to use instead of QTMovieView to view AV content?

 Does -initWithFrame: followed by -setMovie: not do the job?

 I haven’t tried it yet, but I would assume this would not be a good way to 
 go about doing it, given that -[QTMovieView initWithFrame:] is both listed 
 as deprecated and also as “Available Mac OS X 10.3 through 10.5” in the 
 docs, suggesting that it probably won’t work at all in 10.6 and up, and even 
 if it did, it’s deprecated.

 So how are we supposed to make a QTMovieView in code?


 Ignore the documentation; it's a bug. Use initWithFrame:

 initWithFrame: used to be explicitly listed in the QTMovieView header, and my 
 guess is when it was removed, it was marked as deprecated in the 
 documentation which was wrong. initWithFrame: is a valid initializer.

Also using QTMovieView initWithFrame: for this project:
http://s.sudre.free.fr/Software/SaveHollywood.html (source code
available on the page).
___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: iPhone app behaves differently on every other launch

2011-08-19 Thread William Squires
I would check 2 things:

1) Is there anything in the view controller that's maintaining a persistent 
boolean state that toggles each time its awakeFromNib is called?
2) Does it do the same thing when you deploy to an actual iPad?

On Aug 19, 2011, at 3:20 PM, Rick Mann wrote:

 One of my colleagues at work wrote a small test app to work on a bit of 
 custom UI. It's a simple app based on the View-based app stationery.
 
 She has run into a vexing problem: on one run of the app, it works fine. On 
 the second, her view controller's view does not appear. The next run, all is 
 fine. The next, broken. It is exactly every other time that it works.
 
 This is all in the sim. I've tried quitting the sim, resetting it, etc. It 
 always, without fail, alternates behavior every other launch, no matter what 
 else you do.
 
 What little debugging I've done shows that -didFinishLaunching is always 
 called, but that the view fails to load every other time. That is, the view 
 controller's -viewDidLoad is only called every other launch. 
 -didFinishLaunching installed the view controller as the window's root view 
 controller, then calls -makeKeyAndVisible. Both those outlets are never nil.
 
 Any ideas?
 
 Thanks,
 Rick
 
 ___
 
 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(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/wsquires%40satx.rr.com
 
 This email sent to wsqui...@satx.rr.com

___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: iPhone app behaves differently on every other launch

2011-08-19 Thread Rick Mann
Actually we found the culprit. I posted the solution to the list.

On Aug 19, 2011, at 16:14 , William Squires wrote:

 I would check 2 things:
 
 1) Is there anything in the view controller that's maintaining a persistent 
 boolean state that toggles each time its awakeFromNib is called?
 2) Does it do the same thing when you deploy to an actual iPad?
 
 On Aug 19, 2011, at 3:20 PM, Rick Mann wrote:
 
 One of my colleagues at work wrote a small test app to work on a bit of 
 custom UI. It's a simple app based on the View-based app stationery.
 
 She has run into a vexing problem: on one run of the app, it works fine. On 
 the second, her view controller's view does not appear. The next run, all is 
 fine. The next, broken. It is exactly every other time that it works.
 
 This is all in the sim. I've tried quitting the sim, resetting it, etc. It 
 always, without fail, alternates behavior every other launch, no matter what 
 else you do.
 
 What little debugging I've done shows that -didFinishLaunching is always 
 called, but that the view fails to load every other time. That is, the view 
 controller's -viewDidLoad is only called every other launch. 
 -didFinishLaunching installed the view controller as the window's root view 
 controller, then calls -makeKeyAndVisible. Both those outlets are never nil.
 
 Any ideas?
 
 Thanks,
 Rick
 
 ___
 
 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(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/wsquires%40satx.rr.com
 
 This email sent to wsqui...@satx.rr.com
 
 ___
 
 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(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/cocoa-dev/rmann%40latencyzero.com
 
 This email sent to rm...@latencyzero.com

___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Help! Gesture getting canceled

2011-08-19 Thread Rick Mann
I've implemented a drag-and-drop feature in a complex UITableView custom view. 
Basically, you can drag from one row onto another (rather than between rows). 
Now, this is complicated, but mostly works.

Now, I've implemented autoscroll for the table by putting a long press gesture 
recognizer on a small drag handle view in each of the cells (when in edit 
mode). This works well, until the cell scrolls out of view. At that point, the 
gesture is canceled.

I could try to put the GR on the the view that contains all my other table view 
stuff, but then I have to do the cell (and drag image) hit testing myself. 
Worse, though, is that view won't get the touches because the cells will.

I could put an invisible view on top of the table and add the GR to that, but 
then I'll have to work some magic to allow all other touches down into the 
table.

I'm kind of stuck. Any suggestions?

Thanks,
Rick

___

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(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com