Re: Finder File Size discrepancy..

2011-12-29 Thread Conrad Shultz
On Dec 28, 2011, at 8:31, John Hawkinson  wrote:

> Conrad Shultz wites:
>> * Will a file fit on a storage medium?
>> * How long will it take a file to download?
>> * What percentage of a file do I already have?
>> * (Implicitly) can I manipulate the contents of the file without slowing
>> my computer down?
>> 
>> So: in most cases, I would argue it is better to display the pertinent
>> information, not the file size.
> 
> Unfortunately it is nearly impossible to predict when the user might
> require the size information, and it's extremely frustrating for the
> user when this basic information is hidden.
> 
> So I would disagree, and disagree strongly. Show the information you
> think is more important, but provide the file size too. Make it as
> small or unobtrusive in the UI as you need to, but don't hide it.
> 
Sure, in cases where it is relevant.  But even then I would argue that it's 
relevant mainly for explicit "file manager"-esque applications, not most 
applications.

If by "unobtrusive" you mean something along the lines of "available in a 
Detail panel" then I'm totally on board. I just really don't want it blasted to 
the user in the way it often is in, say, applications on my Linux boxes. 

> For instance, time estimates are *notoriously* unreliable, especially
> where networks are involved.

I agree. But if the software can't make a reasonable estimate, why should we 
expect the user to do better? I can see the need for a percentage indicator 
(which is why download progress bars are a good thing), in part to give the 
user a cue to cancel if it doesn't look like they have enough time to finish a 
download (setting aside download resume for purposes of this discussion). But 
even for power users displaying "xxx of yyy MB" adds no value. The user can't 
*do* anything with this information, at least any more than they could with a 
progress bar.*

About the only place the numeric value is helpful for downloads is when someone 
is tracking their data quota, such as on an iPhone. (Of course, the only reason 
this is necessary is because of user experience failures on the part of telecom 
companies. But I digress.)

(Sent from my iPad.)

--
Conrad Shultz___

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: MVC Theory Question

2011-12-29 Thread Mike Abdullah

On 28 Dec 2011, at 17:05, Philip McIntosh wrote:

> 
> I am just wondering about something with respect to the Model-View-Controller 
> (MVC) design pattern. Should any validation of input or output be done by the 
> model class which is handling and processing the data, or is validation more 
> properly a task to be assigned to a controller class?

Key-Value-Validation is a pretty good example of this. The model is *capable* 
of validating itself, but that validation must be triggered by a higher layer, 
such as a controller.

___

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


AVPlayerLayer on Lion will only play one movie then zaps super layer

2011-12-29 Thread Michael Crawford
I'm creating a simple menu-drive movie player and have run into a problem with 
AVPlayerLayer.  The first time I attach a player with a movie the playback is 
fine.  When a second movie is selected from the menu, I never receive a status 
of -[AVPlayerLayer readyForDisplay] set to true.  If I ignore this status the 
player will play but I only get audio playback (no video).  Investigating the 
status of the view and associated layers involved shows that the layer for the 
layer-backed (not hosted) view becomes nil after playing the first movie.

I have no idea how this is happening.  I've included the relevant snippets 
below because I'm probably looking right at the problem and not seeing it.  
Hopefully someone out that has a little more experience with AVFoundation and 
can give me a clue.

I'm using ARC.


@interface JTVMovieViewController : NSViewController
{
AVPlayerLayer* __strong playerLayer;
}

@property (assign) IBOutlet id delegate;
@property (strong) IBOutlet NSButton* homeButton;
@property (strong) IBOutlet NSView* playerView;

- (void)awakeFromNib
{
playerLayer = [AVPlayerLayer layer];
playerLayer.frame = self.playerView.bounds;
playerLayer.videoGravity = AVLayerVideoGravityResizeAspect;
[playerLayer addObserver:self
  forKeyPath:kReadyForDisplayKey
 options:NSKeyValueObservingOptionNew 
 context:KVOPlayerLayerContext];
[self.playerView.layer addSublayer:playerLayer];
}

- (void)observeValueForKeyPath:(NSString*)keyPath
  ofObject:(id)object
change:(NSDictionary*)change
   context:(void*)context
{
if ( context == KVOMoviePlaylistContext )
{
[self startPlayingNewPlayer:[self.moviePlaylist selection]];
}
else if ( context == KVOPlayerLayerContext )
{
NSLog(@"Player layer %@ ready for display.",
  playerLayer.readyForDisplay ? @"is" : @"is not");

if ( YES == playerLayer.readyForDisplay )
{
[playerLayer.player play];
}
}
}

- (void)startPlayingNewPlayer:(AVPlayer*)player
{
[playerLayer setPlayer:player];

if ( YES == playerLayer.readyForDisplay )
{
[player play];
}

[self.delegate controllerDidBeginVideoPlayback:self];
}

- (void)stopPlayback
{
[[playerLayer player] pause];
[[playerLayer player] seekToTime:kCMTimeZero]; // reset player
[playerLayer setPlayer:nil];
}

(lldb) po [self playerView]
(NSView *) $2 = 0x00010bf83310 
(lldb) po [[self playerView] layer]
(id) $3 = 0x00010bf833d0 <_NSViewBackingLayer:0x10bf833d0; position = 
CGPoint (0 0); bounds = CGRect (0 0; 1920 1080); delegate = ; backgroundFilters = (
); filters = (
); shadowColor = (null); anchorPoint = CGPoint (0 0)>
(lldb) po [[[self playerView] layer] sublayers]
(id) $4 = 0x00010bf0 (

)

(lldb) c
Process 96211 resuming
2011-12-29 08:35:33.421 JTVideoPlayer[96211:503] Player layer is ready for 
display.
<< here is where I stop playback from the UI>
2011-12-29 08:36:35.289 JTVideoPlayer[96211:503] Player layer is not ready for 
display.
(lldb) po [self playerView]
(NSView *) $13 = 0x00010bf83310 
(lldb) po [[self playerView] layer]
(id) $14 = 0x 
(lldb) po [playerLayer superlayer]
(id) $15 = 0x 
(lldb) 

-Michael
___

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


Why is +[NSFileVersion(NSTemporaryCompatibility) unresolvedConflictsExistForItemAtURL:] hanging/

2011-12-29 Thread James Bucanek

Greetings,

I recently upgraded my primary development system to Lion and 
I'm encountering a phenomenon with a lot of different 
applications (not just my own) where the app will hang for 20 
seconds or more when it's first launched or a document it opened.


sample shows this on the main thread:

+   2794 NSApplicationMain  (in AppKit) + 1054  [0x9765e18a]
+ 2794 -[NSApplication run]  (in AppKit) + 911  [0x973c9c22]
+   2794 -[NSApplication 
nextEventMatchingMask:untilDate:inMode:dequeue:]  (in AppKit) + 
113  [0x973cd8ab]

+ 2794 _DPSNextEvent  (in AppKit) + 678  [0x973ce040]
+   2794 BlockUntilNextEventMatchingListInMode  (in 
HIToolbox) + 88  [0x95283c0a]
+ 2794 ReceiveNextEventCommon  (in HIToolbox) + 
168  [0x95283cc6]
+   2794 RunCurrentEventLoopInMode  (in 
HIToolbox) + 318  [0x9527ca7f]
+ 2794 CFRunLoopRunInMode  (in 
CoreFoundation) + 120  [0x95c58798]
+   2794 CFRunLoopRunSpecific  (in 
CoreFoundation) + 332  [0x95c588ec]
+ 2794 __CFRunLoopRun  (in 
CoreFoundation) + 1096  [0x95c590c8]
+   2794 __CFRunLoopDoBlocks  (in 
CoreFoundation) + 337  [0x95c2e3f1]
+ 2794 
__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__  (in CoreFoundation) + 
16  [0x95c7af70]
+   2794 __-[NSDocument 
_windowsDidShow]_block_invoke_1  (in AppKit) + 60  [0x977a96bc]
+ 2794 -[NSDocument 
_handleConflicts]  (in AppKit) + 123  [0x977a3a73]
+   2794 -[NSDocument 
_hasConflict]  (in AppKit) + 63  [0x977a39ee]
+ 2794 
+[NSFileVersion(NSTemporaryCompatibility) 
unresolvedConflictsExistForItemAtURL:]  (in Foundation) + 64  [0x9602c57b]
+   2794 
LBRevisionHasUnsavedConflictForURL  (in Librarian) + 57  [0x7b8786]
+ 2794 
_LBFVSendMessageWithReply  (in Librarian) + 645  [0x7b865e]
+   2794 
xpc_connection_send_message_with_reply_sync  (in libxpc.dylib) + 
233  [0x96749be2]
+ 2794 
dispatch_semaphore_wait  (in libdispatch.dylib) + 36  [0x968e88fc]
+   2794 
_dispatch_semaphore_wait_slow  (in libdispatch.dylib) + 117  [0x968e8800]
+ 2794 
semaphore_wait_trap  (in libsystem_kernel.dylib) + 10  [0x9af26c5e]


So can someone tell me what 
+[NSFileVersion(NSTemporaryCompatibility) 
unresolvedConflictsExistForItemAtURL:] is, why it's hanging, and 
what I might do to make it stop. :)


Cheers,

James
--
James Bucanek

___

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 to get rid of the back button in UIView

2011-12-29 Thread Roland King
[  setHidesBackButton:NO animated:NO ] ? 


On Dec 29, 2011, at 6:35 PM, Alexander Reichstadt wrote:

> Hi,
> 
> this might be totally trivial, but all suggestions I found in the docu and on 
> the web failed. I don't want my detail view to show any kind of back button. 
> So from the documentation I came up with the following possibilities:
> 
> 1. set leftItemsSupplementBackButton to NO
> 2. set leftBarButtonItem to nil
> 3. set leftBarButtonItems to nil
> 
> The button remains though.
> 
>self.detailViewController = [[BVZDetailViewController alloc] 
> initWithNibName:@"BVZDetailViewController" bundle:nil];
>
> self.detailViewController.navigationItem.leftItemsSupplementBackButton = NO;
>self.detailViewController.navigationItem.leftBarButtonItem = nil;
>self.detailViewController.navigationItem.title = @"bla";
> 
> The title bla is displayed. So it's not clear where it is changed and where 
> this button is added or rather where I should remove it after it is added by 
> default.
> 
> I tried the code above --just slightly changed to self.navigationItem--
> 
> - in the controller where the detail view is created
> - in initWithNib
> - in viewDidLoad
> 
> Nothing changes except for the title.
> 
> Please, can someone help?
> 
> Thanks
> Alex
> ___
> 
> 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/rols%40rols.org
> 
> This email sent to r...@rols.org

___

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: Converting to ARC

2011-12-29 Thread Martin Hewitson
Ah, I missed the disclosure triangle. Unfortunately, unchecking that file 
didn't seem to stop the converter from checking it. I needed to do a Clean 
first. 

Just 11 issues to go

Thanks!

Martin


On 29, Dec, 2011, at 06:41 PM, Zac Bowling wrote:

> Uncheck those files in the ARC converter screen.
> 
> Zac
> 
> On Dec 29, 2011, at 9:35 AM, Martin Hewitson  
> wrote:
> 
>> Dear list,
>> 
>> I'm trying to convert a project to ARC using the Refactor -> Convert to 
>> Objective-C ARC... command.
>> 
>> My project uses RegexKitLite which is upsetting the conversion process. It 
>> shows 68 reasons why the conversion is not possible. So I tried adding 
>> -fno-objc-arc to the compiler flags for RegexKitLite.m under the Compile 
>> Sources build phase. It seems the converter is ignoring this, or I've done 
>> something wrong.
>> 
>> Has anyone else had success with this? Is there something else I can do to 
>> tell the converter to compile RegexKitLite.m without ARC?
>> 
>> Best wishes,
>> 
>> Martin
>> 
>> ___
>> 
>> 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/zac%40zacbowling.com
>> 
>> This email sent to z...@zacbowling.com


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


UIToolbar, can't access buttons added in IB

2011-12-29 Thread Alexander Reichstadt
Hi,

in my UIViewController using IB I can add buttons to its view's toolbar bar, I 
am referring to that bar widget thing at the bottom, just in case someone was 
as confused as I was at first. Anyway, I can see them in IB as well as in my 
running app. Yet, when debugging, I found no way to actually get a hold of 
their instances. If I use the controller and say 
navigationController.toolbar.items the resulting array is empty, even though 
the navigationController is not nil nor is its toolbar. I checked in - 
(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 
as well as in viewDidLoad. I also checked in the location where I create the 
instance of the controller.

Is there a way to actually do something with those buttons once they are added 
in IB, or is it like using IB they are built in concrete and somewhere 
inaccessible?

Thanks
Alex

___

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 to cancel call to CSSM_SignData

2011-12-29 Thread Jens Alfke

On Dec 29, 2011, at 10:23 AM, Rajendran P wrote:

> I have multithreaded App   which uses the certificate . the call to  
> CSSM_SignData function invokes the ( SecurityAgent - keychains ) prompt for 
> keychain  password . the call to CSSM_SignData is blocking till the user 
> responds to prompts (the current thread is blocked). i need to cancel the 
> prompts on few scenarios :( . how tocancel the prompts through another 
> thread ? .

To my knowledge there is no way to abort a call that's blocked waiting for the 
user to authenticate. But you're better off asking on the apple-cdsa list; this 
isn't a Cocoa API and I don't think many of the security folks read this list.

—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: How to add "filter" to capture video from the camera?

2011-12-29 Thread douglas welton
Hi,

Step A:

In your delegate for AVCaptureVideoDataOutput, you can use the method

- (void)captureOutput:(AVCaptureOutput *)captureOutput 
didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer 
fromConnection:(AVCaptureConnection *)connection

to grab CMSampleBufferRef representing each frame.  You'll need to get a hold 
of the actual data bytes using various functions for CMSampleBufferRef and/or 
CMBlockBufferRef.  I will assume that you are getting this data back in an RGB 
format.  If not, you'll need to make sure that the requested pixel format 
attributes give you RGB data.

Step B:

Once you get the data buffer, you can get a CIImage using this method:

+ (CIImage *)imageWithBitmapData:(NSData *)d bytesPerRow:(size_t)bpr 
size:(CGSize)size format:(CIFormat)f colorSpace:(CGColorSpaceRef)cs

or you can use a CIImageProvider to create a CIImage.

Step C:

Push your CIImage thru the various CIFilters that you would like to apply.

Step D:

Render your CIImage into a bitmap buffer. Take that data and make a 
CMSampleBufferRef or CVPixelBufferRef, then push that object thru an 
AVAssetWriter object to get the sample written to the destination file.

Note:  This process can take a long time and when done in-line can cause 
captured frames to be dropped, so you'll probably want to copy the incoming 
CMSampleBuffers and process them on a separate thread. Also, the standard 
disclaimers about having written this in an e-mail apply, as well.

Hope that helps.

regards,

douglas

On Dec 28, 2011, at 11:58 PM, 吴明 wrote:

> 
> 
> 
> 
> you know that i want to use this function to my ios app. 
> 
> 
> 
> I know use AVCaptureVideoDataOutputSampleBufferDelegate can get every frame 
> data from capture, but i dont know how to change this data with 
> CVImageBufferRef datatype.
> 
> 
> 在 2011-12-29 01:32:41,"Nick Zitzmann"  写道:
>> 
>> On Dec 27, 2011, at 11:16 PM, 吴明 wrote:
>> 
>>> HI All:
>>> I wont capture view from the camera. and add an image to every frame.then 
>>> save the video to my app.
>>> How do this.
>> 
>> Use QTCaptureView and implement the delegate method -view:willDisplayImage:. 
>> In that method, do what you want to do to the frame, and it will be included 
>> in the final video.
>> 
>> Nick Zitzmann
>> 
>> 
> 
> 
> 
> ___
> 
> 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/douglas_welton%40earthlink.net
> 
> This email sent to douglas_wel...@earthlink.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: viewWillAppear not called with UINavigationController containment

2011-12-29 Thread Matt Neuburg

On Dec 28, 2011, at 5:49 PM, Roland King wrote:

> So I found that it's almost impossible NOT to get viewWillAppear and all the 
> other messages in perfect order for every view every single time. As long as 
> you call addChildViewController and didMoveToParent (either bracketing the 
> add of the VC's view or not, depending on whether you are actually adding the 
> subview at that time or deferring it to later as you would with say a 
> tabviewcontroller type container) and the reverse, you get the calls. The 
> only way I could find NOT to get them is to mess about adding and removing 
> subviews in layoutSubviews of the custom container view controller's view.

I believe that's what I was referring to when I use the word "skanky"...

Always worth remembering: It's a framework. Use by it by letting it use you. 
When you're told to do a certain dance, just do the dance. What my example 
tries to do is show you exactly what the dance is supposed to look like:



m.

--
matt neuburg, phd = m...@tidbits.com, http://www.apeth.net/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
Programming iOS 4! http://www.apeth.net/matt/default.html#iosbook
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.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 to get rid of the back button in UIView

2011-12-29 Thread Roland King
.. or even setHidesBackButton:YES animated:NO

.. what's up with me today ... 

On Dec 29, 2011, at 6:41 PM, Roland King wrote:

> [  setHidesBackButton:NO animated:NO ] ? 
> 
> 
> On Dec 29, 2011, at 6:35 PM, Alexander Reichstadt wrote:
> 
>> Hi,
>> 
>> this might be totally trivial, but all suggestions I found in the docu and 
>> on the web failed. I don't want my detail view to show any kind of back 
>> button. So from the documentation I came up with the following possibilities:
>> 
>> 1. set leftItemsSupplementBackButton to NO
>> 2. set leftBarButtonItem to nil
>> 3. set leftBarButtonItems to nil
>> 
>> The button remains though.
>> 
>>   self.detailViewController = [[BVZDetailViewController alloc] 
>> initWithNibName:@"BVZDetailViewController" bundle:nil];
>>   
>> self.detailViewController.navigationItem.leftItemsSupplementBackButton = NO;
>>   self.detailViewController.navigationItem.leftBarButtonItem = nil;
>>   self.detailViewController.navigationItem.title = @"bla";
>> 
>> The title bla is displayed. So it's not clear where it is changed and where 
>> this button is added or rather where I should remove it after it is added by 
>> default.
>> 
>> I tried the code above --just slightly changed to self.navigationItem--
>> 
>> - in the controller where the detail view is created
>> - in initWithNib
>> - in viewDidLoad
>> 
>> Nothing changes except for the title.
>> 
>> Please, can someone help?
>> 
>> Thanks
>> Alex
>> ___
>> 
>> 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/rols%40rols.org
>> 
>> This email sent to r...@rols.org
> 
> ___
> 
> 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/rols%40rols.org
> 
> This email sent to r...@rols.org

___

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 to get rid of the back button in UIView

2011-12-29 Thread Alexander Reichstadt
Hi,

this might be totally trivial, but all suggestions I found in the docu and on 
the web failed. I don't want my detail view to show any kind of back button. So 
from the documentation I came up with the following possibilities:

1. set leftItemsSupplementBackButton to NO
2. set leftBarButtonItem to nil
3. set leftBarButtonItems to nil

The button remains though.

self.detailViewController = [[BVZDetailViewController alloc] 
initWithNibName:@"BVZDetailViewController" bundle:nil];

self.detailViewController.navigationItem.leftItemsSupplementBackButton = NO;
self.detailViewController.navigationItem.leftBarButtonItem = nil;
self.detailViewController.navigationItem.title = @"bla";

The title bla is displayed. So it's not clear where it is changed and where 
this button is added or rather where I should remove it after it is added by 
default.

I tried the code above --just slightly changed to self.navigationItem--

- in the controller where the detail view is created
- in initWithNib
- in viewDidLoad

Nothing changes except for the title.

Please, can someone help?

Thanks
Alex
___

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 to get rid of the back button in UIView

2011-12-29 Thread Alexander Reichstadt
Thanks, this works.



On 29.12.2011, at 11:45, lbland wrote:

> hi-
> 
> On Dec 29, 2011, at 5:35 AM, Alexander Reichstadt wrote:
> 
>> Please, can someone help?
> 
> navigationItem.hidesBackButton = YES;
> 
> ??
> 
> ... but maybe your detailed view should be some other type of modal view 
> controller ...
> 
> thanks!-
> 
> -lance
> 

___

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 to cancel call to CSSM_SignData

2011-12-29 Thread Rajendran P
I have multithreaded App   which uses the certificate . the call to  
CSSM_SignData function invokes the ( SecurityAgent - keychains ) prompt for 
keychain  password . the call to CSSM_SignData is blocking till the user 
responds to prompts (the current thread is blocked). i need to cancel the 
prompts on few scenarios :( . how to    cancel the prompts through another 
thread ? .



crtn = CSSM_SignData(sigHand,
    text,
    1,
    CSSM_ALGID_NONE,
    sig);

currently i have an apple script doing this job for me , i am not an expert in 
apple script and certainly prefer cpp or obj 



tell application "System Events"
    set theWindows to windows of process "SecurityAgent"
    repeat with theWindow in theWindows
        (every UI element of group 1 of theWindow whose name contains "myapp")
        tell theWindow
            set theStattext to (every static text of theWindow)
            if (theStattext count) > 0 then
                if button 1 of sheet 1 of theWindow exists then
                    click button 1 of sheet 1 of theWindow
                end if
                if button 2 of group 1 exists then
                    click button 2 of group 1
                    return
                end if
            end if
        end tell
    end repeat
end tell




 
  P.Rajendran or Raju   

(for further details contact 
me )    
___

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


Converting to ARC

2011-12-29 Thread Martin Hewitson
Dear list,

I'm trying to convert a project to ARC using the Refactor -> Convert to 
Objective-C ARC... command.

My project uses RegexKitLite which is upsetting the conversion process. It 
shows 68 reasons why the conversion is not possible. So I tried adding 
-fno-objc-arc to the compiler flags for RegexKitLite.m under the Compile 
Sources build phase. It seems the converter is ignoring this, or I've done 
something wrong.

Has anyone else had success with this? Is there something else I can do to tell 
the converter to compile RegexKitLite.m without ARC?

Best wishes,

Martin

___

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: Template Images in Table Cells

2011-12-29 Thread Seth Willits
On Dec 28, 2011, at 3:19 AM, Lee Ann Rucker wrote:

>> I'm currently drawing the image in my custom cell using [image 
>> drawInRect:], the image is a proper template image (the property is YES 
>> etc), but it's still just a grayscale image.
> 
> You have to let the cell draw the image. [NSImage drawInRect:...] doesn't 
> change the image and whatever NSButtonCell does isn't public.
> 
> If that's not feasible, you can make a temporary NSButtonCell and use it to 
> draw into another image that you can then use where you need it. 
> rdar://9643738 requested an easy way to do that and was marked as a duplicate 
> of 8067825.


Hmm. Ok, so I dropped a template image into an NSButtonCell in a table column, 
and inside of an NSButton just sitting on top of the table. Neither worked:
http://sethwillits.com/temp/upshot/upshot_EB5e2jd0.jpg

(Ignore the focus on the right burn button)

So it seems there's more to it than simply having the template image be in the 
button cell. 



--
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


RaiseMan Exception

2011-12-29 Thread Todd Heberlein
I'm getting an exception thrown that I am trying to figure out.

I'm working through "Cocoa Programming for Mac OS X" fourth edition, and added 
the first undo code in chapter 151 -- the Undo code for adding and removing 
Person objects. Testing seems to work fine, except when I do repeated Undo and 
Redo menu commands very rapidly. At some point when I click on the "Edit" menu 
the program crashes.

For example, I click on "Add Employee" twice, and then repeated go to
Edit --> Undo Add Person
Edit --> Redo Add Person

Crash

The exception is from the default template code:

- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError

The frames stack is:
0 __pthread_kill
9 _objc_exception_destructor
10 -[RMDocument dataOfType:error:]  <-- exception 
thrown here
11 -[NSDocument writeToURL:ofType:error:]
39 NSApplicationMain
40 main

Any ideas why I'm getting the exception?

Any idea why [NSDocument writeToURL:ofType:error:] is being called?

Thanks,

Todd

PS. Using
Xcode 4.2 (Build 4D199)
Mac OS 10.7.2
Mac Book Air (MacBookAir3,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: RaiseMan Exception

2011-12-29 Thread Todd Heberlein
Ah... I figured out an even easier way to repeat the issue.

(1) Run the application.
(2) Add one Person
(3) Click on Mail application to bring it to the front.
(4) wait just a second or two

then crash

The exception is thrown from the same place.

Is this an iCloud thing by any chance?  I haven't added any code to save the 
data yet.

Todd

On Dec 29, 2011, at 12:52 PM, Todd Heberlein wrote:

> I'm getting an exception thrown that I am trying to figure out.
> ...
> The frames stack is:
>   0 __pthread_kill
>   9 _objc_exception_destructor
>   10 -[RMDocument dataOfType:error:]  <-- exception 
> thrown here
>   11 -[NSDocument writeToURL:ofType:error:]
>   39 NSApplicationMain
>   40 main

___

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: RaiseMan Exception

2011-12-29 Thread Todd Heberlein

On Dec 29, 2011, at 12:57 PM, Todd Heberlein wrote:

> Ah... I figured out an even easier way to repeat the issue.

Even simpler!  (sorry for all the spam)

(1) Add one Person object
(2) wait 30-60 seconds.

crash.

No clicking on the Edit menu. No clicking away to another application.

Slightly annoyed,

Todd

___

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: RaiseMan Exception

2011-12-29 Thread Jens Alfke
Well, show us some code. (I don't have that book you're working from.)
What is the line that raises the exception? What are the values of variables at 
that point?

—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


iOS From 1,99 To 1.99

2011-12-29 Thread Sandro Noël
Greetings!

This is simple I'm sure and I'm just missing the proper class to do it.
I need to convert a string representation from Canadian local to US Local.
1,99 to 1.99

The model is a float called quantity.

>From that model I pick up the value and display a localized representation of 
>that float value into a UITextField (1,99)
to allow user to edit the value, when the user is done updating the value I 
need to pick up the string from the text field and update the model.

self.model.quantity = [self.numberTextView.text floatValue];

Only return 1.00 which is not correct.

NSLocale *locale = [[NSLocale alloc]initWithLocaleIdentifier:@"en_US"];
NSNumberFormatter *formatter = [[NSNumberFormatter alloc]init];
[formatter setLocale:locale];
[formatter setNumberStyle:NSNumberFormatterDecimalStyle];
NSNumber *number = [formatter numberFromString:self.numberTextView.text];
NSString *numberString = [[NSString stringWithFormat:@"%.2f", [number 
floatValue] ];
NSLog(@"%@",numberString);

Returns 0.00, even worst!!

What am I missing ?

Sandro.___

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


Code error in Your First Mac App tutorial..

2011-12-29 Thread Peter Teeson
I'm familiarizing myself with Xcode 4.2.1 under Lion 10.7.2 so am doing the 
"Your First Mac App" tutorial.

This code snippet from the tutorial is incorrect and causes an error in 
compilation. 
if (sender == textField) { senderName = @"textField"; }…….
The error is "Use of undeclared identifier 'textField'; did you mean 
_textField?"

The correct code is: 
if (sender == self.textField){senderName = @"textField"; }

In fact if you refer to any of the synthesized iVars such as 'window' or 
'slider' 
or indeed any that you care to make up for yourself (eg aardvark) the same 
issue occurs. 

I don't know if this is a scope, language or compiler issue.
Why would one need to use self.textField?

The tutorial is in Mac OS X 10.7 Core Library > General > Your First Mac App > 
Make Connections > Check your Progress > To add log statements >
3 Implement the takeFloatValueForVolumeFrom: method as follows:

I've sent feedback to the document maintainers.

In fact the final code at the end of the tutorial does not contain that code 
but is far simpler.
Nevertheless the code needs correction for the sake of newcomers.


___

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: RaiseMan Exception

2011-12-29 Thread Todd Heberlein

On Dec 29, 2011, at 1:27 PM, Jens Alfke wrote:

> Well, show us some code. (I don't have that book you're working from.)
> What is the line that raises the exception? What are the values of variables 
> at that point?

It is the default code from the Document-based application.  It is the @throw 
exception line

- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError
{
/*
 Insert code here to write your document to data of the specified type. If 
outError != NULL, ensure that you create and set an appropriate error when 
returning nil.
You can also choose to override -fileWrapperOfType:error:, 
-writeToURL:ofType:error:, or 
-writeToURL:ofType:forSaveOperation:originalContentsURL:error: instead.
*/
NSException *exception = [NSException 
exceptionWithName:@"UnimplementedMethod" reason:[NSString stringWithFormat:@"%@ 
is unimplemented", NSStringFromSelector(_cmd)] userInfo:nil];
@throw exception;
return nil;
}


This seems to be being called by
-[NSDocument writeToURL:ofType:error:]

Except, I'm not doing anything that should prompt the document to be saved. 
Something else is instigating this activity. That is probably what is confusing 
me the most.

Todd

___

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: Template Images in Table Cells

2011-12-29 Thread Kyle Sluder
On Thu, Dec 29, 2011 at 12:26 PM, Seth Willits  wrote:
> On Dec 28, 2011, at 3:19 AM, Lee Ann Rucker wrote:
>
>>> I'm currently drawing the image in my custom cell using [image 
>>> drawInRect:], the image is a proper template image (the property is YES 
>>> etc), but it's still just a grayscale image.
>>
>> You have to let the cell draw the image. [NSImage drawInRect:...] doesn't 
>> change the image and whatever NSButtonCell does isn't public.
>>
>> If that's not feasible, you can make a temporary NSButtonCell and use it to 
>> draw into another image that you can then use where you need it. 
>> rdar://9643738 requested an easy way to do that and was marked as a 
>> duplicate of 8067825.
>
>
> Hmm. Ok, so I dropped a template image into an NSButtonCell in a table 
> column, and inside of an NSButton just sitting on top of the table. Neither 
> worked:
> http://sethwillits.com/temp/upshot/upshot_EB5e2jd0.jpg
>
> (Ignore the focus on the right burn button)
>
> So it seems there's more to it than simply having the template image be in 
> the button cell.

Did you remember to set backgroundStyle=NSBackgroundStyleRaised on the
NSButtonCell?

This is described in the Text and Image Effects section of the 10.5
AppKit Release Notes:
http://developer.apple.com/library/mac/#releasenotes/Cocoa/AppKitOlderNotes.html

--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: RaiseMan Exception

2011-12-29 Thread Ken Thomases
On Dec 29, 2011, at 3:14 PM, Todd Heberlein wrote:

> (1) Add one Person object
> (2) wait 30-60 seconds.
> 
> crash.
> 
> No clicking on the Edit menu. No clicking away to another application.

On Dec 29, 2011, at 2:52 PM, Todd Heberlein wrote:

> The exception is from the default template code:
> 
>   - (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError
> 
> The frames stack is:
>   0 __pthread_kill
>   9 _objc_exception_destructor
>   10 -[RMDocument dataOfType:error:]  <-- exception 
> thrown here
>   11 -[NSDocument writeToURL:ofType:error:]
>   39 NSApplicationMain
>   40 main
> 
> Any ideas why I'm getting the exception?
> 
> Any idea why [NSDocument writeToURL:ofType:error:] is being called?

This is probably Lion's Auto Save feature triggering a save because the 
document has been dirtied.  As Jens pointed out, you haven't shown the code, 
but I suppose that part may not be done yet if the tutorial you're following 
hasn't gotten to that point, yet.

The book may need to be updated for Lion.  You can probably fix things by just 
returning nil from -dataOfType:error:.

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: RaiseMan Exception

2011-12-29 Thread Conrad Shultz
This sounds like Lion auto saving. Are you on Lion? If so, do you return YES 
from -autosavesInPlace in your NSDocument subclass?

(Sent from my iPhone.)

--
Conrad Shultz

On Dec 29, 2011, at 13:14, Todd Heberlein  wrote:

> 
> On Dec 29, 2011, at 12:57 PM, Todd Heberlein wrote:
> 
>> Ah... I figured out an even easier way to repeat the issue.
> 
> Even simpler!  (sorry for all the spam)
> 
> (1) Add one Person object
> (2) wait 30-60 seconds.
> 
> crash.
> 
> No clicking on the Edit menu. No clicking away to another application.
> 
> Slightly annoyed,
> 
> Todd
> 
> ___
> 
> 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/conrad%40synthetiqsolutions.com
> 
> This email sent to con...@synthetiqsolutions.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: Code error in Your First Mac App tutorial..

2011-12-29 Thread Ken Thomases
On Dec 29, 2011, at 3:38 PM, Peter Teeson wrote:

> I'm familiarizing myself with Xcode 4.2.1 under Lion 10.7.2 so am doing the 
> "Your First Mac App" tutorial.
> 
> This code snippet from the tutorial is incorrect and causes an error in 
> compilation. 
>   if (sender == textField) { senderName = @"textField"; }…….
> The error is "Use of undeclared identifier 'textField'; did you mean 
> _textField?"
> 
> The correct code is: 
>   if (sender == self.textField){senderName = @"textField"; }
> 
> In fact if you refer to any of the synthesized iVars such as 'window' or 
> 'slider' 
> or indeed any that you care to make up for yourself (eg aardvark) the same 
> issue occurs. 
> 
> I don't know if this is a scope, language or compiler issue.
> Why would one need to use self.textField?

This is just an issue with the tutorial.  Those properties are @synthesized 
with an explicit instance variable name, which is different from the property 
name due to the underscore prefix:

@synthesize textField = _textField;

You don't necessarily have to refer to "self.textField".  You could have 
changed that line to be:

if (sender == _textField){senderName = @"textField"; }

The problem with the original is that it referred to an identifier "textField" 
which didn't correspond to any declared variable.  The instance variable is 
called "_textField".  And property names are not accessible just as naked 
identifiers; they need to be accessed using Dot Syntax (or, of course, using 
the getter or setter names or Key-Value Coding).

It was good of you to give that feedback to the document maintainers.

Cheers,
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: iOS From 1,99 To 1.99

2011-12-29 Thread Jens Alfke

On Dec 29, 2011, at 1:39 PM, Sandro Noël wrote:

> NSLocale *locale = [[NSLocale alloc]initWithLocaleIdentifier:@"en_US"];

You're trying to parse a Canadian-format string, but initializing the formatter 
with the US locale. You probably want something like "fr_CA" (since I'm 
assuming this is a Quebecois thing only.)

—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: RaiseMan Exception

2011-12-29 Thread Todd Heberlein

On Dec 29, 2011, at 1:50 PM, Conrad Shultz wrote:

> This sounds like Lion auto saving. Are you on Lion? If so, do you return YES 
> from -autosavesInPlace in your NSDocument subclass?

Yes. I just created a new document-based app to test it, and sure enough, the 
template code that is created has

+ (BOOL)autosavesInPlace
{
return YES;
}


Commenting it out seems to have done the trick... I'll bring it back after I 
finish Chapter 10 on archiving.

Thanks everyone!

Todd

___

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: Template Images in Table Cells

2011-12-29 Thread Lee Ann Rucker

>On Dec 28, 2011, at 3:19 AM, Lee Ann Rucker wrote:

>>> I'm currently drawing the image in my custom cell using [image 
>>> drawInRect:], the image is a proper template image (the property is YES 
>>> etc), but it's still just a grayscale image.
> 
>> You have to let the cell draw the image. [NSImage drawInRect:...] doesn't 
>> change the image and whatever NSButtonCell does isn't public.
> 
>> If that's not feasible, you can make a temporary NSButtonCell and use it to 
>> draw into another image that you can then use where you need it. 
>> rdar://9643738 requested an easy way to do that and was marked as a 
>> duplicate of 8067825.


>Hmm. Ok, so I dropped a template image into an NSButtonCell in a table column, 
>and inside of an NSButton just sitting on top of the table. Neither worked:
http://sethwillits.com/temp/upshot/upshot_EB5e2jd0.jpg

>(Ignore the focus on the right burn button)

>So it seems there's more to it than simply having the template image be in the 
>button cell. 

Yes, you have to set the button cell style & state so it knows what style to 
apply to the template image (that's why NSImage drawing doesn't do anything - 
it doesn't know cell state), and I don't have the code with me so I can't help 
there. What I did to work it out was to create a button in IB and tweak its 
settings to see how that affected the image, then use that in code.
___

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: RaiseMan Exception

2011-12-29 Thread Bayes Scott F
I think it's addressed in the errata for the book on Bignerd's web site.


ScottB

On Dec 29, 2011, at 15:39 , Todd Heberlein wrote:

> 
> On Dec 29, 2011, at 1:50 PM, Conrad Shultz wrote:
> 
>> This sounds like Lion auto saving. Are you on Lion? If so, do you return YES 
>> from -autosavesInPlace in your NSDocument subclass?
> 
> Yes. I just created a new document-based app to test it, and sure enough, the 
> template code that is created has
> 
> + (BOOL)autosavesInPlace
> {
>return YES;
> }
> 
> 
> Commenting it out seems to have done the trick... I'll bring it back after I 
> finish Chapter 10 on archiving.
> 
> Thanks everyone!
> 
> Todd
> 
> ___
> 
> 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/scottbayes-dev%40comcast.net
> 
> This email sent to scottbayes-...@comcast.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: Code error in Your First Mac App tutorial..

2011-12-29 Thread Peter Teeson
Thanks for your reply Ken. But I still don't understand. See bottom post.

On 2011-12-29, at 5:23 PM, Ken Thomases wrote:
> On Dec 29, 2011, at 3:38 PM, Peter Teeson wrote:
>> I'm familiarizing myself with Xcode 4.2.1 under Lion 10.7.2 so am doing the 
>> "Your First Mac App" tutorial.
>> This code snippet from the tutorial is incorrect and causes an error in 
>> compilation. 
>>  if (sender == textField) { senderName = @"textField"; }…….
>> The error is "Use of undeclared identifier 'textField'; did you mean 
>> _textField?"
>> The correct code is: 
>>  if (sender == self.textField){senderName = @"textField"; }
>> In fact if you refer to any of the synthesized iVars such as 'window' or 
>> 'slider' 
>> or indeed any that you care to make up for yourself (eg aardvark) the same 
>> issue occurs. 
>> I don't know if this is a scope, language or compiler issue.
>> Why would one need to use self.textField?
> This is just an issue with the tutorial.  Those properties are @synthesized 
> with an explicit instance variable name, which is different from the property 
> name due to the underscore prefix:
>   @synthesize textField = _textField;
> You don't necessarily have to refer to "self.textField".  You could have 
> changed that line to be:
>   if (sender == _textField){senderName = @"textField"; }
> The problem with the original is that it referred to an identifier 
> "textField" which didn't correspond to any declared variable.  The instance 
> variable is called "_textField".  And property names are not accessible just 
> as naked identifiers; they need to be accessed using Dot Syntax (or, of 
> course, using the getter or setter names or Key-Value Coding).
> It was good of you to give that feedback to the document maintainers.
> Cheers,
> Ken

The declaration in the Interface .h file, generated by making the Outlet 
connection. is:
@property (weak) IBOutlet NSTextField *textField;
To me that @property statement gives the explicit name textField.
The generated @synthesize statement in the Implementation file is the one that 
assigns _textField isn't it?

I understand that I could have used _textField. In fact in my research I tried 
it and it worked.
Similarly for the other iVars window/_window and mute/_mute.
Doing the digging is what led to me conclude there is some general rule which I 
do not yet know.

I understand there is a special meaning for vars beginning with under bar but I 
still have to refresh my memory on
Obj-C 2.0.

So I repeat my question; can someone please explain why I had to use 
self.textfield?

Thanks…

Peter
___

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: Code error in Your First Mac App tutorial..

2011-12-29 Thread Conrad Shultz
On 12/29/11 6:07 PM, Peter Teeson wrote:
> The declaration in the Interface .h file, generated by making the Outlet 
> connection. is:
> @property (weak) IBOutlet NSTextField *textField;
> To me that @property statement gives the explicit name textField.
> The generated @synthesize statement in the Implementation file is the one 
> that assigns _textField isn't it?
> 
> I understand that I could have used _textField. In fact in my research I 
> tried it and it worked.
> Similarly for the other iVars window/_window and mute/_mute.
> Doing the digging is what led to me conclude there is some general rule which 
> I do not yet know.
> 
> I understand there is a special meaning for vars beginning with under bar but 
> I still have to refresh my memory on
> Obj-C 2.0.
> 
> So I repeat my question; can someone please explain why I had to use 
> self.textfield?

"textField" is the name of the *property*.  "_textField" is the name of
the (private) *instance variable* (ivar) that is backing the property.

This might be a little less confusing if the names weren't so similar.
Consider analogously:

@property (weak) IBOutlet NSTextField *phoneNumberField;

@synthesize phoneNumberField = internalRepresentationOfPhoneNumberField;

In this case, you would have a *property* called "phoneNumberField" that
you might, for example, connect in Interface Builder to a field holding
a phone number.

You would have an *ivar* called
"internalRepresentationOfPhoneNumberField" that stores the actual
(pointer to) the property.

You could then access the property with:

self.phoneNumberField or [self phoneNumberField]

What @synthesize is doing is, for all practical purposes, creating a

-(NSTextField *)phoneNumberField

method that you call to access the property of that name.

You could access the ivar directly with
internalRepresentationOfPhoneNumberField.  What the combination of
@property and @synthesize is doing is, roughly, equivalent to manually
writing:

@interface MyClass : NSView {
@private
__weak NSTextField *internalRepresentationOfPhoneNumberField;
}

- (NSTextField *)phoneNumberField;
- (void)setPhoneNumberField:(NSTextField *)newtextField;

@end

@implementation MyClass

- (NSTextField *)phoneNumberField {
return internalRepresentationOfPhoneNumberField;
}

- (void)setPhoneNumberField:(NSTextField *)newTextField {
internalRepresentationOfPhoneNumberField = newTextField;
}

@end

(Typed in mail, and omitting the IBOutlet semantics.)

You should be able to see from this expanded example why you would then
need to use either "[self phoneNumberField]" OR
"internalRepresentationOfPhoneNumberField".

Does that help at all?

Why does this matter?  In part because properties do not actually need
to be backed by ivars.  For example, you might have a class that manages
student performance and has an interface that hypothetically looks like:

@interface ExamCollection : NSObject {
}

- (void)addExam:(Exam *)anExam;
- (void)removeExam:(Exam *)anExam;

@property (readonly) NSNumber *averageExamScore;
@end

@implementation ExamCollection
...

- (NSNumber *)averageExamScore {
// Loop over exams and return the computed average
}
@end

(A real world example of a readwrite property that is not backed by an
ivar is UIView's frame on iOS, but that makes for a more complicated
discussion... read up on it if interested. :-)

-- 
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.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: Code error in Your First Mac App tutorial..

2011-12-29 Thread Gary L. Wade
Because there is no instance variable named textField, but there is one named 
_textField.

The property declaration makes available calls [self textField] and [self 
setTextField:x] which are the same as self.textField in get (x = 
self.textField) and set (self.textField = x) operations, respectively, and are 
method calls. The synthesize makes available self->_textField which can be 
shortened to _textField within the class's instance methods; this is the actual 
storage, not a method. If you left off the explicit name within the synthesize 
call, or even the prepended underscore, you could make all these look the same 
although they would still behave as described.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

On Dec 29, 2011, at 6:07 PM, Peter Teeson  wrote:

> Thanks for your reply Ken. But I still don't understand. See bottom post.
> 
> On 2011-12-29, at 5:23 PM, Ken Thomases wrote:
>> On Dec 29, 2011, at 3:38 PM, Peter Teeson wrote:
>>> I'm familiarizing myself with Xcode 4.2.1 under Lion 10.7.2 so am doing the 
>>> "Your First Mac App" tutorial.
>>> This code snippet from the tutorial is incorrect and causes an error in 
>>> compilation. 
>>>if (sender == textField) { senderName = @"textField"; }…….
>>> The error is "Use of undeclared identifier 'textField'; did you mean 
>>> _textField?"
>>> The correct code is: 
>>>if (sender == self.textField){senderName = @"textField"; }
>>> In fact if you refer to any of the synthesized iVars such as 'window' or 
>>> 'slider' 
>>> or indeed any that you care to make up for yourself (eg aardvark) the same 
>>> issue occurs. 
>>> I don't know if this is a scope, language or compiler issue.
>>> Why would one need to use self.textField?
>> This is just an issue with the tutorial.  Those properties are @synthesized 
>> with an explicit instance variable name, which is different from the 
>> property name due to the underscore prefix:
>>@synthesize textField = _textField;
>> You don't necessarily have to refer to "self.textField".  You could have 
>> changed that line to be:
>>if (sender == _textField){senderName = @"textField"; }
>> The problem with the original is that it referred to an identifier 
>> "textField" which didn't correspond to any declared variable.  The instance 
>> variable is called "_textField".  And property names are not accessible just 
>> as naked identifiers; they need to be accessed using Dot Syntax (or, of 
>> course, using the getter or setter names or Key-Value Coding).
>> It was good of you to give that feedback to the document maintainers.
>> Cheers,
>> Ken
> 
> The declaration in the Interface .h file, generated by making the Outlet 
> connection. is:
> @property (weak) IBOutlet NSTextField *textField;
> To me that @property statement gives the explicit name textField.
> The generated @synthesize statement in the Implementation file is the one 
> that assigns _textField isn't it?
> 
> I understand that I could have used _textField. In fact in my research I 
> tried it and it worked.
> Similarly for the other iVars window/_window and mute/_mute.
> Doing the digging is what led to me conclude there is some general rule which 
> I do not yet know.
> 
> I understand there is a special meaning for vars beginning with under bar but 
> I still have to refresh my memory on
> Obj-C 2.0.
> 
> So I repeat my question; can someone please explain why I had to use 
> self.textfield?
> 
> Thanks…
> 
> Peter
___

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: Code error in Your First Mac App tutorial..

2011-12-29 Thread Peter Teeson
On 2011-12-29, at 9:43 PM, Conrad Shultz wrote:
> "textField" is the name of the *property*.  "_textField" is the name of
> the (private) *instance variable* (ivar) that is backing the property.


Thanks Conrad for that full explanation which I now fully understand.
Actually the way I think of it now is that in this example "textField" is 
really the name of a *method*.

As Ken stated earlier it's merely an error in the tutorial code.
For which I'm very glad since It made me carefully re-read the Declared 
Properties chapter of OBJ-C 2.0.

One key thing to remember is that @property occurs in the method declaration 
list.
Another is that @synthesize generates accessor *methods*;

So that in the expression if (sender == self.textField){senderName = 
@"textField"; }
we are invoking the accessor method textField. As with any local method we need 
self.

My first use of Obj-C 2.0. Yippee I learned something today.

Thanks everyone.







___

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: iOS From 1,99 To 1.99

2011-12-29 Thread Sandro Noël
Jens, thanks for replying.

a, It's a convert From local, not Convert To local !!!
I won't soon forget this one :)

Sandro.

On 2011-12-29, at 6:22 PM, Jens Alfke wrote:

> 
> On Dec 29, 2011, at 1:39 PM, Sandro Noël wrote:
> 
>> NSLocale *locale = [[NSLocale alloc]initWithLocaleIdentifier:@"en_US"];
> 
> You're trying to parse a Canadian-format string, but initializing the 
> formatter with the US locale. You probably want something like "fr_CA" (since 
> I'm assuming this is a Quebecois thing only.)
> 
> —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: Template Images in Table Cells

2011-12-29 Thread Seth Willits
On Dec 29, 2011, at 1:42 PM, Kyle Sluder wrote:

>> So it seems there's more to it than simply having the template image be in 
>> the button cell.
> 
> Did you remember to set backgroundStyle=NSBackgroundStyleRaised on the
> NSButtonCell?
> 
> This is described in the Text and Image Effects section of the 10.5
> AppKit Release Notes:
> http://developer.apple.com/library/mac/#releasenotes/Cocoa/AppKitOlderNotes.html



Ok, I see. I never really knew about that, I don't think. Ok, so now I have it 
working as expected, though sadly, it doesn't do the right coloring on 10.6 in 
tables like it does on 10.7; it's still just predominantly grayscale (with ever 
so slight value differences because of the slight translucency) versus 10.7's 
obvious colorizing. 

Hmm. I guess I'm stuck with either programatic image swapping based on the OS 
and having two sets of icons, or use the wrong style on of the two OSes. Grrr.


Thanks for the help.


--
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